You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -50,57 +50,14 @@ Capability hosts follow a hierarchy where more specific configurations override
50
50
2.**Account-level capability host** - Provides shared defaults for all projects under the account.
51
51
3.**Project-level capability host** - Overrides account-level and service defaults for that specific project.
52
52
53
-
## Avoiding HTTP 409 (Conflict) errors
54
-
55
-
### Understanding capability host constraints
53
+
## Understanding capability host constraints
56
54
57
55
When creating capability hosts, be aware of these important constraints to avoid conflicts:
58
56
59
-
> [!IMPORTANT]
60
-
> **One capability host per scope**: Each account and each project can only have one active capability host. Attempting to create a second capability host with a different name at the same scope will result in a 409 conflict.
61
-
62
-
### Best practices to prevent conflicts
63
-
64
-
#### 1. **Pre-request validation**
65
-
Always check for existing capability hosts before attempting to create new ones:
66
-
67
-
**For account-level capability hosts:**
68
-
```http
69
-
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts?api-version=2025-06-01
70
-
```
71
-
72
-
#### 2. **Monitor long-running operations**
73
-
Capability host operations are asynchronous. Always monitor operation status:
74
-
75
-
```http
76
-
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/operationResults/{operationId}?api-version=2025-06-01
77
-
```
78
-
79
-
#### 4. **Handle idempotent requests correctly**
80
-
The system supports idempotent create requests:
81
-
-**Same name + same configuration** = Returns existing resource (success)
82
-
-**Same name + different configuration** = Returns 400 Bad Request
83
-
-**Different name** = Returns 409 Conflict
57
+
-**One capability host per scope**: Each account and each project can only have one active capability host. Attempting to create a second capability host with a different name at the same scope will result in a 409 conflict.
84
58
85
-
### Configuration update limitations
59
+
-**Configuration updates are not supported**: If you need to change configuration, you must delete the existing capability host and recreate it.
86
60
87
-
> [!WARNING]
88
-
> Configuration updates are not supported. If you need to change configuration, you must delete the existing capability host and recreate it.
89
-
90
-
**Error example:**
91
-
```json
92
-
{
93
-
"error": {
94
-
"code": "InvalidData",
95
-
"message": "Update of capability is not currently supported. Please delete and recreate with the new configuration."
96
-
}
97
-
}
98
-
```
99
-
100
-
**Recommended approach for configuration changes:**
101
-
1. Delete the existing capability host
102
-
2. Wait for deletion to complete
103
-
3. Create a new capability host with the desired configuration
104
61
105
62
## Recommended setup
106
63
@@ -120,9 +77,7 @@ A capability host must be configured with the following three properties at eith
|`aiServicesConnections`| Use your own model deployments | Azure OpenAI | When you want to use models from your existing Azure OpenAI resource instead of the built-in account level ones. |
122
79
123
-
### Account capability host
124
-
Create an account-level capability host that provides shared defaults:
125
-
80
+
**Account capability host**
126
81
```http
127
82
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{name}?api-version=2025-06-01
128
83
@@ -150,18 +105,6 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
-**Check existing capability hosts first** before creating new ones
223
-
-**Use consistent naming** across all requests for the same scope
224
-
-**Query existing resources** to understand current state
166
+
**Root cause:** Each account and each project can only have one active capability host. You're trying to create a capability host with a different name when one already exists at the same scope.
167
+
168
+
**Solution:**
169
+
1.**Check existing capability hosts** - Query the scope to see what already exists
170
+
2.**Use consistent naming** - Ensure you're using the same name across all requests for the same scope
171
+
3.**Review your requirements** - Determine if the existing capability host meets your needs
172
+
173
+
**Validation steps:**
174
+
```http
175
+
# For account-level capability hosts
176
+
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts?api-version=2025-06-01
225
177
226
-
#### 2. **Concurrent operations**
178
+
# For project-level capability hosts
179
+
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts?api-version=2025-06-01
180
+
```
227
181
228
-
**What happens:** You try to create a capability host while another operation (update, delete, modify) is in progress at the same scope.
182
+
#### Problem: Concurrent operations in progress
229
183
230
-
**Error example:**
184
+
**Symptoms:** You receive a 409 Conflict error indicating that another operation is currently running.
-**Monitor operation status** before making new requests
242
-
-**Wait for operations to complete** before starting new ones
196
+
**Root cause:** You're trying to create a capability host while another operation (update, delete, modify) is in progress at the same scope.
197
+
198
+
**Solution:**
199
+
1.**Wait for current operation to complete** - Check the status of ongoing operations
200
+
2.**Monitor operation progress** - Use the operations API to track completion
201
+
3.**Implement retry logic** - Add exponential backoff for temporary conflicts
202
+
203
+
**Operation monitoring:**
204
+
```http
205
+
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/operationResults/{operationId}?api-version=2025-06-01
206
+
```
243
207
244
-
### Error handling patterns
208
+
### Best practices for conflict prevention
245
209
246
-
#### For Application Developers:
210
+
#### 1. Pre-request validation
211
+
Always verify the current state before making changes:
212
+
- Query existing capability hosts in the target scope
213
+
- Check for any ongoing operations
214
+
- Understand the current configuration
247
215
216
+
#### 2. Implement retry logic with exponential backoff
248
217
```csharp
249
218
try
250
219
{
@@ -255,7 +224,7 @@ catch (HttpRequestException ex) when (ex.Message.Contains("409"))
255
224
{
256
225
if (ex.Message.Contains("existing Capability Host with name"))
257
226
{
258
-
//Different name conflict - check if existing resource meets your needs
227
+
//Handle name conflict - check if existing resource is acceptable
0 commit comments