Search code examples
azure-bicep

Getting Azure AD domain via Bicep


Bicep provides functions to retrieve information regarding the context of the deployment. I have looked at environment() and subscription() functions and both don't have the AAD Domain.

Is there a way of getting AAD domain, e.g. "example.com" from Bicep?


Solution

  • Not possible. Current Bicep works only with Azure Resource Manager APIs:

    One solution is to use deployment scripts(1) and then fetch required information from graph API.

    (1) https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template