Azure / Azure/azure-cli-extensions
[aks-preview] CLI does not dutifully report errors due to sig image unavailability in region
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### Describe the bug
I have recently had a bad experience with the aks-preview extension, particularly when deploying a custom sig image that happened to not be replicated to the region for my deployment.
Closer inspection in the activity logs for the MC_ resource group shows the following error:
**The gallery image /subscriptions//resourceGroups//providers/Microsoft.Compute/galleries//images/AzureLinuxV3gen2/versions/ is not available in westus2 region. Please contact image owner to replicate to this region, or change your requested region.**
But the az cli is still hung on **CreatingAgentPools: 0/2 nodes completed ..**
In my opinion, az cli should handle the failure and surface it to the user.
### Related command
Certain fields \ for privacy reasons:
az aks create -g cameronbaird_home_westus2 -n test-image --aks-custom-headers "AKSHTTPCustomFeatures=Microsoft.ContainerService/UseCustomizedOSImage,OSImageSubscriptionID=,OSImageResourceGroup=AKSTest,OSImageGallery=,OSImageName=AzureLinuxV3gen2,OSImageVersion=,OSSKU=AzureLinux,OSDistro=CustomizedImageKata" --node-vm-size Standard_D4s_v5 --nodepool-tags AzSecPackAutoConfigReady=true --location westus2 --node-count 2
### Errors
In the portal activity logs:
```
"The gallery image /subscriptions//resourceGroups//providers/Microsoft.Compute/galleries//images/AzureLinuxV3gen2/versions/ is not available in westus2 region. Please contact image owner to replicate to this region, or change your requested region."
```
The "bug" is that the az cli hangs forever and doesn't report this error.
### Issue script & Debug output
az aks create -g \ -n \ --aks-custom-headers "AKSHTTPCustomFeatures=Microsoft.ContainerService/UseCustomizedOSImage,..." --node-vm-size Standard_D4s_v5 --nodepool-tags AzSecPackAutoConfigReady=true --location westus2--node-count 2
Bug will trigger if your custom image is not replicated to westus2.
### Expected behavior
az cli returns an error explaining that the sig image is not replicated to the --location specified.
### Environment Summary
azure-cli 2.88.0
core 2.88.0
telemetry 1.1.0
Extensions:
aks-preview 21.0.0b9
azure-devops 1.0.6
confcom 2.1.0
resource-graph 2.1.1
serial-console 1.0.0b4
Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0
Python location '/opt/az/bin/python3'
Config directory '/home/cameronbaird/.azure'
Extensions directory '/home/cameronbaird/.azure/cliextensions'
Python (Linux) 3.14.5 (main, Jun 30 2026, 10:52:46) [GCC 11.4.0]
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the `az aks create` command from the issue with a custom SIG image that is unavailable in the requested region, then inspect the aks-preview handling of the `CreatingAgentPools` operation and its activity-log error. Done means the CLI exits instead of hanging and reports that the gallery image is not replicated to the requested region.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100