2

I'm using Azure AD app registration principles to deploy resources via Azure Resource Manager to deploy via Pipelines. During the deployment I need to set some permissions to the deployment user to ensure it has enough permission to - for example - upload files. As I'm using different principles, and I'm not managing those in the code, I would like to know if there is a way to reference the "current user-principals - ID" during the deployment.

Something like:

deployment().properties.xx

or

environment()

https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-deployment https://learn.microsoft.com/en-us/azure/templates/microsoft.authorization/roleassignments?tabs=bicep

Otherwise, I would need to inject this information via parameter, I think. I could get that information by script - or there is a variable even present from azure dev ops. Any ideas, help appreciated. Thanks.

  • 1
    I don't think it is possible, you will have to inject the details. are you using az cli or powershell to deploy ? – Thomas Jul 28 '22 at 20:01

1 Answers1

3

Currently, it's not possible to get the objectId of the user deploying the template... we do have a backlog item for it.

bmoore-msft
  • 8,376
  • 20
  • 22