AzureCLI input connectedServiceNameARM references service connection $(azureServiceConnection) which could not be found
See original GitHub issueRequired Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: AzureCLI@2
Environment
-
Azure DevOps Services
- Account name: asset-toolbox
- Team project name: container-app
- Build definition name/build number: container-app-iac
-
Agent - Hosted (ubuntu-latest)
Issue Description
I am using AzureCLI@2 task to run a bicep script I configured the task to use a variable with the name of my service connection
- task: AzureCLI@2
displayName: Azure Bicep
inputs:
azureSubscription: $(azureServiceConnection)
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az group create --name $(azureResourceGroup) --location $(azureLocation) --debug
az deployment group create --resource-group $(azureResourceGroup) --template-file main.bicep --parameters acrName=$(azureContainerRegistry) clusterName=$(azureKubernetesName) sqlserverName=$(azureSqlServerName) kvName=$(azureKeyVaultName) loadTestName=$(azureLoadTestName) --debug
So I created a group variable containing the azureServiceConnection variable, but when I run the pipeline the task cannot interpret the variable’s value
If I create a global variable $(azureServiceConnection) inside my yml pipeline, everything works. The problem is when I try to use variable group
My variable group is configured without restrictions, any pipeline can access My service connection has pipeline permission confured
Issue Analytics
- State:
- Created 10 months ago
- Comments:7
Try defining which variable group you need per Stage, like so:
Are you using the same pipeline for QA and PRD? If so, how are you selecting which environment the pipeline runs against?