- Knowledge Base
- Microsoft Azure
- Logic Apps
- Use Managed Identities for Azure Logic Apps
Ensure that your Microsoft Azure Logic Apps are using system-assigned and/or user-assigned managed identities to allow secure access to other cloud protected resources such as Azure Storage accounts. Managed identities minimizes risks, simplifies management, and maintains compliance with evolving cloud services.
excellence
Using system-assigned and/or user-assigned managed identities for Logic Apps resources enhances security by allowing Azure Logic Apps to authenticate and authorize with other Azure services and resources without the need for explicit credentials. This reduces the risk associated with credential management, allows granular control over access permissions, and provides a seamless and more secure integration with other Azure cloud components.
Audit
To determine if your Azure Logic Apps are configured to use system-assigned and/or user-assigned managed identities, perform the following operations:
Using Azure Console
01 Sign in to the Microsoft Azure Portal.
02 Navigate to All resources blade available at https://portal.azure.com/#browse/all to access all your Microsoft Azure cloud resources.
03 Choose the Azure subscription that you want to access from the Subscription equalls all filter box and choose Apply.
04 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Logic App (Standard) for Value, then choose Apply to list the Azure Logic Apps available in the selected subscription.
05 Click on the name (link) of the Azure Logic App that you want to examine.
06 In the resource navigation panel, under Settings, select Identity, and perform the following checks to determine if the selected Logic App is using managed identities:
- Select the System assigned tab and check the configuration setting status available under Status. If Status is set to Off, the selected Azure Logic App is not using a system-assigned managed identity.
- Select the User assigned tab and check for any user-assigned managed identities associated with the selected resource. If there are no user identities listed on this page, instead the following message is displayed: No user assigned managed identities found on this resource, the selected Azure Logic App is not using user-assigned managed identities.
07 Repeat steps no. 5 and 6 for each Azure Logic App deployed in the selected Azure subscription.
08 Repeat steps no. 3 – 7 for each Azure subscription created in your Microsoft Azure cloud account.
Using Azure CLI
01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:
az account list --query '[*].id'
02 The command output should return the requested subscription identifiers (IDs):
[ "abcdabcd-1234-abcd-1234-abcdabcdabcd", "abcd1234-abcd-1234-abcd-abcd1234abcd" ]
03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):
az account set --subscription abcdabcd-1234-abcd-1234-abcdabcdabcd
04 Run logicapp list command (Windows/macOS/Linux) with custom output filters to list the name of each Azure Logic App available in the selected subscription:
az logicapp list --output table --query '[*].{name:name, resourceGroup:resourceGroup}'
05 The command output should return the requested Azure Logic App names:
Name ResourceGroup ----------------------- ------------------------------ cc-project5-logic-app cloud-shell-storage-westeurope cc-trendmicro-logic-app cloud-shell-storage-westeurope
06 Run logicapp show command (Windows/macOS/Linux) with the name of the Azure Logic App that you want to examine as the identifier parameter and custom output filters to determine the type of the managed identity (i.e. system-assigned and/or user-assigned) configured for the selected Logic App resource:
az logicapp show --name cc-project5-logic-app --resource-group cloud-shell-storage-westeurope --query '{"IdentityType":identity.type}'
07 The command output should return the identity type used by the selected resource:
{ "IdentityType": null }
If the logicapp show command output returns null for the "IdentityType" attribute, as shown in the example above, the selected Microsoft Azure Logic App is not using a system-assigned and/or user-assigned managed identity to authenticate to other Azure cloud services.
08 Repeat steps no. 6 and 7 for each Azure Logic App available within the selected Azure subscription.
09 Repeat steps no. 3 – 8 for each Azure subscription created in your Microsoft Azure cloud account.
Remediation / Resolution
To ensure that your Microsoft Azure Logic Apps are configured to use system-assigned and/or user-assigned managed identities, perform the following operations:
Using Azure Console
01 Sign in to the Microsoft Azure Portal.
02 Navigate to Managed Identities blade available at https://portal.azure.com/#browse/Microsoft.ManagedIdentity%2FuserAssignedIdentities.
03 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.
04 Choose Create and perform the following actions to create a new user-assigned managed identity:
- For Basics, choose the correct subscription and resource group, provide a unique name for the new managed identity, then select the Azure region where your Azure Logic Apps are deployed. Choose Next to continue the setup process.
- For Tags, use the Name and Value fields to create tags that will help organize the identity of the identity. Choose Review + create to validate the identity setup.
- For Review + create, review the resource configuration details, then choose Create to create your new user-assigned managed identity.
05 Navigate to All resources blade available at https://portal.azure.com/#browse/all to access all your Microsoft Azure cloud resources.
06 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.
07 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Logic App (Standard) for Value, then choose Apply to list the Azure Logic Apps available in the selected subscription.
08 Click on the name (link) of the Azure Logic App that you want to configure.
09 In the resource navigation panel, under Settings, select Identity, and perform the following actions to enable system-assigned and user-assigned managed identities for the selected Azure Logic Apps resource:
- Choose the System assigned tab and select On under Status to enable the system-assigned managed identity for the selected Azure Logic App. Choose Save and select Yes to confirm the changes. The selected Azure Logic App is now registered with Microsoft Entra ID, eliminating the need to store credentials in your code. Once the feature is enabled, all necessary permissions can be granted via Azure RBAC.
- Select the User assigned tab, choose Add, select the appropriate Azure subscription from the Select a subscription dropdown list, and choose the user-assigned managed identity created earlier in the Remediation process, from the User assigned managed identities list. Choose Add to apply the configuration changes.
10 Repeat steps no. 8 and 9 for each Azure Logic App that you want to configure, deployed in the selected Azure subscription.
11 Repeat steps no. 3 – 10 for each Azure subscription created in your Microsoft Azure cloud account.
Using Azure CLI
01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:
az account list --query '[*].id'
02 The command output should return the requested subscription identifiers (IDs):
[ "abcdabcd-1234-abcd-1234-abcdabcdabcd", "abcd1234-abcd-1234-abcd-abcd1234abcd" ]
03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):
az account set --subscription abcdabcd-1234-abcd-1234-abcdabcdabcd
04 Run logicapp list command (Windows/macOS/Linux) with custom output filters to list the name of each Azure Logic App available in the selected subscription:
az logicapp list --output table --query '[*].{name:name, resourceGroup:resourceGroup}'
05 The command output should return the requested Azure Logic App names:
Name ResourceGroup ----------------------- ------------------------------ cc-project5-logic-app cloud-shell-storage-westeurope cc-trendmicro-logic-app cloud-shell-storage-westeurope
06 Run logicapp update command (OSX/Linux/UNIX) to enable the system-assigned managed identity for the specified Azure Logic App:
az logicapp update --name cc-project5-logic-app --resource-group cloud-shell-storage-westeurope --set identity.type="SystemAssigned" --query 'identity'
07 Once the assignment process is completed, the command output should return the information available for the managed identity:
{ "principalId": "abcd1234-abcd-1234-abcd-1234abcd1234", "tenantId": "1234abcd-abcd-1234-abcd-abcd1234abcd", "type": "SystemAssigned", "userAssignedIdentities": null }
08 Run identity create command (OSX/Linux/UNIX) to create a new user-assigned managed identity for your Microsoft Azure Logic App:
az identity create --name cc-project5-logic-app-identity --resource-group cloud-shell-storage-westeurope --location westeurope --query 'id'
09 The command output should return the full ID of the new user-assigned managed identity:
"/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/cloud-shell-storage-westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cc-project5-logic-app-identity"
10 Run logicapp update command (OSX/Linux/UNIX) to assign your new user-assigned managed identity to the specified Azure Logic App:
az logicapp update --name cc-project5-logic-app --resource-group cloud-shell-storage-westeurope --set identity.type="UserAssigned" --set identity.userAssignedIdentities="/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/cloud-shell-storage-westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cc-project5-logic-app-identity" --query 'identity'
11 Once the assignment process is completed, the command output should return the information available for the managed identity:
{ "principalId": null, "tenantId": null, "type": "UserAssigned", "userAssignedIdentities": { "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/cloud-shell-storage-westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cc-project5-logic-app-identity": { "clientId": "1234abcd-abcd-1234-abcd-abcd1234abcd", "principalId": "abcd1234-abcd-1234-abcd-1234abcd1234" } } }
12 Repeat steps no. 6 - 11 for each Azure Logic App that you want to configure, available within the selected subscription.
13 Repeat steps no. 3 – 12 for each Azure subscription created in your Microsoft Azure cloud account.
References
- Azure Official Documentation
- What are managed identities for Azure resources?
- Authenticate access and connections to Azure resources with managed identities in Azure Logic Apps
- Manage user-assigned managed identities
- Azure Command Line Interface (CLI) Documentation
- az account list
- az account set
- az logicapp list
- az logicapp show
- az identity create
- az logicapp update
Related LogicApps rules
- Enable Authentication with Microsoft Entra ID (Security, operational-excellence)
- Enable Diagnostic Logs for Azure Logic Apps (Security, reliability, operational-excellence, cost-optimisation, performance-efficiency)
- Use Managed Identities for Azure Logic Apps (Security, operational-excellence)
- Use Private Endpoints for Azure Logic Apps (Security)