I want to do the following function using Azure CLI. turn the system assigned service principal off, Add a user managed identity and make it the primary identity using Azure CLI. Would much appreciate the help.
I tried to replicate the issue in my environment with below code:
az sql mi update -g Analytics-Resources -n sqlmanagedinstanceshared -i \ --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Analytics-Resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dbm \ --identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Analytics-Resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dbm
I got the same error:
This error I got because of extra back slash at -i I removed that tried to exucute the code:
az sql mi update -g Analytics-Resources -n sqlmanagedinstanceshared -i --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Analytics-Resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dbm \ --identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Analytics-Resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dbm
The error was resolved, and it executed successfully.