Is it possible to create an Entra ID App with Managed Identity and assign both Contributor and Application Administrator roles via ARM Template (Custom Template Deployment)?

sanjith badri 0 Reputation points
2025-05-28T07:29:46.2233333+00:00

Hi all,

I'm trying to automate the creation of an Azure Managed Identity and assign it the following roles:

  • Contributor (at the subscription or resource group level)

Application Administrator (at the Entra ID / tenant scope)

My goal is to deploy this setup entirely through an ARM template using the "Deploy a custom template" option in the Azure Portal.

I've run into several issues:

  • ARM templates support Contributor assignment using the Microsoft.Authorization/roleAssignments resource but assigning Application Administrator (which is a tenant-level role) doesn't seem to work properly due to scope limitations.

Attempts to use deployment scripts or tenant-scoped roleAssignments inside a resource group or subscription deployment have failed or been rejected with invalid scope errors.

I would like to know:

Is it officially supported to assign tenant-level roles like Application Administrator to a user-assigned managed identity via ARM template?

If yes, how should the template be structured and at what deployment scope (tenant, subscription, or resource group)?

If not supported directly in ARM, are there any alternatives that can still be triggered from the portal (like Deployment Scripts or Bicep modules)?

Any examples, official docs, or guidance from Microsoft or the community would be greatly appreciated.Hi all,

I'm trying to automate the creation of an Azure Managed Identity and assign it the following roles:

Contributor (at the subscription or resource group level)

Application Administrator (at the Entra ID / tenant scope)

My goal is to deploy this setup entirely through an ARM template using the "Deploy a custom template" option in the Azure Portal.

I've run into several issues:

ARM templates support Contributor assignment using the Microsoft.Authorization/roleAssignments resource, but assigning Application Administrator (which is a tenant-level role) doesn't seem to work properly due to scope limitations.

Attempts to use deployment scripts or tenant-scoped roleAssignments inside a resource group or subscription deployment have failed or been rejected with invalid scope errors.

I would like to know:

Is it officially supported to assign tenant-level roles like Application Administrator to a user-assigned managed identity via ARM template?

If yes, how should the template be structured and at what deployment scope (tenant, subscription, or resource group)?

If not supported directly in ARM, are there any alternatives that can still be triggered from the portal (like Deployment Scripts or Bicep modules)?

Any examples, official docs, or guidance from Microsoft or the community would be greatly appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
25,016 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.