Having issues w/release pipeline (Azure CLI) that has me scratching my head...
Scenario:
- Release pipeline / Azure DevOps / 1 task having a single inline AZ CLI script utilizing a service connection back to my Azure cloud instance.
- Service connection is based on ARM, which when I click on it - it shows Owner/Contributor/Reader at Subscription level of the hierarchy.
- Inline AZ CLI task is defined to deploy a container instance using the AZ CLI task - which runs fine from Portal.
- AZ CLI task has checkbox marked (ON) for Access SP details in script - When the pipeline runs, it logs into the Azure cloud instance perfectly.
- Inline script defined for AZ CLI task is all of two (2) lines:
az account
az container create --resource-group myRG --file myContainerInstance.yml
The YML file specifies the Azure Container Instance - which FYI is a Docker image, previously published TO AZ cloud Container Registry.
Problem: Azure DevOps CLI task issues following error:
ERROR: ValidationError: (AuthorizationFailed) The client '6blahbla-blah-bl2h-xyza-012345678901' with object id '6blahbla-blah-bl2h-xyza-012345678901' does not have authorization to perform action 'Microsoft.Resources/subscriptions/read' over scope '/subscriptions/6bazzers-fuzz-bots-last-hurrahhurrah/myRG' or scope is invalid.
Remedies attempted:
- Modifying role-perms at the Subscription and Resource Group level.
- Includes: Owner, Contributor, Reader
- Trying to refresh credentials - albeit Azure CLI seems to refresh automagically.
- Verified correlation between SP logged in (the '6blahbla...012345678901') by confirming it is my user from Azure Portal CLI:
az ad sp show --id 6blahbla-blah-bl2h-xyza-012345678901