I am not able to add an active directory administrator to a newly created SQL Managed Instance in the Azure portal or with the Cloud Shell.
When I attempt in the Azure portal, the operation fails with the following message in the activity log:
Operation name: Update Administrator of Azure SQL Managed Instance. Create
Time stamp: Sun Nov 17 2019 xxxxx
Event initiated by: Admin A
Error code: ResourceOperationFailure
Message: The resource operation completed with terminal provisioning state 'Failed'.
When running the following command:
Set-AzSqlInstanceActiveDirectoryAdministrator -ResourceGroupName "myResourceGroupName" -InstanceName "myInstaceName" -DisplayName "Chris Green" -ObjectId "xxx-xxxx-xxx-xxxx"
I'm receiving the following error...
Set-AzSqlInstanceActiveDirectoryAdministrator : Long running operation failed with status 'Failed'. Additional Info:'The operation timed out and automatically rolled back. Please retry theoperation.'
At line:1 char:1
+ Set-AzSqlInstanceActiveDirectoryAdministrator -ResourceGroupName "NWN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzSqlInstanceAc\u2026ectoryAdministrator], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.InstanceActiveDirectoryAdministrator.Cmdlet.SetAzureSqlInstanceActiveDirectoryAdministrator
I was able to assign an active directory admin to a previously created SQL managed instance in the same subscription. Some other things I tried:
- Tried with several different users with higher level permissions
- Tried using the same user who is currently the admin of the other managed instance
- Restarted the instance by scaling up and then back down
How can I further troubleshoot this problem? Could there potentially be more specific information somewhere in the logs? Are there any SQL/Powershell commands I could to further diagnose the failure?
Here is a link to the article I was using as a reference: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-aad-authentication-configure#provision-an-azure-active-directory-administrator-for-your-managed-instance