Skip to content

Troubleshooting

ERROR: The policy definition '/providers/Microsoft.Authorization/policyDefinitions/...' could not be found.

Cause: A policy definition ID in policy-assignments-mg.bicep references a retired or invalid Azure built-in policy.

Fix: Look up the current policy definition ID in the Azure Policy built-in reference and update the GUID in the Bicep file.

ERROR: Conflict: Another update operation is in progress. Please retry in a few minutes

Cause: Microsoft.Security/pricings/StorageAccounts has a concurrent update from a previous deployment. This is transient.

Fix: Wait 2–3 minutes and retry azd up. The deployment is idempotent — already-created resources are skipped.

ERROR: The property 'timePeriod.startDate' is immutable after creation.

Cause: Azure Budgets do not allow changing the start date after creation. The pre-provision hook normally handles this by deleting the existing budget before redeployment.

Fix: Manually delete the budget, then redeploy:

Terminal window
az consumption budget delete --budget-name budget-smb-monthly
azd up
ERROR: CIDR overlap detected between hub (10.0.0.0/16) and spoke (10.0.2.0/23)

Cause: The pre-provision hook validates that hub, spoke, and on-premises CIDRs don’t overlap.

Fix: Choose non-overlapping CIDRs:

Terminal window
azd env set HUB_VNET_ADDRESS_SPACE "10.0.0.0/23"
azd env set SPOKE_VNET_ADDRESS_SPACE "10.0.2.0/23"
ERROR: Management group 'smb-rf' not found.

Cause: The management group hasn’t been created or the current user lacks permissions.

Fix: Follow the Management Group setup guide.

If you accidentally restore main.bicepparam, rename it back:

Terminal window
mv main.bicepparam main.bicepparam.reference

Cause: azd env values are stored per-environment in .azure/<env-name>/.env.

Fix: Verify which environment is active and check its values:

Terminal window
azd env list
azd env get-values

azd provision --preview does not trigger pre/post-provision hooks. This is by design. Hooks only run during azd up or azd provision.

VPN Gateway creation takes 25–45 minutes. This is normal Azure behavior. The deployment will show the spinner during this time.

If a Key Vault with the same name was previously deleted, it may be in soft-delete state:

Terminal window
az keyvault list-deleted --query "[?name=='kv-smbrf-swc-fcxhutc7']" -o table
az keyvault purge --name kv-smbrf-swc-fcxhutc7 --location swedencentral

The pre-provision hook automatically detects and cleans up faulted resources. If cleanup fails:

Terminal window
# Check resource state
az network firewall show -g rg-hub-smb-swc -n fw-hub-smb-swc --query provisioningState
# Force delete
az network firewall delete -g rg-hub-smb-swc -n fw-hub-smb-swc

Azure Firewall (Basic SKU) requires two public IPs and may fail if:

  • The subscription has insufficient public IP quota
  • A previous faulted Firewall left orphaned resources (PIP, policy)

Fix: Check quota and clean up orphaned resources:

Terminal window
# Check public IP quota
az network list-usages --location swedencentral --query "[?localName=='Public IP Addresses'].{limit:limit, current:currentValue}" -o table
# Delete orphaned firewall policy if present
az network firewall policy delete -g rg-hub-smb-swc -n fwpol-hub-smb-swc 2>/dev/null

Then retry azd up. The pre-provision hook handles most cleanup automatically.

Quick health check after deployment:

Terminal window
# Resource groups (expect 6)
az group list --query "[?starts_with(name,'rg-') && (contains(name,'smb') || contains(name,'spoke'))].{name:name,state:properties.provisioningState}" -o table
# Policies (expect 33)
az policy assignment list --scope "/providers/Microsoft.Management/managementGroups/smb-rf" --query "length(@)"
# Budget
az consumption budget list --query "[?name=='budget-smb-monthly'].{name:name,amount:amount}" -o table