Azure Managed Application: Using Customer-Owned Managed Identity in Deployment Scripts

Golla Manish 0 Reputation points
2026-11-16T04:47:12.32+00:00

Hello Team,

We are developing a product for the Azure Marketplace and would appreciate guidance on an issue we encountered while implementing our Azure Managed Application.

In our earlier question, we sought guidance on the appropriate Marketplace offer type and supported deployment patterns for a product that runs within the customer's Azure subscription and interacts with their Microsoft Fabric workspace.

Based on the guidance received, we built our product, Fabric Data Estate Analyzer, as an Azure Managed Application with a customer-managed plan. The application installs into the customer's environment using an ARM deployment script.

The deployment script uses a customer-owned user-assigned managed identity to read service principal credentials from the customer's Azure Key Vault.

The offer has since been published to Preview, and a test installation using the preview link has succeeded.

Issue Faced and Resolution

During the initial installation, the deployment failed with the error DeploymentScriptOperationFailed.

On investigation, we found that the Appliance Resource Provider had the Microsoft.ContainerInstance/containerGroups/write permission but did not have the Microsoft.ManagedIdentity/userAssignedIdentities/assign/action permission on our managed identity, which is located outside the managed resource group.

Providing the managedIdentity output alone did not resolve the issue. The deployment succeeded only after we assigned the Managed Identity Operator role to the Appliance Resource Provider, scoped specifically to that user-assigned managed identity.

We could not find documentation covering this exact setup and would appreciate clarification on the following:

Questions

Is granting the Appliance Resource Provider the Managed Identity Operator role a supported approach for a production Azure Marketplace application? Would asking customers to grant this role create any issues during Marketplace certification?

Should the managedIdentity output alone have been sufficient for the deployment script to use the managed identity?

Since the Appliance Resource Provider is shared across managed applications, could another managed application in the same tenant attach this identity and use its Key Vault access when this role is assigned?

Can customers safely remove this role after installation? Would any subsequent operations, such as updating or deleting the application, require this permission?

Is there a better way for a deployment script to use a customer-owned identity without requiring this role?

Also, would it be possible to continue this discussion over an email thread? This would allow the rest of our team to stay informed and contribute to the discussion where needed.

Thank you for your guidance.

Azure Managed Applications
Azure Managed Applications

An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.

0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-16T04:48:48.49+00:00

    Grant Managed Identity Operator to the Appliance Resource Provider at the individual customer-owned user-assigned identity scope, and retain that identity in the deployment script’s identity property; this is the documented permission model for attaching a user-assigned identity to a deployment script.

    Required production configuration

    For deployment scripts, Azure distinguishes:

    • Deployment principal — creates the deployment-script resource and its supporting storage account and Azure Container Instance.
    • Deployment script principal — the user-assigned identity under which the script authenticates.

    When a user-assigned identity is specified, the deployment principal requires Managed Identity Operator on that identity. That role contains Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action.^1^ ^2^

    In this Managed Application deployment, your observed deployment confirms that the Appliance Resource Provider is performing that operation. Configure the prerequisite as follows:

    1. Open Azure portal → Managed Identities → customer identity → Access control (IAM).
    2. Select Add → Add role assignment.
    3. Select Managed Identity Operator, then Next.
    4. For Assign access to, select User, group, or service principal.
    5. Select Appliance Resource Provider.
    6. Select Review + assign.
    7. Keep the scope at the individual managed identity, not its resource group or subscription.

    The customer creating this assignment must have Owner, User Access Administrator, or equivalent Microsoft.Authorization/roleAssignments/write permission at that scope. Contributor alone cannot create role assignments.^2^

    Continue declaring the identity on the deployment script:

    "identity": {
      "type": "userAssigned",
      "userAssignedIdentities": {
        "[parameters('customerIdentityResourceId')]": {}
      }
    }
    

    Why managedIdentity output was not sufficient

    The managedIdentity output from createUiDefinition.json sets the identity of the Managed Application resource. It supports access to existing resources and authorization outside the managed resource group.^3^

    It does not eliminate the separate authorization required when Azure attaches that identity to the deployment script’s backing compute. The deployment script must have its own identity declaration, while the deployment principal must have assign/action on that identity.^1^

    Marketplace certification

    The Marketplace policies do not prohibit this role assignment. They require RBAC assignments to use the least privilege necessary and require managed identities to have a role; Owner assignments require justification.^4^

    For certification:

    • Scope Managed Identity Operator only to the selected identity.
    • Explain in the offer prerequisites that it permits the deployment service to attach that identity to the deployment-script container.
    • Separately grant the customer identity only the minimum Key Vault data-plane role needed, such as access to the required secrets.
    • Avoid subscription- or resource-group-wide Managed Identity Operator unless technically necessary.

    The policy establishes these least-privilege requirements, but it does not guarantee that this exact configuration will pass certification; the certification team can request changes or justification during review.

    Shared-principal security implications

    A user-assigned identity can be attached to multiple Azure resources, and any code running on an attached resource can request tokens for it.^5^

    Because Appliance Resource Provider is a shared first-party service principal, the role assignment authorizes that principal to assign this identity. Identity-scoped RBAC prevents it from assigning other identities, but the available documentation does not establish a hard per-Managed-Application isolation boundary for this permission. Do not describe the assignment as guaranteeing that no other Managed Application deployment can attach the identity.

    Reduce exposure by:

    • Creating a dedicated identity for this product instance.
    • Granting it access only to a dedicated vault or specific required secrets.
    • Monitoring identity assignment operations through Azure Activity Log.
    • Removing the role after deployment if lifecycle testing confirms it is unnecessary.

    Removing the role after installation

    The role is required whenever the deployment script service must create or recreate its container with that identity. Deployment scripts can run again when their name or properties change, or when forceUpdateTag changes.^1^

    Therefore:

    • Initial deployment: role required.
    • Update, repair, or redeployment that reruns/recreates the script: role required again.
    • Ordinary runtime Key Vault access: Managed Identity Operator is not required; the identity’s Key Vault permission is what matters.
    • Deletion: available documentation does not conclusively state that every Managed Application deletion path needs assign/action.

    Before documenting post-install removal as supported behavior, test install, update, repair/redeployment, and deletion against the preview offer. Otherwise, retain the narrowly scoped assignment.

    Alternatives

    There is no documented way to attach a customer-owned user-assigned identity to a deployment script without granting the deployment principal assign/action. The practical alternatives are:

    1. Avoid the deployment script and use declarative ARM/Bicep resources where possible.
    2. Use a dedicated per-installation identity with minimal Key Vault access.
    3. If only passing an existing Key Vault secret into deployment, use the documented Managed Application Key Vault-reference pattern. That pattern grants Appliance Resource Provider access to the vault and has different—and potentially broader—security implications.^6^

    For an authoritative certification decision or product-specific security review, open a Partner Center support request: Partner Center → Help (?) → Contact Support → Create support request.^7^ Q&A does not provide a private email thread. Ask Partner Center support whether additional participants can be included, and share ticket updates internally if needed.


    References

    1. Use deployment scripts in Azure Resource Manager templates
    2. Managed identities for Azure resources frequently asked questions
    3. Azure Managed Application with managed identity
    4. Microsoft Marketplace certification policies
    5. What is managed identities for Azure resources?
    6. Access Key Vault secret when deploying Azure Managed Applications
    7. Get help and contact support in Partner Center
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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