Managed Identity — Authenticate Without Secrets
What is Managed Identity?
Managed Identity is an Azure Active Directory feature that provides Azure services with an automatically managed identity. It eliminates the need to store credentials in code, configuration, or key vaults.
There are two types:
- System-assigned — tied to a single Azure resource. Created when you enable it on the resource and deleted when the resource is deleted. One-to-one relationship.
- User-assigned — created as a standalone Azure resource. Can be assigned to one or more Azure resources. Lifecycle is independent of the resources it's assigned to.
Why It Matters
| Problem | Managed Identity Solution |
|---|---|
| Credentials in config files | Zero credentials to manage |
| Secret rotation schedules | Zero rotation needed — tokens are handled by Azure AD |
| Leaked connection strings | Zero leaks possible — no secrets exist |
Managed Identity gives you zero credentials, zero rotation, zero leaks.
Step 1: Enable System-Assigned Managed Identity on Logic App
- Navigate to your Logic App in the Azure Portal
- Select Identity from the left menu
- Switch to the System assigned tab
- Toggle Status to On
- Click Save
- Confirm the prompt to enable the identity

Azure will register the Logic App as a service principal in Azure AD. Note the Object ID — you'll need it for role assignments.
Step 2: Grant RBAC Role for Service Bus (Azure Service Bus Data Receiver)
- Navigate to your Service Bus namespace
- Select Access control (IAM)
- Click Add → Add role assignment
- Search for and select Azure Service Bus Data Receiver
- Click Next
- Select Managed identity
- Click + Select members
- Choose Logic App as the managed identity type
- Select your Logic App from the list
- Click Review + assign

Step 3: Grant RBAC Role for Storage (Storage Blob Data Contributor)
- Navigate to your Storage account
- Select Access control (IAM)
- Click Add → Add role assignment
- Search for and select Storage Blob Data Contributor
- Click Next
- Select Managed identity
- Click + Select members
- Choose Logic App as the managed identity type
- Select your Logic App from the list
- Click Review + assign

Step 4: Grant RBAC Role for Key Vault (Key Vault Secrets User)
- Navigate to your Key Vault
- Select Access control (IAM)
- Click Add → Add role assignment
- Search for and select Key Vault Secrets User
- Click Next
- Select Managed identity
- Click + Select members
- Choose Logic App as the managed identity type
- Select your Logic App from the list
- Click Review + assign

Note: Ensure your Key Vault uses Azure RBAC permission model, not the legacy access policies.
Step 5: Configure Logic App Connector to Use Managed Identity
- Open your Logic App in the designer
- Add or edit a connector action (e.g., Service Bus, Blob Storage)
- When prompted for a connection, select Connect with managed identity
- Provide a Connection name
- Choose System-assigned managed identity
- Click Create

For existing connections:
- Go to API connections in the resource group
- Select the connection
- Click Edit API connection
- Switch authentication to Managed Identity
- Save

User-Assigned Managed Identity: When and How
When to Use User-Assigned MI
- Multiple resources need the same permissions
- You need the identity to persist beyond a single resource's lifecycle
- You want to pre-configure RBAC before deploying the resource
- Blue/green deployments where identity must remain stable
How to Create and Assign
- Search for Managed Identities in the Azure Portal
- Click Create
- Select subscription, resource group, region, and name
- Click Review + create

- Navigate to your Logic App → Identity → User assigned tab
- Click Add
- Select the user-assigned identity
- Click Add

Comparison: Connection String vs Managed Identity
| Aspect | Connection String | Managed Identity |
|---|---|---|
| Credentials stored | Yes — in config or Key Vault | No credentials exist |
| Rotation required | Yes — manual or automated | No — Azure handles tokens |
| Leak risk | High — strings can be exposed | None — nothing to leak |
| Audit trail | Limited | Full Azure AD sign-in logs |
| Cross-tenant support | Yes | Limited (user-assigned only) |
| Setup complexity | Low | Medium (RBAC assignments) |
| Principle of least privilege | Difficult — often over-permissioned | Easy — granular RBAC roles |
| Works outside Azure | Yes | No — Azure-only |
Troubleshooting Managed Identity Issues
403 Forbidden After Assigning Role
- RBAC propagation can take up to 10 minutes. Wait and retry.
- Verify the role is assigned at the correct scope (resource vs resource group vs subscription).
Identity Not Appearing in Role Assignment
- Confirm the system-assigned identity is enabled (Status = On).
- Check you're searching in the correct Azure AD tenant.
Connector Fails with Authentication Error
- Ensure the Logic App identity has the data-plane role, not just a management role (e.g., use "Service Bus Data Receiver" not "Service Bus Contributor").
- Delete and recreate the API connection with MI authentication.
Token Acquisition Timeout
- Check if the resource is behind a private endpoint — the Logic App must have network access to Azure AD token endpoints.
- Verify no NSG rules are blocking outbound HTTPS to
login.microsoftonline.com.
User-Assigned MI Not Working
- Confirm the identity is assigned to the Logic App under the User assigned tab.
- When multiple user-assigned identities exist, specify which one to use in the connector configuration.

| Previous | Next |
|---|---|
| VNet & Private Endpoints | Monitoring |