Hi Varma,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
The error you're encountering indicates that Azure Container Instance (ACI) is unable to access the Docker image owasp/zap2docker-stable. This issue is often related to incorrect image names or registry access problems. Here are some steps to help resolve the issue:
Verify the Image Name and Tag: Ensure that the Docker image owasp/zap2docker-stable is correct. The error message suggests owasp/zap2docker-weekly:latest as an alternative. You can verify the correct image name and tag by visiting the OWASP ZAP Docker Hub page or by running the following command locally:
docker pull owasp/zap2docker-stable
If owasp/zap2docker-stable is not available or is incorrect, you might want to use owasp/zap2docker-weekly:latest instead:
az container create --resource-group $(zapACIGroupName) --name $(zapACIName) --image owasp/zap2docker-weekly:latest --ports 8080 8090 --azure-file-volume-account-name $(zapACIStoreName) --azure-file-volume-account-key $(createSA.aciStoreKey) --azure-file-volume-share-name $(zapACIShareName) --azure-file-volume-mount-path /zap/wrk/ --command-line "/bin/bash -c 'zap-baseline.py -t https://$(webAppNameDev).azurewebsites.net -x $(zapReportName)'"
Check Registry Authentication:
If the image is in a private registry, ensure that you provide the correct registry credentials. You can specify registry credentials using the --registry-login-server, --registry-username and --registry-password parameters:
az container create --resource-group $(zapACIGroupName) --name $(zapACIName) --image <private-registry>/<image>:<tag> --ports 8080 8090 --registry-login-server <your-registry> --registry-username <username> --registry-password <password> --azure-file-volume-account-name $(zapACIStoreName) --azure-file-volume-account-key $(createSA.aciStoreKey) --azure-file-volume-share-name $(zapACIShareName) --azure-file-volume-mount-path /zap/wrk/ --command-line "/bin/bash -c 'zap-baseline.py -t https://$(webAppNameDev).azurewebsites.net -x $(zapReportName)'"
Review ACI Logs:
To get more details about the error, you can review the logs of your ACI:
az container logs --resource-group $(zapACIGroupName) --name $(zapACIName)
Update Azure CLI:
Make sure you're using the latest version of the Azure CLI, as this can sometimes resolve unexpected issues:
az upgrade
You can refer to the detailed troubleshooting guide on the Microsoft Learn website: DeploymentFailed - InaccessibleImage error code - Azure
If you have any further queries, do let us know. If the comment is helpful, please click "Upvote".