Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get PrincipalId when deploying ARM Template

Is it possible to retrieve the ID of the user that is deploying the ARM template?

There is the subscription() function that retrieves information about the subscription the template is being deployed to, including the subscription ID, I'm hoping there is something similar for the principal.

like image 953
Cloud SME Avatar asked Jun 26 '17 18:06

Cloud SME


2 Answers

No, this is not possible as of today (26.06.2017). This might change in the future. You can always create feedback item for that and track it.

https://feedback.azure.com/forums/34192--general-feedback

Function reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-deployment

like image 85
4c74356b41 Avatar answered Sep 18 '22 18:09

4c74356b41


This is now possible using reference().

"[reference(resourceId('Microsoft.Web/sites', variables('appService')), '2016-08-01', 'Full').identity.principalId]"

Note the use of 'full' parameter in the reference() function.

Relevant docs: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#reference

like image 35
Brendon Avatar answered Sep 18 '22 18:09

Brendon