Azure / Azure/azure-dev

[Issue] azd provision lacks actionable guidance for Cognitive Services RequestConflict

Open
#9,398 3 comments 0 reactions 0 assignees View on GitHub
area/bicep area/provisioning
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

- [x] Make sure you've installed the latest version using [instructions](https://github.com/Azure/azure-dev?tab=readme-ov-file#installupgrade-azure-developer-cli)

**Output from `azd version`**

```text
azd version 1.29.0 (commit fc06de978b9e9dc98a50ebb601a18b0f9f24071a) (stable)
```

**Describe the bug**

When a Bicep template contains multiple sibling `Microsoft.CognitiveServices/accounts/deployments` resources under the same Cognitive Services/Azure AI Services account, ARM schedules those independent children concurrently. The `Microsoft.CognitiveServices` resource provider rejects the concurrent writes with `RequestConflict` because another operation is already running against the parent account.

The underlying concurrency restriction belongs to the resource provider, not azd. However, `azd provision` currently reports the deployment failure without actionable guidance that these child resources must be serialized. An azd error suggestion for this known provider response, and serialization in any azd-generated Azure AI model infrastructure, would make the failure diagnosable.

**To Reproduce**

1. Declare one `Microsoft.CognitiveServices/accounts` resource with `kind: 'AIServices'`.
2. Declare two or more `Microsoft.CognitiveServices/accounts/deployments` child resources with the account as `parent`, but no dependencies between the sibling deployments.
3. Run `azd provision --no-prompt`.
4. Observe that one model deployment may succeed while the concurrent siblings fail with:

```text
Code: RequestConflict
Message: Another operation is being performed on the parent resource ... Microsoft.CognitiveServices/accounts/. Please try again later.
```

5. Add an explicit `dependsOn` chain between the model deployments and run `azd provision` again.

We verified this with five model deployments. Without sibling dependencies, four failed with `RequestConflict` after roughly 0.7 seconds. With the dependency chain restored, all five model deployments and the complete provision succeeded.

**Expected behavior**

When azd encounters this known `Microsoft.CognitiveServices` parent-resource conflict, it should provide an actionable suggestion such as:

> Cognitive Services does not accept concurrent writes to deployment children of the same account. Serialize sibling model deployments with explicit Bicep `dependsOn` relationships and retry.

Any azd templates or generated infrastructure that create multiple model deployments under one account should also serialize those resources.

**Environment**

- OS: Linux
- azd: 1.29.0 stable
- Infrastructure: Bicep
- Resource type: `Microsoft.CognitiveServices/accounts/deployments@2026-05-01`
- Parent account kind: `AIServices`

**Additional context**

The tested mitigation is documented in Azure/azure-sdk-tools#16357:

https://github.com/Azure/azure-sdk-tools/blob/qiaozha/sdk-ai-bots-deployment/tools/sdk-ai-bots/deployment/infra/modules/qaBotAgent/component.bicep

A `parent` declaration creates an account-before-child dependency, but it does not serialize independent sibling child resources. Explicit sibling dependencies are still required for this provider.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `azd provision --no-prompt` using sibling `Microsoft.CognitiveServices/accounts/deployments` resources, then inspect azd's handling of the `Microsoft.CognitiveServices` `RequestConflict` response. Use the referenced `component.bicep` example as a serialization reference; done means the error provides actionable guidance and applicable generated infrastructure serializes sibling deployments.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cli, cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.