azure-cli-extensions
azure-cli-extensions copied to clipboard
pipelines variable-group Not working with AzureCLI@2 Task
Trying to have a MS hosted DevOps agent query a Team project to select predefined variable groups. This works locally however; when coupled with the Azure CLI Task Get an error
Before you can run Azure DevOps commands, you need to run the login command(az login if using AAD/MSA identity else az devops login if using PAT token) to setup credentials. Please see https://aka.ms/azure-devops-cli-auth for more information.
Try logging in via a PAT and script before this step and still not able to successfully run the az pipelines command
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: ba39ac35-94ff-5cda-dede-4834d174ee4c
- Version Independent ID: 93f1ab7d-610b-0fc4-c247-c31dd7752f60
- Content: az pipelines variable-group
- Content Source: latest/docs-ref-autogen/ext/azure-devops/pipelines/variable-group.yml
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.
Issue Details
Trying to have a MS hosted DevOps agent query a Team project to select predefined variable groups. This works locally however; when coupled with the Azure CLI Task Get an error
Before you can run Azure DevOps commands, you need to run the login command(az login if using AAD/MSA identity else az devops login if using PAT token) to setup credentials. Please see https://aka.ms/azure-devops-cli-auth for more information.
Try logging in via a PAT and script before this step and still not able to successfully run the az pipelines command
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: ba39ac35-94ff-5cda-dede-4834d174ee4c
- Version Independent ID: 93f1ab7d-610b-0fc4-c247-c31dd7752f60
- Content: az pipelines variable-group
- Content Source: latest/docs-ref-autogen/ext/azure-devops/pipelines/variable-group.yml
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Author: | JFolberth |
---|---|
Assignees: | - |
Labels: |
|
Milestone: | - |
pipelines
Any update on this?
devops service team should look into this issue.
Following should work without needing to do azure login
:
- task: Bash@3
displayName: "Build .env"
inputs:
targetType: 'inline'
script: |
#!/bin/bash
az extension add -n azure-devops
az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project="$(System.TeamProject)" --use-git-aliases true
az pipelines variable-group list --output table
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)