【发布时间】:2021-09-23 07:59:45
【问题描述】:
我在 Azure 门户中从 Azure CLI 运行以下命令,它可以正常工作。
az resource list -g RG_SE_Polisen_Dev --query "[?type=='Microsoft.Storage/storageAccounts'].name" --output tsv | xargs -n 1 -t -I "{}" az lock delete -n "DevTestLabs Lock" -g RG_SE_Polisen_Dev --resource "{}" --resource-type "Microsoft.Storage/storageAccounts"
在 Azure Devops 管道中通过 Azure CLI 任务运行相同的命令以实现自动化,得到以下错误:
在文本中:
E:\agent_1\_work\r30\a>az resource list -g RG_SE_Polisen_Dev --query "[?type=='Microsoft.KeyVault/vaults'].name" --output tsv | xargs -n 1 -t -I '{}' az lock delete -n "DevTestLabs Lock" -g RG_SE_Polisen_Dev --resource '{}' --resource-type "Microsoft.KeyVault/vaults"
2021-09-23T07:31:36.4258125Z az lock delete -n DevTestLabs Lock -g RG_SE_Polisen_Dev --resource SEDEVDTL9342
2021-09-23T07:31:36.4258390Z --resource-type Microsoft.KeyVault/vaults
2021-09-23T07:31:37.8440554Z ERROR: Operation returned an invalid status 'Bad Request'
2021-09-23T07:31:37.9668128Z ##[error]Script failed with error: Error: E:\agent_1\_work\_temp\azureclitaskscript1632382287742.bat failed with return code: 123
【问题讨论】:
标签: azure-devops azure-pipelines azure-cli