I want to add a user managed identity as admin to a sql server resource in azure. I can create the user identity using ARM Templates like this:
{
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
"name": "[variables('identityName')]",
"apiVersion": "2018-11-30",
"location": "[resourceGroup().location]"
},
and I can create a administrator resource from ARM template as well. But how do I reference the above created identity in the administrator resource? :
{
"name": "[concat(variables('serverName'),'/ActiveDirectory')]",
"type": "Microsoft.Sql/servers/administrators",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('serverName'))]"
],
"apiVersion": "2019-06-01-preview",
"properties": {
"administratorType": "ActiveDirectory",
"login": "[parameters('identityName')]",
"sid": "<How do I add reference here>",
"tenantId": "<How do I add reference here>"
}
}