Troubleshooting
Real Azure for DevOps errors and symptoms: likely causes, diagnosis, fix and prevention
Identity and Authorization Errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q1 (AuthorizationFailed) The client '[email protected]' with object id '1111...' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/.../resourcegroups/rg-shop-dev' or the scope is invalid.
Beginner
(AuthorizationFailed) The client '[email protected]' with object id '1111...' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/.../resourcegroups/rg-shop-dev' or the scope is invalid.Likely causes โ No role with that action at that scope (or above); a newly granted role not propagated yet; wrong subscription selected so the scope is different from what you think.
Diagnose โ
az account show --query "{sub:id, user:user.name}"
az role assignment list --assignee <objectId> --all --include-inherited -o tableFix โ
- Confirm the subscription in the error matches your intended one;
az account setif not - Grant a role that includes the action at the right scope (Contributor on the subscription to create RGs, or pre-create the RG and grant Contributor on it)
- If just granted, wait a few minutes, then
az logout && az loginto refresh tokens
Prevent โ Pre-create RGs in the platform pipeline and scope app identities to them.
Q2 AADSTS70021: No matching federated identity record found for presented assertion. Assertion Issuer: 'https://token.actions.githubusercontent.com'. Assertion Subject: 'repo:devopsshack/shop:ref:refs/heads/feature/login'.
Beginner
AADSTS70021: No matching federated identity record found for presented assertion. Assertion Issuer: 'https://token.actions.githubusercontent.com'. Assertion Subject: 'repo:devopsshack/shop:ref:refs/heads/feature/login'.Likely causes โ The federated credential subject doesn't match: workflow ran on a different branch, uses an environment (subject becomes environment:<name>), was a PR, or org/repo name casing changed.
Diagnose โ
az identity federated-credential list --identity-name id-shop-ci -g rg-ci \
--query "[].{name:name, subject:subject, issuer:issuer}" -o tableCompare the subject in the error with the list exactly.
Fix โ
- Add a federated credential for the needed subject, or run the job from the expected branch/environment
- If the job declares
environment: prod, the subject must berepo:devopsshack/shop:environment:prod
Prevent โ Standardise on environment-based subjects and document them next to the workflow.
Q3 AADSTS7000222: The provided client secret keys for app '2222...' are expired. Pipelines failed overnight.
Beginner
AADSTS7000222: The provided client secret keys for app '2222...' are expired. Pipelines failed overnight.Likely causes โ The service principal's client secret reached its end date.
Diagnose โ
az ad app credential list --id <appId> --query "[].{keyId:keyId, end:endDateTime}" -o tableFix โ
- Short term:
az ad app credential reset --id <appId> --append --years 1, update the CI secret store, rerun - Real fix: switch the pipeline to workload identity federation and delete the secret
Prevent โ Federated credentials (nothing expires), or alerts on upcoming secret expiry via a scheduled Graph query.
Q4 AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '797f4846-ba00-4fd7-ba43-dac1f8f63013'. in a nightly script.
Intermediate
AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '797f4846-ba00-4fd7-ba43-dac1f8f63013'. in a nightly script.Likely causes โ The script uses a human account, and a Conditional Access policy now requires MFA for Azure management (797f4846... is the Windows Azure Service Management API).
Diagnose โ Check Entra sign-in logs for the account, which show the CA policy applied.
Fix โ
- Move the script to a managed identity (if it runs in Azure) or a service principal with federated credentials
- Grant that identity the needed roles; remove the human account from automation
Prevent โ Policy: no automation with user accounts. Conditional Access will keep tightening.
Q5 Code: Forbidden. Message: Caller is not authorized to perform action on resource. Action: 'Microsoft.KeyVault/vaults/secrets/getSecret/action' ... Inner error: {"code":"ForbiddenByRbac"}
Beginner
Code: Forbidden. Message: Caller is not authorized to perform action on resource. Action: 'Microsoft.KeyVault/vaults/secrets/getSecret/action' ... Inner error: {"code":"ForbiddenByRbac"}Likely causes โ The vault uses RBAC and the caller has no data-plane role; being Owner or Contributor of the vault doesn't grant secret read.
Diagnose โ
az keyvault show -n kv-shop --query properties.enableRbacAuthorization
az role assignment list --scope $(az keyvault show -n kv-shop --query id -o tsv) -o tableFix โ
- Grant
Key Vault Secrets User(read) orKey Vault Secrets Officer(manage) to the caller at vault scope - Wait for propagation and retry
Prevent โ Put Key Vault data roles in the same IaC that creates the identity.
Q6 The user, group or application 'appid=...;oid=...' does not have secrets get permission on key vault 'kv-legacy;location=centralindia'.
Beginner
The user, group or application 'appid=...;oid=...' does not have secrets get permission on key vault 'kv-legacy;location=centralindia'.Likely causes โ The vault uses the legacy access policy model and the identity has no access policy (or lacks get).
Diagnose โ
az keyvault show -n kv-legacy --query "properties.accessPolicies[].{oid:objectId, secrets:permissions.secrets}"Fix โ
- Short term:
az keyvault set-policy -n kv-legacy --object-id <oid> --secret-permissions get list - Plan migration to RBAC (assign equivalent roles, then switch
enableRbacAuthorization)
Prevent โ Create new vaults with RBAC only.
Q7 A user was added to an Entra group with access, but still gets AuthorizationFailed.
Beginner
AuthorizationFailed.Likely causes โ Group membership is in the token; the old token doesn't have it. Or propagation delay.
Diagnose โ
az ad group member check --group grp-shop-dev --member-id <userObjectId>Fix โ
az logout && az login(or sign out of the portal) to get a new token- Wait up to around 10 minutes for RBAC propagation
Prevent โ Tell users to re-login after group changes; build it into onboarding docs.
Q8 PrincipalNotFound: Principal 3333... does not exist in the directory <tenantId>. when Terraform creates a role assignment for a new identity.
Intermediate
PrincipalNotFound: Principal 3333... does not exist in the directory <tenantId>. when Terraform creates a role assignment for a new identity.Likely causes โ Entra replication lag: the identity was just created and ARM's lookup can't see it yet.
Diagnose โ Re-run after a minute; it usually succeeds, which confirms replication delay.
Fix โ
- In Terraform, set
skip_service_principal_aad_check = trueonazurerm_role_assignmentfor service principals and managed identities - In CLI, pass
--assignee-object-id <id> --assignee-principal-type ServicePrincipal
Prevent โ Always specify principal type for newly created identities.
Q9 RoleAssignmentExists: The role assignment already exists. breaks a Terraform apply.
Intermediate
RoleAssignmentExists: The role assignment already exists. breaks a Terraform apply.Likely causes โ The same principal/role/scope assignment was created outside Terraform (portal, --attach-acr, another module).
Diagnose โ
az role assignment list --assignee <principalId> --scope <scope> --query "[].id" -o tsvFix โ
- Import the existing assignment into state with an
importblock using its ID - Or remove the duplicate from code if another module owns it
Prevent โ One owner per role assignment; avoid mixing az aks update --attach-acr with Terraform role assignments for the same pair.
Q10 azure/login fails with Error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable.
Intermediate
azure/login fails with Error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable.Likely causes โ The workflow or job lacks id-token: write permission, or it runs from a fork PR where OIDC tokens are not issued.
Diagnose โ Check the workflow's permissions: block at workflow and job level.
Fix โ
permissions:
id-token: write
contents: readPrevent โ Use a reusable workflow template that already includes the permissions.
Q11 Error: AADSTS700016: Application with identifier '4444...' was not found in the directory 'Contoso'.
Intermediate
Error: AADSTS700016: Application with identifier '4444...' was not found in the directory 'Contoso'.Likely causes โ Wrong client ID or tenant ID in config, the app was deleted, or the app lives in another tenant and has no service principal here.
Diagnose โ
az ad sp show --id <clientId>
az ad app show --id <clientId>Fix โ
- Correct the client ID / tenant ID pair (common when copying between environments)
- Recreate the service principal:
az ad sp create --id <appId>for multi-tenant apps - Restore deleted apps from Entra's deleted items within 30 days
Prevent โ Store client/tenant IDs per environment, not hard-coded.
Q12 A managed identity on a VM gets ManagedIdentityCredential authentication unavailable. No identity has been assigned to this resource.
Intermediate
ManagedIdentityCredential authentication unavailable. No identity has been assigned to this resource.Likely causes โ No identity is enabled, or only a user-assigned identity exists and the code doesn't specify its client ID.
Diagnose โ
az vm identity show -g rg -n vm-appFix โ
- Enable a system-assigned identity, or
- For user-assigned, set
AZURE_CLIENT_ID=<clientId>or passManagedIdentityCredential(client_id=...)
Prevent โ Always configure the client ID explicitly when using user-assigned identities.
Q13 LinkedAuthorizationFailed: The client has permission to perform action 'Microsoft.Network/networkInterfaces/write' ... however, it does not have permission to perform action 'Microsoft.Network/virtualNetworks/subnets/join/action' on the linked scope(s).
Intermediate
LinkedAuthorizationFailed: The client has permission to perform action 'Microsoft.Network/networkInterfaces/write' ... however, it does not have permission to perform action 'Microsoft.Network/virtualNetworks/subnets/join/action' on the linked scope(s).Likely causes โ The identity can create resources in its RG but the subnet is in another RG (often the network team's) where it has no rights.
Diagnose โ Read the linked scope in the error; check assignments there.
Fix โ
- Grant a role with
subnets/join/actionon the subnet (Network Contributor, or a custom "Subnet Joiner" role) - Retry the deployment
Prevent โ Provide a custom least-privilege subnet join role for app teams in hub-spoke designs.
Q14 AKS kubectl get pods returns Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "shop": User does not have access to the resource in Azure. Update role assignment to allow access.
Beginner
kubectl get pods returns Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "shop": User does not have access to the resource in Azure. Update role assignment to allow access.Likely causes โ Azure RBAC for Kubernetes is enabled and the user has no AKS RBAC role at the cluster or namespace scope.
Diagnose โ
az role assignment list --assignee [email protected] --scope $(az aks show -g rg -n aks --query id -o tsv) --include-inherited -o tableFix โ
az role assignment create --assignee [email protected] --role "Azure Kubernetes Service RBAC Reader" \
--scope "$(az aks show -g rg -n aks --query id -o tsv)/namespaces/shop"Prevent โ Grant namespace roles to groups as part of namespace onboarding.
Q15 kubelogin is not installed which is required to connect to AAD enabled cluster.
Beginner
kubelogin is not installed which is required to connect to AAD enabled cluster.Likely causes โ The kubeconfig uses the kubelogin exec plugin and it isn't installed or not on PATH.
Diagnose โ which kubelogin; kubectl config view --minify shows exec: command: kubelogin.
Fix โ
az aks install-cli # installs kubectl and kubelogin (may need sudo)
kubelogin convert-kubeconfig -l azurecliPrevent โ Include kubelogin in CI images and developer setup scripts.
Q16 ERROR: (AuthorizationFailed) ... does not have authorization to perform action 'Microsoft.ContainerService/managedClusters/listClusterUserCredential/action' running az aks get-credentials.
Intermediate
ERROR: (AuthorizationFailed) ... does not have authorization to perform action 'Microsoft.ContainerService/managedClusters/listClusterUserCredential/action' running az aks get-credentials.Likely causes โ The identity has Kubernetes RBAC roles but not the Azure role to download kubeconfig.
Diagnose โ Check roles at cluster scope.
Fix โ
- Grant
Azure Kubernetes Service Cluster User Roleon the cluster - Admin credentials (
--admin) needAzure Kubernetes Service Cluster Admin Roleand local accounts enabled
Prevent โ Pair Cluster User Role with every Kubernetes RBAC role grant.
Q17 Azure DevOps fails with AADSTS700213: No matching federated identity record found for presented assertion subject 'sc://contoso/shop/arm-shop-prod'.
Intermediate
AADSTS700213: No matching federated identity record found for presented assertion subject 'sc://contoso/shop/arm-shop-prod'.Likely causes โ The service connection was renamed, or the project/org name differs from when the federated credential was created; the subject includes them.
Diagnose โ Compare the subject in the error with the federated credential on the app/identity.
Fix โ
- Update the federated credential subject to
sc://contoso/shop/arm-shop-prod - Or use the service connection's "convert/verify" flow to regenerate it
Prevent โ Don't rename service connections casually; document that the name is part of the trust.
Q18 RequestDisallowedByPolicy: Resource 'stshopdev' was disallowed by policy. Reasons: 'Storage accounts should disable public network access'.
Beginner
RequestDisallowedByPolicy: Resource 'stshopdev' was disallowed by policy. Reasons: 'Storage accounts should disable public network access'.Likely causes โ A deny policy is assigned at a scope above; the request doesn't meet it.
Diagnose โ
az policy assignment show --name <assignmentName> --scope <scope>
az policy definition show -n <definitionName> --query policyRuleFix โ
- Change the deployment to comply (
--public-network-access Disabledplus Private Endpoint) - If justified, request an expiring exemption from the policy owners
Prevent โ Run policy-aware checks in CI (PSRule for Azure, or a what-if against a test subscription with the same policies).
Q19 A Terraform pipeline fails with Error: building account: could not acquire access token to parse claims: clientCredentialsToken: received HTTP status 400 with response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided..."}.
Beginner
Error: building account: could not acquire access token to parse claims: clientCredentialsToken: received HTTP status 400 with response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided..."}.Likely causes โ The client secret value is wrong (secret ID pasted instead of value), rotated, or contains an escaped character mangled by CI.
Diagnose โ Check the CI variable; confirm the secret's key ID and expiry with az ad app credential list --id <appId>.
Fix โ
- Reset the secret and paste the value
- Better, switch to
ARM_USE_OIDC=trueand removeARM_CLIENT_SECRET
Prevent โ OIDC everywhere.
Q20 After moving a subscription to another tenant, apps fail with token errors and all role assignments are gone.
Advanced
Likely causes โ Tenant transfer deletes RBAC assignments, custom roles and managed identities' trust; Key Vaults keep the old tenant ID.
Diagnose โ az role assignment list --all returns almost nothing; Key Vault properties.tenantId shows the old tenant.
Fix โ
- Recreate role assignments from IaC or a pre-move export
- Disable and re-enable system-assigned identities; recreate user-assigned identities and reattach
- Update Key Vault tenant ID and access policies/roles
- Recreate AKS-related identity bindings (or the cluster)
Prevent โ Export assignments before transfer (az role assignment list --all > backup.json) and follow Microsoft's transfer checklist.
Quota, Deployment and IaC Errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q21 (QuotaExceeded) Operation could not be completed as it results in exceeding approved standardDSv5Family Cores quota. Location: centralindia, Current Limit: 10, Current Usage: 8, Additional Required: 4, (Minimum) New Limit Required: 12.
Beginner
(QuotaExceeded) Operation could not be completed as it results in exceeding approved standardDSv5Family Cores quota. Location: centralindia, Current Limit: 10, Current Usage: 8, Additional Required: 4, (Minimum) New Limit Required: 12.Likely causes โ Family vCPU quota is too low for the scale-out or new pool (including surge nodes during AKS upgrades).
Diagnose โ
az vm list-usage -l centralindia -o table | grep -Ei "DSv5|Total Regional"Fix โ
- Request an increase (portal Quotas, or
az quota update) for the family and total regional vCPUs - Short term: use another VM family with headroom or lower surge
Prevent โ Track quota usage in a dashboard and alert at 80%; pre-raise before launches.
Q22 SkuNotAvailable: The requested VM size Standard_D4s_v5 is currently not available in location 'centralindia' zones '3'.
Intermediate
SkuNotAvailable: The requested VM size Standard_D4s_v5 is currently not available in location 'centralindia' zones '3'.Likely causes โ Capacity restriction for that SKU/zone in your subscription, or SKU not offered in that zone.
Diagnose โ
az vm list-skus -l centralindia --size Standard_D4s_v5 --query "[].{name:name, zones:locationInfo[0].zones, restrictions:restrictions}" -o jsonFix โ
- Pick a different size (D4as_v5, D4s_v6) or drop the restricted zone
- Open a support request to lift subscription-level restrictions
Prevent โ Keep two or three acceptable SKUs per workload; check availability in IaC pipelines.
Q23 MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.ContainerService'.
Beginner
MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.ContainerService'.Likely causes โ The resource provider was never registered in this subscription.
Diagnose โ az provider show -n Microsoft.ContainerService --query registrationState
Fix โ
az provider register -n Microsoft.ContainerService --waitPrevent โ Register required providers in the subscription vending process.
Q24 StorageAccountAlreadyTaken: The storage account named sttfstate is already taken.
Beginner
StorageAccountAlreadyTaken: The storage account named sttfstate is already taken.Likely causes โ Storage account names are globally unique across all of Azure.
Diagnose โ az storage account check-name -n sttfstate
Fix โ Use a unique suffix: sttfstate${RANDOM} or a hash of subscription ID (uniqueString(subscription().id) in Bicep, random_string in Terraform).
Prevent โ Naming convention with a unique suffix for globally unique names (storage, Key Vault, ACR).
Q25 (VaultAlreadyExists) or A vault with the same name already exists in deleted state. You need to either recover or purge existing key vault.
Beginner
(VaultAlreadyExists) or A vault with the same name already exists in deleted state. You need to either recover or purge existing key vault.Likely causes โ You deleted the vault (often via terraform destroy) and soft delete keeps the name reserved.
Diagnose โ az keyvault list-deleted --query "[].{name:name, purge:properties.scheduledPurgeDate}" -o table
Fix โ
- Recover it:
az keyvault recover -n kv-shop-dev - Or purge (only if purge protection is off):
az keyvault purge -n kv-shop-dev - In Terraform labs,
features { key_vault { purge_soft_delete_on_destroy = true } }
Prevent โ Unique names per lab run, or the purge feature flag in non-prod.
Q26 ScopeLocked: The scope '/subscriptions/.../resourceGroups/rg-shop-prod' cannot perform delete operation because following scope(s) are locked: '/subscriptions/.../resourceGroups/rg-shop-prod'.
Beginner
ScopeLocked: The scope '/subscriptions/.../resourceGroups/rg-shop-prod' cannot perform delete operation because following scope(s) are locked: '/subscriptions/.../resourceGroups/rg-shop-prod'.Likely causes โ A CanNotDelete or ReadOnly lock on the RG or a parent.
Diagnose โ az lock list -g rg-shop-prod -o table and at subscription level.
Fix โ
- If the delete is intended, remove the lock (needs
Microsoft.Authorization/locks/delete, Owner or User Access Administrator):az lock delete -n no-delete -g rg-shop-prod - Re-add after the change if appropriate
Prevent โ Manage locks in IaC so their presence is intentional and visible.
Q27 DeploymentFailed: At least one resource deployment operation failed. Please list deployment operations for details. How do you find the real error?
Beginner
DeploymentFailed: At least one resource deployment operation failed. Please list deployment operations for details. How do you find the real error?Likely causes โ The top-level message is generic; the real error is in a nested operation.
Diagnose โ
az deployment operation group list -g rg -n main \
--query "[?properties.provisioningState=='Failed'].{res:properties.targetResource.resourceName, err:properties.statusMessage.error}" -o jsonFor nested modules, list operations of the nested deployment name too.
Fix โ Fix the specific error (quota, name conflict, policy, invalid property).
Prevent โ Pipelines should print failed operations automatically on failure.
Q28 InvalidTemplateDeployment: The template deployment 'main' is not valid according to the validation procedure. with a policy violation inside.
Intermediate
InvalidTemplateDeployment: The template deployment 'main' is not valid according to the validation procedure. with a policy violation inside.Likely causes โ Preflight validation found a policy deny or an invalid property before deploying anything.
Diagnose โ Run az deployment group validate -g rg -f main.bicep -p @prod.bicepparam and read the details array.
Fix โ Adjust the resource properties to comply or fix the invalid value.
Prevent โ Run validate in PR pipelines against an environment with the same policies.
Q29 Terraform: Error: A resource with the ID "/subscriptions/.../resourceGroups/rg-shop-dev" already exists - to be managed via Terraform this resource needs to be imported into the State.
Intermediate
Error: A resource with the ID "/subscriptions/.../resourceGroups/rg-shop-dev" already exists - to be managed via Terraform this resource needs to be imported into the State.Likely causes โ The resource exists in Azure (created manually or by a previous run whose state was lost).
Diagnose โ terraform state list | grep rg-shop-dev returns nothing.
Fix โ
import {
to = azurerm_resource_group.main
id = "/subscriptions/<sub>/resourceGroups/rg-shop-dev"
}Then terraform plan and apply.
Prevent โ Remote state with locking and versioning so state isn't lost.
Q30 Terraform: Error: Error acquiring the state lock ... state blob is already locked.
Beginner
Error: Error acquiring the state lock ... state blob is already locked.Likely causes โ Another run holds the blob lease, or a crashed run left the lease.
Diagnose โ The error shows the lock ID, who and when. Check running pipelines.
Fix โ
- Wait for the other run, or if it's dead:
terraform force-unlock <LOCK_ID> - Or break the lease:
az storage blob lease break --container-name tfstate --blob-name shop/prod.tfstate --account-name sttfstate --auth-mode login
Prevent โ Pipeline concurrency limits per environment.
Q31 Terraform azurerm v4: Error: subscription ID could not be determined and was not specified.
Beginner
Error: subscription ID could not be determined and was not specified.Likely causes โ azurerm v4 requires an explicit subscription ID; v3 inferred it from the CLI.
Diagnose โ Check the provider block and ARM_SUBSCRIPTION_ID.
Fix โ
provider "azurerm" {
features {}
subscription_id = var.subscription_id
}or export ARM_SUBSCRIPTION_ID=$(az account show --query id -o tsv).
Prevent โ Pin provider versions and read upgrade guides before bumping majors.
Q32 OperationNotAllowed: Operation is not allowed because there's an in progress update managed cluster operation on an AKS change.
Intermediate
OperationNotAllowed: Operation is not allowed because there's an in progress update managed cluster operation on an AKS change.Likely causes โ Another operation (upgrade, scale, add-on change, auto-upgrade) is in progress; AKS serialises operations.
Diagnose โ
az aks show -g rg -n aks --query provisioningState
az aks operation show-latest -g rg -n aksFix โ Wait for it to finish; if stuck for hours, check AKS diagnostics or open a support case. Avoid parallel pipelines touching the same cluster.
Prevent โ Serialise cluster changes; schedule auto-upgrades away from deploy windows.
Q33 InvalidResourceLocation: The resource 'vnet-shop' already exists in location 'southindia' in resource group 'rg-shop'. A resource with the same name cannot be created in location 'centralindia'.
Beginner
InvalidResourceLocation: The resource 'vnet-shop' already exists in location 'southindia' in resource group 'rg-shop'. A resource with the same name cannot be created in location 'centralindia'.Likely causes โ A resource with that name and type already exists in the RG in another region; names are unique per RG and type.
Diagnose โ az resource list -g rg-shop -n vnet-shop -o table
Fix โ Use region in names (vnet-shop-cin), or delete/move the old resource.
Prevent โ Naming convention including region abbreviation.
Q34 InUseSubnetCannotBeDeleted: Subnet snet-app is in use by /subscriptions/.../networkInterfaces/... and cannot be deleted. during destroy.
Intermediate
InUseSubnetCannotBeDeleted: Subnet snet-app is in use by /subscriptions/.../networkInterfaces/... and cannot be deleted. during destroy.Likely causes โ Something still has a NIC or IP config in the subnet: a VM, private endpoint, AKS LB frontend, App Service integration, or a leaked NIC.
Diagnose โ
az network vnet subnet show -g rg --vnet-name vnet-shop -n snet-app --query "ipConfigurations[].id" -o tsvFix โ Delete the referencing resources first (or disconnect App Service VNet integration), then the subnet.
Prevent โ Model dependencies correctly in IaC; delete the whole RG for labs.
Q35 AllocationFailed or ZonalAllocationFailed: Allocation failed. We do not have sufficient capacity for the requested VM size in this zone.
Intermediate
AllocationFailed or ZonalAllocationFailed: Allocation failed. We do not have sufficient capacity for the requested VM size in this zone.Likely causes โ Temporary regional/zonal capacity shortage for that size; not a quota issue.
Diagnose โ The error code says allocation, not quota. Check other sizes/zones.
Fix โ
- Retry later, or choose a different size or zone
- For VMSS/AKS, allow multiple sizes (Karpenter/NAP, or multiple node pools)
- Use on-demand capacity reservations for critical capacity
Prevent โ Capacity reservations for must-have capacity; flexible SKU lists.
Q36 Bicep build error BCP037: The property "enableRbacAuthorisation" is not allowed on objects of type "VaultProperties".
Beginner
BCP037: The property "enableRbacAuthorisation" is not allowed on objects of type "VaultProperties".Likely causes โ Typo or wrong property for the API version (here British spelling instead of enableRbacAuthorization).
Diagnose โ Hover in VS Code, or check the API reference for the resource type and API version.
Fix โ Correct the property name; update API versions if the property is newer.
Prevent โ Bicep VS Code extension and az bicep lint in CI.
Q37 Conflict: Cannot delete resource group 'rg-shop-dev' while it contains resources protected by Azure Backup or Recovery Services vault deletion fails.
Intermediate
Conflict: Cannot delete resource group 'rg-shop-dev' while it contains resources protected by Azure Backup or Recovery Services vault deletion fails.Likely causes โ Recovery Services vault has protected items or soft-deleted backup items.
Diagnose โ az backup item list --vault-name rsv-shop -g rg-shop-dev -o table
Fix โ
- Stop protection and delete backup data for each item
- Undelete and delete soft-deleted items, or wait for soft delete period
- Then delete the vault and the RG
Prevent โ Lab cleanup scripts that disable soft delete in non-prod vaults (if policy allows).
Q38 Terraform plan always shows a change on tags or a property even after apply.
Intermediate
tags or a property even after apply.Likely causes โ Azure Policy Modify adds tags after apply, or Azure normalises a value (casing, defaults) differently from config.
Diagnose โ Compare plan diff with Activity Log for policy-initiated writes.
Fix โ
- Add the policy-added tags to config, or
lifecycle { ignore_changes = [tags["created_by"]] } - Match the exact casing Azure returns
Prevent โ Coordinate tag policies with IaC defaults.
Q39 The resource operation completed with terminal provisioning state 'Failed' for a VM extension (VMExtensionProvisioningError).
Intermediate
The resource operation completed with terminal provisioning state 'Failed' for a VM extension (VMExtensionProvisioningError).Likely causes โ The Custom Script or other extension's script failed, couldn't download, or the VM agent is unhealthy.
Diagnose โ
az vm get-instance-view -g rg -n vm-app --query "instanceView.extensions[].statuses"
# On the VM:
sudo tail -n 100 /var/log/azure/custom-script/handler.log
sudo ls /var/lib/waagent/custom-script/download/0/Fix โ Fix the script (exit codes, network access to the script URL), then redeploy with a new timestamp setting.
Prevent โ Prefer cloud-init or baked images; test scripts locally.
Q40 DeploymentQuotaExceeded: Creating the deployment 'shop-โฆ' would exceed the quota of '800'.
Advanced
DeploymentQuotaExceeded: Creating the deployment 'shop-โฆ' would exceed the quota of '800'.Likely causes โ Resource group deployment history limit; usually auto-cleaned, but locks on the RG block automatic deletion of old deployment records.
Diagnose โ az deployment group list -g rg --query "length(@)"; check for CanNotDelete locks.
Fix โ
az deployment group list -g rg --query "[?properties.timestamp<'2026-09-01'].name" -o tsv \
| xargs -I{} az deployment group delete -g rg -n {}Prevent โ Reuse deployment names per component, or remove locks that block history cleanup.
Network Connectivity Errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q41 A VM with a public IP times out on SSH (ssh: connect to host 20.x.x.x port 22: Connection timed out).
Beginner
ssh: connect to host 20.x.x.x port 22: Connection timed out).Likely causes โ NSG doesn't allow 22 from your IP (Standard public IPs are closed by default), a second NSG on subnet or NIC, guest firewall, or sshd not running.
Diagnose โ
az network nic list-effective-nsg -g rg -n vm-app-nic
az network watcher test-ip-flow -g rg --vm vm-app --direction Inbound --protocol TCP \
--local 10.20.1.4:22 --remote <yourIP>:50000
az vm boot-diagnostics get-boot-log -g rg -n vm-app | tailFix โ Add an allow rule for your IP on port 22 (or use Bastion); check sudo ufw status via Run Command: az vm run-command invoke -g rg -n vm-app --command-id RunShellScript --scripts "systemctl status sshd".
Prevent โ No SSH from the internet; Bastion or JIT access.
Q42 nslookup kv-shop.vault.azure.net from inside the VNet returns a public IP even though a Private Endpoint exists.
Intermediate
nslookup kv-shop.vault.azure.net from inside the VNet returns a public IP even though a Private Endpoint exists.Likely causes โ The privatelink.vaultcore.azure.net Private DNS zone is missing, not linked to the VNet the client uses, missing the A record, or the VNet uses custom DNS that doesn't forward to Azure DNS.
Diagnose โ
az network private-dns zone list -o table
az network private-dns link vnet list -g rg-dns -z privatelink.vaultcore.azure.net -o table
az network private-dns record-set a list -g rg-dns -z privatelink.vaultcore.azure.net -o table
az network vnet show -g rg -n vnet-shop --query dhcpOptions.dnsServersFix โ Create the zone and DNS zone group on the endpoint, link the zone to the VNet (or the hub resolving VNet), or configure the custom DNS server to forward to 168.63.129.16 / the DNS Private Resolver.
Prevent โ Policy-driven DNS zone group creation and central zones.
Q43 Key Vault returns Client address is not authorized and caller is not a trusted service. (ForbiddenByFirewall).
Beginner
Client address is not authorized and caller is not a trusted service. (ForbiddenByFirewall).Likely causes โ Vault firewall is on (default action Deny or public access disabled), and the caller comes from a public IP not in the allow list or not through the Private Endpoint.
Diagnose โ The error includes the client IP; az keyvault show -n kv-shop --query properties.networkAcls
Fix โ
- Access via the Private Endpoint (fix DNS so the client uses it)
- Or add the caller's IP/VNet rule:
az keyvault network-rule add -n kv-shop --ip-address <ip>/32
Prevent โ Private access by design; avoid IP allow lists for CI (hosted runner IPs change).
Q44 Application Gateway returns 502 Bad Gateway and backend health shows Unhealthy.
Intermediate
502 Bad Gateway and backend health shows Unhealthy.Likely causes โ Probe path returns non-2xx/3xx, NSG on backend blocks App Gateway subnet, TLS mismatch (backend cert CN doesn't match host name), wrong port, or backend actually down.
Diagnose โ
az network application-gateway show-backend-health -g rg -n agw-shop \
--query "backendAddressPools[].backendHttpSettingsCollection[].servers[].{ip:address, health:health, log:healthProbeLog}" -o tableFix โ
- Point the custom probe at a real health endpoint with correct host header
- Allow traffic from the App Gateway subnet on the backend port
- For HTTPS backends, set the correct host name or trusted root certificate
Prevent โ Dedicated /healthz endpoints and probes in IaC.
Q45 App Gateway v2 deployment fails or goes unhealthy after a UDR 0.0.0.0/0 โ firewall was added to its subnet.
Advanced
0.0.0.0/0 โ firewall was added to its subnet.Likely causes โ App Gateway v2 (public frontend) requires direct internet for control-plane traffic; sending default route to an NVA breaks it.
Diagnose โ Check route table on snet-agw; App Gateway operational state and health.
Fix โ
- Remove the
0.0.0.0/0route from the App Gateway subnet (keep specific routes to spokes if needed) - Or use the private-only App Gateway deployment, which supports forced tunnelling
Prevent โ Exclude snet-agw from the "force-tunnel all subnets" policy.
Q46 Two VNets peered but VMs can't communicate; peering state shows Initiated.
Intermediate
Initiated.Likely causes โ Peering created on one side only.
Diagnose โ az network vnet peering list -g rg --vnet-name vnet-a -o table shows PeeringState: Initiated.
Fix โ
az network vnet peering create -g rg-b -n b-to-a --vnet-name vnet-b \
--remote-vnet <vnetAId> --allow-vnet-accessState should become Connected on both sides.
Prevent โ Create both sides in the same IaC module.
Q47 Peering creation fails because address spaces overlap.
Beginner
Likely causes โ Both VNets use overlapping CIDRs (often both 10.0.0.0/16 defaults).
Diagnose โ Compare addressSpace of both VNets.
Fix โ
- Re-IP one VNet (add a new address space, migrate resources, remove old)
- Or use Private Link Service / NAT-based connectivity if re-IP is impossible
Prevent โ IPAM from day one; never use portal default ranges.
Q48 VMs in a spoke lost internet access right after the network team added a route table.
Beginner
Likely causes โ UDR 0.0.0.0/0 โ firewall, but the firewall has no rule allowing the traffic (or the next-hop IP is wrong).
Diagnose โ
az network watcher show-next-hop -g rg --vm vm-app --source-ip 10.21.2.4 --dest-ip 1.1.1.1Check firewall logs (AZFWApplicationRule, AZFWNetworkRule) for denies.
Fix โ Add firewall rules for required destinations, or correct the next-hop IP.
Prevent โ Change routing and firewall rules together in one change with tests.
Q49 Azure Firewall logs show allowed DNAT but clients still time out to the service behind it.
Advanced
Likely causes โ Asymmetric routing: return traffic from the backend goes directly to the internet (or via a different path) instead of back through the firewall.
Diagnose โ Effective routes on the backend subnet: is there a route for the client's return path to the firewall?
Fix โ
- Ensure the backend subnet's default route points to the firewall (so return traffic goes back through it)
- If the backend uses a public LB, don't mix with DNAT on the firewall
Prevent โ Draw the full in/out path when designing NVAs.
Q50 Front Door returns Our services aren't available right now (error 503 / origin errors).
Intermediate
Our services aren't available right now (error 503 / origin errors).Likely causes โ Origin health probes failing, origin rejecting the Host header, TLS certificate name mismatch on the origin, origin lock-down blocking Front Door IPs.
Diagnose โ Front Door health probe metrics and access logs (FrontDoorAccessLog / AzureDiagnostics with errorInfo_s); curl the origin with -H "Host: ...".
Fix โ
- Correct origin host header and probe path
- Allow
AzureFrontDoor.Backendservice tag on the origin NSG - Use a valid certificate matching the origin host name
Prevent โ Synthetic availability tests against both Front Door and origin.
Q51 Outbound calls from AKS intermittently fail with timeouts under load. Metrics show SNAT port usage at 100%.
Advanced
Likely causes โ SNAT port exhaustion on the Standard LB outbound rule (default allocation per node is limited), especially with high connection churn to few destinations.
Diagnose โ Load balancer metrics "SNAT Connection Count" with failed state, "Used SNAT Ports"; AKS diagnostics SNAT detector.
Fix โ
- Switch to NAT Gateway outbound (
az aks update --outbound-type managedNATGatewaywhere supported) - Or increase outbound IPs/ports:
az aks update --load-balancer-managed-outbound-ip-count 4 --load-balancer-outbound-ports 4000 - Fix connection reuse in apps
Prevent โ NAT Gateway by default for egress-heavy clusters.
Q52 App Service can't reach a database through its Private Endpoint even though VNet integration is configured.
Intermediate
Likely causes โ App Service isn't using the private DNS zone (needs zone linked to the integration VNet or custom DNS), route all disabled, or NSG on PE subnet/DB firewall blocks it.
Diagnose โ From Kudu console: nameresolver sql-shop.database.windows.net and tcpping sql-shop.database.windows.net:1433.
Fix โ
- Link
privatelink.database.windows.netto the integration VNet (or setWEBSITE_DNS_SERVERto your resolver) - Enable outbound internet traffic through the VNet (route all)
- Allow the integration subnet in NSGs
Prevent โ Standard App Service network template that includes DNS linking.
Q53 Pods resolve external names slowly and some lookups fail with i/o timeout.
Advanced
i/o timeout.Likely causes โ CoreDNS overloaded or throttled, conntrack race on UDP DNS, custom VNet DNS servers slow/unreachable, or ndots:5 causing many search-domain lookups.
Diagnose โ
kubectl -n kube-system top pods -l k8s-app=kube-dns
kubectl -n kube-system logs -l k8s-app=kube-dns --tail 50
kubectl run dnstest --rm -it --image=busybox:1.36 -- nslookup api.github.comFix โ
- Scale CoreDNS (autoscaler config in
coredns-autoscalerconfigmap) or enable NodeLocal DNSCache-style caching where supported - Set
dnsConfig.options: ndots: "2"for apps calling many external names - Fix custom DNS server reachability or forwarders
Prevent โ Monitor CoreDNS latency and errors in Prometheus.
Q54 VPN site-to-site tunnel is Connected, but no traffic flows from on-prem to Azure.
Intermediate
Connected, but no traffic flows from on-prem to Azure.Likely causes โ Local network gateway address prefixes missing on-prem ranges, on-prem routing not pointing Azure ranges to the tunnel, NSGs blocking, or traffic selectors mismatch with policy-based devices.
Diagnose โ
az network vnet-gateway list-learned-routes -g rg-hub -n vgw-hub -o table
az network local-gateway show -g rg-hub -n lgw-office --query localNetworkAddressSpaceFix โ Correct prefixes or BGP config; enable usePolicyBasedTrafficSelectors for policy-based devices; allow on-prem ranges in NSGs.
Prevent โ Use BGP to avoid static prefix drift.
Q55 Private Endpoint connection shows Pending and clients can't connect.
Beginner
Pending and clients can't connect.Likely causes โ The target resource is in another subscription/tenant or you lack approval rights; manual approval required.
Diagnose โ az network private-endpoint-connection list --id <resourceId> -o table
Fix โ
az network private-endpoint-connection approve --id <connectionId> --description "Approved for shop"Prevent โ Grant privateEndpointConnectionsApproval/action to the requester's identity for auto-approval within your org.
Q56 Storage account calls from a VM fail with AuthorizationFailure: This request is not authorized to perform this operation.
Intermediate
AuthorizationFailure: This request is not authorized to perform this operation.Likely causes โ Storage firewall: default action Deny, VM's subnet not allowed (no service endpoint or PE), or public access disabled and client not using the private endpoint.
Diagnose โ az storage account show -n stshop --query networkRuleSet; check DNS resolution of stshop.blob.core.windows.net from the VM.
Fix โ Add a VNet rule (with Microsoft.Storage service endpoint on the subnet) or use Private Endpoint and fix DNS.
Prevent โ Distinguish network errors (AuthorizationFailure) from RBAC errors (AuthorizationPermissionMismatch) in runbooks.
Q57 Internal Load Balancer works from other VNets but not from VMs in its own backend pool.
Advanced
Likely causes โ Hairpinning is not supported: a backend VM calling the ILB frontend can be load-balanced to itself and the flow fails.
Diagnose โ Calls from non-backend VMs succeed; from backend VMs fail intermittently.
Fix โ Call the service locally or via another tier, or put a proxy in front; for AKS, call the ClusterIP Service instead of the ILB.
Prevent โ Know the ILB hairpin limitation when designing.
Q58 A VM can't reach 169.254.169.254 (IMDS) and managed identity calls fail.
Intermediate
169.254.169.254 (IMDS) and managed identity calls fail.Likely causes โ A proxy setting intercepts it (missing NO_PROXY=169.254.169.254), guest firewall, or a custom route in the guest OS.
Diagnose โ
curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | head -c 200
env | grep -i proxyFix โ Add IMDS to NO_PROXY, fix guest firewall/routes.
Prevent โ Include IMDS exclusions in proxy configuration standards.
Q59 Connection refused when an App Service app calls an API on a VM in a peered VNet over port 8080.
Beginner
Connection refused when an App Service app calls an API on a VM in a peered VNet over port 8080.Likely causes โ Refused (not timeout) means the packet reached the host and nothing listens: wrong port, app bound to 127.0.0.1, service down.
Diagnose โ On the VM: ss -tlnp | grep 8080.
Fix โ Bind the app to 0.0.0.0:8080, start the service, correct the port.
Prevent โ Readiness checks and documented ports.
Q60 A Container Apps app with internal ingress can't be reached from a peered VNet.
Intermediate
Likely causes โ No private DNS for the environment's default domain, so <app>.<env-domain> doesn't resolve to the environment's static IP from other VNets.
Diagnose โ az containerapp env show -n cae-shop -g rg --query "{domain:properties.defaultDomain, ip:properties.staticIp}"; nslookup from the peered VNet.
Fix โ Create a Private DNS zone for the default domain with a wildcard * A record to the static IP, linked to the peered VNets.
Prevent โ Include this zone in the Container Apps landing template.
AKS and ACR Errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q61 Pods show ImagePullBackOff with failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://acrshop.azurecr.io/oauth2/token?...: 401 Unauthorized.
Beginner
ImagePullBackOff with failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://acrshop.azurecr.io/oauth2/token?...: 401 Unauthorized.Likely causes โ The kubelet identity has no AcrPull on the registry (ACR not attached, attached to a different cluster, or role assigned to the cluster identity instead of the kubelet identity).
Diagnose โ
az aks check-acr -g rg -n aks --acr acrshop.azurecr.io
KUBELET=$(az aks show -g rg -n aks --query identityProfile.kubeletidentity.objectId -o tsv)
az role assignment list --assignee $KUBELET --all -o tableFix โ
az aks update -g rg -n aks --attach-acr acrshopPrevent โ Manage the AcrPull role assignment for the kubelet identity in IaC.
Q62 Failed to pull image "acrshop.azurecr.io/shop/web:v3": ... manifest unknown or not found.
Beginner
Failed to pull image "acrshop.azurecr.io/shop/web:v3": ... manifest unknown or not found.Likely causes โ Tag doesn't exist (typo, push failed, retention policy purged it), wrong repository path.
Diagnose โ
az acr repository show-tags -n acrshop --repository shop/web -o table
az acr manifest list-metadata -r acrshop -n shop/web -o tableFix โ Push the image or correct the tag in the manifest.
Prevent โ Deploy by digest from the pipeline output; purge policies that keep deployed tags.
Q63 ImagePullBackOff with dial tcp: lookup acrshop.azurecr.io on 168.63.129.16:53: no such host or connection timeouts to the registry.
Advanced
ImagePullBackOff with dial tcp: lookup acrshop.azurecr.io on 168.63.129.16:53: no such host or connection timeouts to the registry.Likely causes โ ACR has public access disabled and the cluster can't resolve the private endpoint (privatelink.azurecr.io zone not linked), or firewall egress blocks *.azurecr.io and the data endpoint <registry>.<region>.data.azurecr.io.
Diagnose โ
az aks check-acr -g rg -n aks --acr acrshop.azurecr.io
kubectl run t --rm -it --image=busybox:1.36 -- nslookup acrshop.azurecr.ioFix โ Link the privatelink.azurecr.io zone to the AKS VNet, ensure the PE has DNS records for both login and data endpoints, or allow ACR FQDNs on the firewall.
Prevent โ Include ACR in the private DNS and firewall baseline for AKS spokes.
Q64 exec /usr/local/bin/python: exec format error in pod logs right after deploying a new image.
Beginner
exec /usr/local/bin/python: exec format error in pod logs right after deploying a new image.Likely causes โ Image built for arm64 (on an Apple Silicon Mac) running on amd64 nodes, or the reverse.
Diagnose โ docker buildx imagetools inspect acrshop.azurecr.io/shop/web:v3 shows the platforms.
Fix โ Build for the node architecture: docker buildx build --platform linux/amd64 -t ... --push . or use az acr build (amd64 by default, --platform linux/arm64 for Arm pools).
Prevent โ Build images in CI, not on laptops.
Q65 Pods are Pending: 0/3 nodes are available: 3 Insufficient cpu. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod.
Beginner
Pending: 0/3 nodes are available: 3 Insufficient cpu. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod.Likely causes โ Requests exceed free allocatable capacity, and the autoscaler is off, at max, or can't scale (quota).
Diagnose โ
kubectl describe pod <pod> | sed -n '/Events/,$p'
kubectl describe nodes | grep -A5 "Allocated resources"
az aks nodepool show -g rg --cluster-name aks -n apps --query "{auto:enableAutoScaling, min:minCount, max:maxCount, count:count}"Fix โ Enable/raise autoscaler max, right-size requests, add a pool; check quota if scale-out fails.
Prevent โ Realistic requests and autoscaler headroom alerts.
Q66 Cluster autoscaler events show pod didn't trigger scale-up: 1 max node group size reached or NotTriggerScaleUp.
Intermediate
pod didn't trigger scale-up: 1 max node group size reached or NotTriggerScaleUp.Likely causes โ Pool at max count, the pod's constraints (node selector, taints, zone with an LRS disk) don't match any pool, or the requested size doesn't fit any node size.
Diagnose โ
kubectl get events -A --field-selector reason=NotTriggerScaleUp
kubectl -n kube-system get configmap cluster-autoscaler-status -o yamlFix โ Raise max count, add a pool matching the pod's constraints, or adjust requests/affinity.
Prevent โ Alert when pools hit max; review constraints in manifests.
Q67 AKS upgrade fails: (UpgradeFailed) Drain node aks-apps-12345-vmss000002 failed when evicting pod web-7d9... failed with Too Many Requests error. This is often caused by a restrictive Pod Disruption Budget (PDB) policy.
Intermediate
(UpgradeFailed) Drain node aks-apps-12345-vmss000002 failed when evicting pod web-7d9... failed with Too Many Requests error. This is often caused by a restrictive Pod Disruption Budget (PDB) policy.Likely causes โ A PDB with maxUnavailable: 0 or minAvailable equal to replicas, or a single-replica deployment with a PDB.
Diagnose โ
kubectl get pdb -A
kubectl get pdb web -n shop -o yamlFix โ
- Scale the deployment up or relax the PDB to allow 1 disruption
- Re-run:
az aks nodepool upgrade ...(it resumes) - Or use undrainable node behaviour (
--undrainable-node-behavior Cordon) to quarantine blocked nodes and continue
Prevent โ Policy that PDBs must allow at least one disruption; at least 2 replicas for PDB-protected apps.
Q68 (InsufficientSubnetSize) Pre-allocated IPs 682 exceeds IPs available 251 in Subnet Cidr 10.20.1.0/24 when scaling or upgrading AKS.
Intermediate
(InsufficientSubnetSize) Pre-allocated IPs 682 exceeds IPs available 251 in Subnet Cidr 10.20.1.0/24 when scaling or upgrading AKS.Likely causes โ Flat Azure CNI reserves maxPods + 1 IPs per node including surge nodes, and the subnet is too small.
Diagnose โ az aks nodepool show ... --query "{count:count, maxPods:maxPods, surge:upgradeSettings.maxSurge}"; compute (count + surge) ร (maxPods + 1).
Fix โ
- Lower max surge temporarily or use
--max-unavailable - Add a new pool on a new bigger subnet and migrate
- Long term: migrate to Azure CNI Overlay
Prevent โ IP math during design; Overlay by default.
Q69 Service of type LoadBalancer stuck with EXTERNAL-IP <pending>; events show Error syncing load balancer: failed to ensure load balancer: ... AuthorizationFailed ... 'Microsoft.Network/virtualNetworks/subnets/read'.
Intermediate
EXTERNAL-IP <pending>; events show Error syncing load balancer: failed to ensure load balancer: ... AuthorizationFailed ... 'Microsoft.Network/virtualNetworks/subnets/read'.Likely causes โ The cluster's control-plane identity lacks rights on a custom VNet subnet (in another RG), or on the RG of a pre-created public IP.
Diagnose โ
kubectl describe svc web -n shop | sed -n '/Events/,$p'
az aks show -g rg -n aks --query identity.principalId -o tsvFix โ Grant Network Contributor on the subnet (or VNet) to the cluster identity; for static IPs in another RG, grant it on that RG and use the azure-load-balancer-resource-group annotation.
Prevent โ Include cluster identity network roles in the cluster IaC.
Q70 Pods with workload identity fail: WorkloadIdentityCredential authentication failed ... AADSTS70021: No matching federated identity record found for presented assertion. Assertion Subject: 'system:serviceaccount:shop:default'.
Intermediate
WorkloadIdentityCredential authentication failed ... AADSTS70021: No matching federated identity record found for presented assertion. Assertion Subject: 'system:serviceaccount:shop:default'.Likely causes โ The pod uses the default ServiceAccount instead of the federated one, or the namespace/SA name differs from the credential subject.
Diagnose โ
kubectl get pod <pod> -n shop -o jsonpath='{.spec.serviceAccountName}'
az identity federated-credential list --identity-name id-orders -g rg --query "[].subject"Fix โ Set serviceAccountName: orders-sa in the pod spec, or create a federated credential for the actual subject.
Prevent โ Helm chart values that tie SA name and federation subject together.
Q71 Workload identity env vars (AZURE_CLIENT_ID, AZURE_FEDERATED_TOKEN_FILE) are missing in the pod.
Intermediate
AZURE_CLIENT_ID, AZURE_FEDERATED_TOKEN_FILE) are missing in the pod.Likely causes โ Pod lacks label azure.workload.identity/use: "true" (it's a pod label, not a SA annotation, on current versions), workload identity not enabled on the cluster, or the webhook isn't running.
Diagnose โ
az aks show -g rg -n aks --query "{oidc:oidcIssuerProfile.enabled, wi:securityProfile.workloadIdentity.enabled}"
kubectl get pod <pod> -n shop --show-labels
kubectl -n kube-system get pods | grep azure-wi-webhookFix โ Add the label to the pod template, enable the feature (az aks update --enable-oidc-issuer --enable-workload-identity), restart pods.
Prevent โ Template the label into base Helm charts.
Q72 Pod stuck in ContainerCreating with MountVolume.SetUp failed for volume "secrets-store-inline" : rpc error: code = Unknown desc = failed to mount secrets store objects for pod shop/web-..., err: ... failed to get objectType:secret, objectName:db-password ... StatusCode=403.
Advanced
ContainerCreating with MountVolume.SetUp failed for volume "secrets-store-inline" : rpc error: code = Unknown desc = failed to mount secrets store objects for pod shop/web-..., err: ... failed to get objectType:secret, objectName:db-password ... StatusCode=403.Likely causes โ The identity in the SecretProviderClass lacks Key Vault Secrets User, the vault firewall blocks the cluster, or the wrong clientID/tenantId.
Diagnose โ
kubectl describe pod <pod> -n shop | sed -n '/Events/,$p'
kubectl -n kube-system logs -l app=secrets-store-provider-azure --tail 50
kubectl get secretproviderclass kv-shop -n shop -o yamlFix โ Assign the role on the vault to the identity in clientID, allow network access (PE + DNS), correct IDs.
Prevent โ Deploy identity, role and SecretProviderClass from the same IaC/Helm release.
Q73 SecretProviderClass mount fails with keyvault.BaseClient#GetSecret: Failure responding to request: StatusCode=404 ... SecretNotFound.
Beginner
keyvault.BaseClient#GetSecret: Failure responding to request: StatusCode=404 ... SecretNotFound.Likely causes โ Secret name typo, wrong vault, or the secret was deleted (soft-deleted).
Diagnose โ az keyvault secret list --vault-name kv-shop -o table; az keyvault secret list-deleted --vault-name kv-shop
Fix โ Correct objectName/keyvaultName, or recover the secret: az keyvault secret recover --vault-name kv-shop -n db-password.
Prevent โ Pipeline check that every object referenced by SecretProviderClasses exists.
Q74 Rotated a Key Vault secret, but the app still uses the old value.
Intermediate
Likely causes โ CSI rotation not enabled, or the app reads the value from an env var (synced Kubernetes Secret) only at startup.
Diagnose โ az aks show -g rg -n aks --query addonProfiles.azureKeyvaultSecretsProvider.config; compare the mounted file contents with Key Vault.
Fix โ
az aks addon update -g rg -n aks -a azure-keyvault-secrets-provider --enable-secret-rotation --rotation-poll-interval 2m- Read from the mounted file on each use, or trigger a rollout restart (Reloader or a pipeline step)
Prevent โ Design apps to reload secrets from files.
Q75 az aks get-credentials works but kubectl hangs then fails with Unable to connect to the server: dial tcp 10.x.x.x:443: i/o timeout.
Intermediate
az aks get-credentials works but kubectl hangs then fails with Unable to connect to the server: dial tcp 10.x.x.x:443: i/o timeout.Likely causes โ Private cluster; your machine has no network path to the private API endpoint (or DNS resolves to the private IP from outside).
Diagnose โ az aks show -g rg -n aks --query apiServerAccessProfile
Fix โ Connect from a VNet-connected machine (VPN, Bastion jump box, private agent) or use az aks command invoke -g rg -n aks --command "kubectl get nodes".
Prevent โ Document access paths for private clusters; private CI agents.
Q76 kubectl returns Unable to connect to the server: dial tcp 20.x.x.x:443: i/o timeout on a public cluster from a new office network.
Beginner
kubectl returns Unable to connect to the server: dial tcp 20.x.x.x:443: i/o timeout on a public cluster from a new office network.Likely causes โ API server authorized IP ranges don't include the new egress IP.
Diagnose โ az aks show -g rg -n aks --query apiServerAccessProfile.authorizedIpRanges; curl ifconfig.me.
Fix โ az aks update -g rg -n aks --api-server-authorized-ip-ranges <existing>,<newIP>/32
Prevent โ Use stable egress IPs (VPN or NAT) for admin access.
Q77 Nodes show NotReady after someone modified the node resource group (MC_...).
Advanced
NotReady after someone modified the node resource group (MC_...).Likely causes โ Manual changes in the node RG: deleted NSG rules or route table entries, changed VMSS settings, locks, or policy denying AKS operations there.
Diagnose โ Activity Log on MC_ RG for recent changes; kubectl describe node; AKS Diagnose and Solve.
Fix โ
- Revert the changes
- Reconcile the cluster:
az aks update -g rg -n aks(a no-op update triggers reconciliation) - Reimage problematic nodes:
az aks nodepool upgrade --node-image-onlyor delete the VMSS instance to get a fresh node
Prevent โ Node resource group lockdown (--nrg-lockdown-restriction-level ReadOnly).
Q78 A node pool upgrade fails with QuotaExceeded for surge nodes even though the cluster itself fits.
Beginner
QuotaExceeded for surge nodes even though the cluster itself fits.Likely causes โ Surge nodes need extra vCPU quota temporarily.
Diagnose โ Error shows required additional cores; az vm list-usage.
Fix โ Lower --max-surge (for example 1) or use --max-unavailable 1, or raise quota.
Prevent โ Account for surge in quota planning.
Q79 Pods are OOMKilled repeatedly (Last State: Terminated, Reason: OOMKilled, Exit Code: 137).
Beginner
OOMKilled repeatedly (Last State: Terminated, Reason: OOMKilled, Exit Code: 137).Likely causes โ Memory limit too low, memory leak, or JVM/.NET heap not container-aware.
Diagnose โ
kubectl describe pod <pod> -n shop | grep -A3 "Last State"
kubectl top pod -n shopContainer Insights memory working set charts over time.
Fix โ Raise limits to observed peak plus headroom, set runtime heap flags (-XX:MaxRAMPercentage=75), fix leaks.
Prevent โ Alerts on OOMKilled events; VPA recommendations.
Q80 After enabling Entra integration and disabling local accounts, the CI pipeline fails with error: You must be logged in to the server (Unauthorized).
Intermediate
error: You must be logged in to the server (Unauthorized).Likely causes โ CI was using az aks get-credentials --admin (local admin cert), which no longer works, or kubeconfig still uses interactive kubelogin.
Diagnose โ Check the pipeline's credential step and kubeconfig exec args.
Fix โ
az aks get-credentials -g rg -n aks --overwrite-existing
kubelogin convert-kubeconfig -l azurecliGrant the CI identity an AKS RBAC role.
Prevent โ Use Entra-based CI auth before disabling local accounts.
Q81 Pods can't reach each other across namespaces after enabling network policy.
Beginner
Likely causes โ A default-deny policy without explicit allow rules for the needed cross-namespace flows (and DNS egress).
Diagnose โ kubectl get networkpolicy -A; test with kubectl exec ... -- wget -qO- http://api.backend.svc.cluster.local; Hubble flows if ACNS is on.
Fix โ Add policies allowing ingress from the caller namespace (namespaceSelector with kubernetes.io/metadata.name) and egress to kube-dns on 53.
Prevent โ Template baseline policies (allow DNS, allow ingress controller) with default-deny.
Q82 az acr build fails with denied: client with IP '20.x.x.x' is not allowed access.
Intermediate
az acr build fails with denied: client with IP '20.x.x.x' is not allowed access.Likely causes โ ACR firewall/public access restrictions; ACR Tasks agents run outside your network.
Diagnose โ az acr show -n acrshop --query "{public:publicNetworkAccess, rules:networkRuleSet, bypass:networkRuleBypassOptions}"
Fix โ
- Allow trusted services (
--allow-trusted-services true) and run tasks with a system identity, or use a dedicated agent pool in your VNet (az acr agentpool create --subnet-id ..., Premium) - Or build on private agents with
docker buildand push via the private endpoint
Prevent โ Decide build location when locking down registries.
Q83 docker push fails with unauthorized: authentication required after az acr login succeeded an hour ago.
Beginner
docker push fails with unauthorized: authentication required after az acr login succeeded an hour ago.Likely causes โ The ACR refresh token from az acr login expired (about 3 hours), or the identity has only AcrPull.
Diagnose โ Re-run az acr login -n acrshop; check roles: az role assignment list --assignee <id> --scope <acrId>.
Fix โ Log in again right before pushing; grant AcrPush for push.
Prevent โ Log in within the same job step sequence as the push.
Q84 Node pool stuck in Failed provisioning state after a scale operation.
Advanced
Failed provisioning state after a scale operation.Likely causes โ A previous operation failed (quota, allocation, policy blocking VMSS changes, extension failure) and left the pool in Failed.
Diagnose โ az aks nodepool show ... --query provisioningState; Activity Log error; AKS diagnostics.
Fix โ
- Fix the cause (quota, policy exemption for the node RG)
- Re-run a no-op update to reconcile:
az aks nodepool update -g rg --cluster-name aks -n apps - If still failed, scale to the previous count or reimage
Prevent โ Avoid policies that target node RG resources; monitor operation failures.
Q85 Container Insights shows no data for a new cluster.
Advanced
Likely causes โ Monitoring add-on not enabled or DCR/DCR association missing (common with Terraform when msi_auth_for_monitoring_enabled = true but no DCR), ama-logs pods failing, or network blocked to Azure Monitor endpoints.
Diagnose โ
kubectl -n kube-system get pods | grep ama-logs
kubectl -n kube-system logs -l rsName=ama-logs-rs --tail 50
az monitor data-collection rule association list --resource <aksId> -o tableFix โ Create the DCR with Microsoft-ContainerInsights-Group-Default stream and associate it with the cluster; allow egress to *.ods.opinsights.azure.com, *.ingest.monitor.azure.com or use AMPLS.
Prevent โ Include DCR + association in the AKS module.
Storage, Key Vault, Monitoring and Pipeline Errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q86 AuthorizationPermissionMismatch: This request is not authorized to perform this operation using this permission. reading blobs with --auth-mode login.
Beginner
AuthorizationPermissionMismatch: This request is not authorized to perform this operation using this permission. reading blobs with --auth-mode login.Likely causes โ The identity has control-plane roles (Owner/Contributor) but no Storage Blob Data role.
Diagnose โ az role assignment list --assignee <id> --scope <storageId> --include-inherited -o table
Fix โ Grant Storage Blob Data Reader or Contributor on the account or container; wait for propagation.
Prevent โ Teach the control vs data plane difference; include data roles in IaC.
Q87 A SAS URL returns AuthenticationFailed: Server failed to authenticate the request ... Signature not valid in the specified time frame.
Beginner
AuthenticationFailed: Server failed to authenticate the request ... Signature not valid in the specified time frame.Likely causes โ SAS expired, start time in the future (clock skew), or the user delegation key expired.
Diagnose โ Inspect st and se parameters in the URL; compare with UTC now.
Fix โ Generate a new SAS with start time a few minutes in the past and appropriate expiry.
Prevent โ Short-lived SAS generated on demand by a service, not long-lived ones pasted into config.
Q88 PublicAccessNotPermitted: Public access is not permitted on this storage account. when setting a container to public.
Beginner
PublicAccessNotPermitted: Public access is not permitted on this storage account. when setting a container to public.Likely causes โ allowBlobPublicAccess is false on the account (often enforced by policy).
Diagnose โ az storage account show -n stshop --query allowBlobPublicAccess
Fix โ Don't make it public: serve through Front Door/CDN with private origin or use SAS. Only enable public access if it's truly intended and allowed.
Prevent โ Keep the policy; document the CDN pattern for static content.
Q89 KeyBasedAuthenticationNotPermitted: Key based authentication is not permitted on this storage account. in an older tool.
Intermediate
KeyBasedAuthenticationNotPermitted: Key based authentication is not permitted on this storage account. in an older tool.Likely causes โ Shared key access disabled; the tool uses account keys or a service SAS.
Diagnose โ az storage account show -n stshop --query allowSharedKeyAccess
Fix โ Configure the tool for Entra auth (--auth-mode login, DefaultAzureCredential, AzCopy with azcopy login --identity), or user delegation SAS.
Prevent โ Inventory key-based consumers before disabling shared keys.
Q90 Application Insights shows no telemetry after deploying an app.
Beginner
Likely causes โ Missing or wrong APPLICATIONINSIGHTS_CONNECTION_STRING, SDK/distro not initialised early, egress blocked to ingestion endpoints, or local auth disabled on App Insights without Entra auth configured.
Diagnose โ Check app settings/env; app logs for exporter errors; Live Metrics.
Fix โ Set the connection string, initialise OpenTelemetry distro at startup, allow egress or AMPLS, configure managed identity auth if local auth is disabled.
Prevent โ Health check in pipeline that queries AppRequests after deploy.
Q91 A log search alert didn't fire during an incident even though the errors are visible in logs now.
Intermediate
Likely causes โ Ingestion latency longer than the evaluation window, the query's time range too short, the threshold/aggregation wrong, or the alert disabled/muted by an alert processing rule.
Diagnose โ Alert rule history; run the query with the same time range; check ingestion_time() - TimeGenerated.
Fix โ Lengthen the window and frequency appropriately, fix the query, review processing rules.
Prevent โ Use metric alerts for paging signals; test alerts with fault injection.
Q92 Log Analytics costs spiked overnight.
Intermediate
Likely causes โ A chatty deployment (debug logs), a new diagnostic setting on a verbose resource, a crash loop flooding logs.
Diagnose โ
Usage
| where TimeGenerated > ago(3d) and IsBillable
| summarize GB = sum(Quantity) / 1000 by DataType, bin(TimeGenerated, 1h)
| render timechartThen ContainerLogV2 | summarize count() by PodNamespace, ContainerName | top 10 by count_.
Fix โ Fix the noisy app, filter in the DCR, move table to Basic.
Prevent โ Daily cap in non-prod, ingestion anomaly alerts.
Q93 Azure DevOps: ##[error]No hosted parallelism has been purchased or granted.
Beginner
##[error]No hosted parallelism has been purchased or granted.Likely causes โ New organisation without free Microsoft-hosted parallel job grant, or private projects without purchased parallel jobs.
Diagnose โ Organization settings โ Parallel jobs.
Fix โ Request the free grant via Microsoft's form, buy parallel jobs, or use a self-hosted agent pool.
Prevent โ Plan agent capacity when creating new orgs.
Q94 Azure DevOps: There was a resource authorization issue: "The pipeline is not valid. Job Deploy: Step AzureCLI input connectedServiceNameARM references service connection arm-shop-prod which could not be found. The service connection does not exist, has been disabled or has not been authorized for use."
Beginner
There was a resource authorization issue: "The pipeline is not valid. Job Deploy: Step AzureCLI input connectedServiceNameARM references service connection arm-shop-prod which could not be found. The service connection does not exist, has been disabled or has not been authorized for use."Likely causes โ Pipeline not authorized to use the service connection, wrong name, or connection in another project.
Diagnose โ Project settings โ Service connections โ the connection's Security tab and pipeline permissions.
Fix โ Authorize the pipeline on the connection (click "Authorize resources" on the run, or add the pipeline in pipeline permissions), correct the name.
Prevent โ Grant per pipeline rather than "all pipelines"; keep names consistent.
Q95 An Azure Pipelines deployment job waits forever at Waiting for approvals and checks.
Beginner
Waiting for approvals and checks.Likely causes โ Pending approval, branch control check failing (run from a non-allowed branch), business hours check, or exclusive lock held by another run.
Diagnose โ Open the run's checks panel; it lists each check status.
Fix โ Approve, run from the allowed branch, or cancel the run holding the lock.
Prevent โ Clear approval owners and timeouts on environment checks.
Q96 azure/webapps-deploy fails with Deployment Failed, Error: Failed to deploy web package to App Service. Conflict (CODE: 409).
Intermediate
azure/webapps-deploy fails with Deployment Failed, Error: Failed to deploy web package to App Service. Conflict (CODE: 409).Likely causes โ Another deployment in progress on the same app/slot, or the app is configured for Run From Package with a locked file system.
Diagnose โ Kudu deployment logs (https://<app>.scm.azurewebsites.net/api/deployments).
Fix โ Serialise deployments (concurrency group), retry; ensure consistent WEBSITE_RUN_FROM_PACKAGE settings.
Prevent โ One deployment at a time per slot.
Q97 App Service container fails: Container shop-web_0_ab12 didn't respond to HTTP pings on port: 80, failing site start.
Beginner
Container shop-web_0_ab12 didn't respond to HTTP pings on port: 80, failing site start.Likely causes โ App listens on another port (8080, 3000) or on 127.0.0.1, or startup takes longer than the timeout.
Diagnose โ az webapp log tail -g rg -n app-shop; check Dockerfile EXPOSE and app listen address.
Fix โ
az webapp config appsettings set -g rg -n app-shop --settings WEBSITES_PORT=8080 WEBSITES_CONTAINER_START_TIME_LIMIT=600Bind to 0.0.0.0.
Prevent โ Standardise container ports and health endpoints.
Q98 Azure Functions app shows Azure Functions runtime is unreachable after locking down the storage account.
Advanced
Azure Functions runtime is unreachable after locking down the storage account.Likely causes โ The Functions host can't reach AzureWebJobsStorage (storage firewall or disabled shared key) because the app isn't VNet-integrated or DNS for storage private endpoints (blob, queue, table, file) isn't resolving.
Diagnose โ Check storage network rules, app's VNet integration, WEBSITE_CONTENTOVERVNET/content share settings, and DNS for all four storage sub-services.
Fix โ
- VNet integration with route all, Private Endpoints for blob/queue/table (and file if using content share), Private DNS zones linked
- Use identity-based connection (
AzureWebJobsStorage__accountName) withStorage Blob Data Owner,Storage Queue Data Contributorand related roles if shared keys are disabled
Prevent โ Use the Functions private networking template; Flex Consumption handles identity-based storage cleanly.
Q99 AKS metric alert on node_cpu_usage_percentage fires constantly for one node pool.
Intermediate
node_cpu_usage_percentage fires constantly for one node pool.Likely causes โ Real saturation (too few nodes, autoscaler max reached), a hot pod without limits, or system pods crowding the pool.
Diagnose โ
kubectl top nodes
kubectl top pods -A --sort-by=cpu | head
az aks nodepool show -g rg --cluster-name aks -n apps --query "{count:count, max:maxCount}"Fix โ Raise autoscaler max, set requests/limits on hot pods, taint system pool, or scale vertically.
Prevent โ Alert on symptoms (latency, errors) plus capacity headroom, not only CPU.
Q100 az keyvault secret set fails with (Forbidden) ... Caller is not authorized ... ForbiddenByRbac for the engineer who just created the vault with Terraform.
Beginner
az keyvault secret set fails with (Forbidden) ... Caller is not authorized ... ForbiddenByRbac for the engineer who just created the vault with Terraform.Likely causes โ Creating the vault (control plane) gives no data-plane rights on an RBAC vault; the engineer needs a Key Vault data role.
Diagnose โ az role assignment list --assignee $(az ad signed-in-user show --query id -o tsv) --scope <kvId>
Fix โ
az role assignment create --role "Key Vault Secrets Officer" \
--assignee $(az ad signed-in-user show --query id -o tsv) --scope <kvId>Wait a few minutes, then retry.
Prevent โ Terraform grants Key Vault Secrets Officer to data.azurerm_client_config.current.object_id when it creates the vault.