Troubleshooting: Create Foundry Resource
Resource Creation Failures
ResourceProviderNotRegistered
Solution:
- If you have Owner/Contributor role, register the provider:
az provider register --namespace Microsoft.CognitiveServices- If you lack permissions, ask a subscription Owner or Contributor to register it
- Alternatively, ask them to grant you the
/register/actionprivilege
InsufficientPermissions
Solution:
# Check your role assignments
az role assignment list --assignee <your-user-id> --subscription <subscription-id>
# You need: Contributor, Owner, or custom role with Microsoft.CognitiveServices/accounts/writeUse microsoft-foundry:rbac skill to manage permissions.
LocationNotAvailableForResourceType
Solution:
# List available regions for Cognitive Services
az provider show --namespace Microsoft.CognitiveServices \
--query "resourceTypes[?resourceType=='accounts'].locations" --out table
# Choose different region from the listResourceNameNotAvailable
Resource name must be globally unique. Try adding a unique suffix:
UNIQUE_SUFFIX=$(date +%s)
az cognitiveservices account create \
--name "foundry-${UNIQUE_SUFFIX}" \
--resource-group <rg> \
--kind AIServices \
--sku S0 \
--location <location> \
--yesResource Shows as Failed
Check provisioning state:
az cognitiveservices account show \
--name <resource-name> \
--resource-group <rg> \
--query "properties.provisioningState"If Failed, delete and recreate:
# Delete failed resource
az cognitiveservices account delete \
--name <resource-name> \
--resource-group <rg>
# Recreate
az cognitiveservices account create \
--name <resource-name> \
--resource-group <rg> \
--kind AIServices \
--sku S0 \
--location <location> \
--yesCannot Access Keys
Error: AuthorizationFailed when listing keys
Solution: You need Cognitive Services User or higher role on the resource.
Use microsoft-foundry:rbac skill to grant appropriate permissions.