az containerapp create --yaml: issue with userAssignedIdentities
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### 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:
```
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/my-subscription-id/resourcegroups/my_resource_group /providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-user-assigned-identity": {}
}
},
```
[debug.log](https://github.com/Azure/azure-cli/files/12455244/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_
Contributor guide
Assessment
This issue has not been assessed yet.