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
Copy file name to clipboardExpand all lines: TROUBLESHOOTING.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,99 @@ In one case, `%USERPROFILE%\.azure\bin` contained a `bicep.exe` file but with a
223
223
224
224
## Resource Management Issues
225
225
226
+
### Soft-Deleted Resources (APIM and Key Vault)
227
+
228
+
When you delete Azure API Management services or Key Vaults, they are soft-deleted and remain recoverable for a period of time (typically 48 days for APIM, 90 days for Key Vault). These soft-deleted resources continue to reserve their names and can cause deployment conflicts.
229
+
230
+
**Common Issues:**
231
+
- Deployment fails with "Name already exists" even though resource appears deleted
232
+
- Cannot reuse the same name for a new APIM service or Key Vault
233
+
- Key Vault creation fails during infrastructure deployment
234
+
- Subscription quotas are affected by soft-deleted resources
235
+
236
+
**Error During Infrastructure Deployment:**
237
+
```
238
+
Creating Key Vault: kv-sbfc4encghfag
239
+
❌ Failed to create Key Vault: kv-sbfc4encghfag
240
+
This may be caused by a soft-deleted Key Vault with the same name.
241
+
Check for soft-deleted resources: python shared/python/show_soft_deleted_resources.py
az apim deletedservice purge --service-name <name> --location <location>
267
+
az keyvault purge --name <name> --location <location>
268
+
```
269
+
270
+
**Best Practices:**
271
+
1. Check for soft-deleted resources before deploying with the same name
272
+
2. Use unique names for resources to avoid conflicts
273
+
3. Purge soft-deleted resources if you need to reuse the name immediately
274
+
4. Consider using timestamps or random suffixes in resource names during development
275
+
276
+
#### Understanding Key Vault Purge Protection
277
+
278
+
Key Vaults can have **purge protection** enabled, which prevents them from being manually purged before their scheduled purge date. This is a security feature that cannot be disabled once enabled.
279
+
280
+
**Error When Purging Protected Key Vaults:**
281
+
```
282
+
(MethodNotAllowed) Operation 'DeletedVaultPurge' is not allowed.
283
+
Code: MethodNotAllowed
284
+
Message: Operation 'DeletedVaultPurge' is not allowed.
285
+
```
286
+
287
+
**Identifying Purge Protection:**
288
+
The `show_soft_deleted_resources.py` script automatically detects and displays purge protection status:
0 commit comments