roleAssignment with current user id

Viewed 61

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://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-deployment https://docs.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 Answers

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

Related