az containerapp create --yaml does mess up the resource group and user assigned identities if they contain - or _.
The id
/subscriptions/my-subscription-id/resourcegroups/my_resource_group_dev/providers/Microsoft.Managedidentity/Userassignedidentities/my-user-assigned-identity
ERROR: (FailedIdentityOperation) Identity operation for resource '/subscriptions/my-subscription-id/resourceGroups/my_resource_group/providers/Microsoft.App/containerApps/my-container-app' failed with error 'Failed to perform resource identity operation. Status: 'BadRequest'. Response: '{"error":{"code":"BadRequest","message":"Resource '/subscriptions/my-subscription-id/resourcegroups/myResourceGroup/providers/Microsoft.Managedidentity/Userassignedidentities/My-User-Assigned-Identity' was not found."}}'.'.
Issue script & Debug output
az containerapp create -g my_resource_group -n my-container-app --yaml template.json
Describe the bug
az containerapp create --yaml
does mess up the resource group and user assigned identities if they contain-
or_
.The id
/subscriptions/my-subscription-id/resourcegroups/my_resource_group_dev/providers/Microsoft.Managedidentity/Userassignedidentities/my-user-assigned-identity
somehow gets changed to
/subscriptions/my-subscription-id/resourcegroups/myResourceGroupDev/providers/Microsoft.Managedidentity/Userassignedidentities/My-User-Assigned-Identity
on is then now found
Related command
az containerapp create
Errors
ERROR: (FailedIdentityOperation) Identity operation for resource
'/subscriptions/my-subscription-id/resourceGroups/my_resource_group/providers/Microsoft.App/containerApps/my-container-app'
failed with error 'Failed to perform resource identity operation. Status: 'BadRequest'. Response:'{"error":{"code":"BadRequest","message":"Resource '/subscriptions/my-subscription-id/resourcegroups/myResourceGroup/providers/Microsoft.Managedidentity/Userassignedidentities/My-User-Assigned-Identity' was not found."}}'.'.
Issue script & Debug output
az containerapp create -g my_resource_group -n my-container-app --yaml template.json
with template.json containing:
debug.log
Expected behavior
The container app is created with user assigned identity
Environment Summary
azure-cli 2.51.0
core 2.51.0
telemetry 1.1.0
Extensions:containerapp 0.3.37
Dependencies:msal 1.24.0b1
azure-mgmt-resource 23.1.0b2
Can be reproduces on WSL/Ubuntu and container image
mcr.microsoft.com/azure-cli
Additional context
No response