Skip to content

az containerapp identity assign - work locally and not in azure devops #32197

@walnut-co

Description

@walnut-co

Describe the bug

                - task: AzureCLI@2
                  displayName: 'Assign Managed Identity and Update Container App'
                  inputs:
                    azureSubscription: $(serviceConnection)
                    scriptType: bash
                    scriptLocation: inlineScript
                    inlineScript: |
                      az config set extension.use_dynamic_install=yes_without_prompt 
                      az provider register --namespace Microsoft.App

                      # ASSIGN THE IDENTITY
                      az containerapp identity assign \
                        --name $(image-name) \
                        --resource-group $(resource-group) \ 
                        --user-assigned '$(managed-identity-name)'

this task in azure devops not working with cli version of 2.77. however it works locally with all the latest version like 2.76 and 2.7..

Related command

az containerapp identity assign
--name $(image-name)
--resource-group $(resource-group) \
--user-assigned '$(managed-identity-name)'

Errors

ERROR: unrecognized arguments:

Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
/home/vsts/work/_temp/azureclitaskscript1759214236821.sh: line 18: --user-assigned: command not found

Issue script & Debug output

ERROR: unrecognized arguments:

Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
/home/vsts/work/_temp/azureclitaskscript1759214236821.sh: line 18: --user-assigned: command not found

Expected behavior

should work

Environment Summary

/usr/bin/az --version
azure-cli 2.77.0

core 2.77.0
telemetry 1.1.0

Extensions:
azure-devops 1.0.2

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location '/opt/az/bin/python3'
Config directory '/home/vsts/.azure'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.13.7 (main, Aug 26 2025, 08:47:19) [GCC 13.3.0]

Additional context

No response

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botConfigureaz configure/configContainerAppPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions