2

I'm trying to retrieve the Client ID of a Managed Identity created with Azure Bicep. But the documentation doesn't give any information about the output parameters. Am I missing something? How can I retrieve the client id after defining the Managed Identity in bicep ?

Thomas
  • 24,234
  • 6
  • 81
  • 125
Enrico
  • 2,734
  • 1
  • 27
  • 40

1 Answers1

4

The clientId is available on the properties of the identity:

param identityName string

resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2022-01-31-preview' = {
  name: identityName
  location: resourceGroup().location
}

output clientId string = identity.properties.clientId
Thomas
  • 24,234
  • 6
  • 81
  • 125