azure-logic-appsazure-logic-app-standard

Using Managed Identity in Visual Studio Code for Connection to Service Bus in Azure Logic App Standard


I'm trying to use VS Code for developing a logic app that uses service bus trigger. When creating the connection can we use Managed identity in local that would use my creds similar to the Default Credentials using my token in case of Visual Studio in case of Azure Functions? I've contributor access on the service bus but still getting an error on VS Code.

enter image description here

This is Standard Logic app extension that I've used and want to develop the Single tenant Std Logic App


Solution

  • Using Managed Identity in Visual Studio Code for Connection to Service Bus in Azure Logic App Standard

    Logic Apps do not support using Managed Identity locally the same way Azure Functions do with DefaultAzureCredential.

    Thanks @ARINCO for his clear explanation.

    The Visual Studio Code extension only supports Connection String or Azure AD OAuth authentication for Logic Apps. However, after deploying to Azure, we can use Managed Identity for connecting Service Bus.

    To manage authentication both locally and Azure for connecting logic app to Azure Service bus use parameters.json or connection.json file to parameterize your app so that the app uses connection string for auth locally and then have Managed Identity After deploying to Azure.

    For local development, set AzureWebJobsServiceBus in local.settings.json with a Service Bus connection string.

    local.settings.json:

    
    {
      "IsEncrypted": false,
      "Values": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "AzureWebJobsServiceBus": "Endpoint=sb://your-servicebus.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=your-key"
      }
    }
    

    Refer this MS Doc for Managed Identity After Deployment.