Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open AI (CognitiveServices\account) intermittent issue - Cannot modify resource with id because the resource entity provisioning state is not terminal #2419

Open
lp112358 opened this issue Jan 23, 2025 · 1 comment

Comments

@lp112358
Copy link

Bicep version
0.32.4

Describe the bug
I am using Azure Pipelines, with a Microsoft-hosted agent (windows-latest / windows-2022 image) to execute my bicep scripts. I am creating a basic cognitive services account using Microsoft.CognitiveServices/accounts@2024-10-01. When I execute this script, it most often, but not always, fails on the deployment due to the error Cannot modify resource with id '/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.CognitiveServices/accounts/XXXX' because the resource entity provisioning state is not terminal. Please wait for the provisioning state to become terminal and then retry the request.".

My bicep script for this resource is as follows:

resource account 'Microsoft.CognitiveServices/accounts@2024-10-01' = {
  name: accountName
  location: 'eastus'
  sku: {
    name: 'S0'
  }
  kind: 'OpenAI'
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    apiProperties: {
      statisticsEnabled: false
    }
    customSubDomainName: accountName
    networkAcls: {
      defaultAction: 'Allow'
      virtualNetworkRules: []
      ipRules: []
    }
    publicNetworkAccess: 'Enabled'
  }
  tags: tags
}

I am using an AzureCLI@2 task (AZ CLI version 2.68.0) in a pipeline template to create the deployment:

az deployment sub create --location '${{ parameters.resourceGroupLocation }}' `
          --template-file '${{ parameters.bicepFile }}' `
          --parameters '${{ parameters.bicepParamFile }}') `
          | ConvertFrom-Json

To Reproduce
I simple execute my pipeline. In most cases, a single additional re-run of the job will succeed, but just this morning, I had to run 4 more times to be able to get the deployment to succeed.

Additional context
Full error:

ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/XXXX/providers/Microsoft.Resources/deployments/main","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.Resources/deployments/openAiModule","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.Resources/deployments/openAiModule","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"RequestConflict","message":"Cannot modify resource with id '/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.CognitiveServices/accounts/XXXX' because the resource entity provisioning state is not terminal. Please wait for the provisioning state to become terminal and then retry the request."}]}]}]}}

@stephaniezyen
Copy link
Contributor

This looks to be an issue with the Microsoft.CognitiveServices resource provider. please open a support ticket with that team, and we will try to route it on our own end.

@stephaniezyen stephaniezyen transferred this issue from Azure/bicep Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants