Is it possible to name the service principle that is auto generated when using managed identity? For example, I am provisioning an azure function using the following:
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[parameters('functionAppName')]",
"location": "[variables('location')]",
"kind": "functionapp",
"identity": {
"type": "SystemAssigned"
},
However, I want the name of the AD App to differ from the function name. Reason I am doing this is I want to deploy functions to two regions (EUN and EUW) but I don't want to create an ADD App for each one. For example, I will have my-func-eun
and my-func-euw
but both will be running using the identity my-func
.
Not sure whether there are any drawbacks using this approach (I don't envision any) but the only way I can think of doing this is to provision the AD App via PowerShell beforehand and then injecting the servicePrincipleId
in as a parameter.
You could use a user-assigned identity and use the same identity for both Function apps. The name of the service principal will be the name you set for the identity, so you can set it to what you want.
You cannot set the name of a system-assigned identity.