Setting Permissions for Managed Identity (MSI)

Learn how to set up the automation pipeline to configure the Managed Service Identity (MSI).

PowerShell task to get MSI object id

To run the PowerShell script that gets an object id (or Azure CLI scripts), we will use the pipeline task AzureCLI@1. This task (and script) does the following:

  1. Gets the object id from Azure Active Directory by app service display name.
  2. Prints the variable app service name $(appServiceName) and object id ($objectId) to the dev console.
  3. Shares object id local variable to be accessible between other pipeline tasks. It assigns a variable to the pipeline global variable (avmAppServiceObjectId) using the command echo "##vso[task.setvariable variable=avmAppServiceObjectId;]$objectId".

You can find the complete reference here.

Get hands-on with 1200+ tech skills courses.