Search code examples
azureazure-logic-apps

Use Salesforce Connectors from Hosted Azure Logic App in VSCode?


I have created a Logic App thats hosted on Azure which contains some Salesforce actions requiring the salesforce connection.

I have recreated the same Logic App on my local VSCode machine however when connecting an Azure Connection it doesn't seem to pick up the connections in my Salesforce connections.

I have manually copied the connections.json file from the remote Azure hosted app into my local VSCode hosted app but running this returns the following error:

Workflow 'AZURE-TEST-APP' validation and creation failed. Error: 'The API connection reference name 'salesforce' has invalid authentication type 'ManagedServiceIdentity'. Only 'Raw' or 'ActiveDirectoryOAuth' authentication type is allowed in local developer environment.'

Surely there must be way to use the Salesforce connections in my resource group?


Solution

  • Workflow 'AZURE-TEST-APP' validation and creation failed. Error: 'The API connection reference name 'salesforce' has invalid authentication type 'ManagedServiceIdentity'. Only 'Raw' or 'ActiveDirectoryOAuth' authentication type is allowed in local developer environment.

    • Managed Identity based connection only works in Azure portal. So, in order to use ManagedServiceIdentity authentication type, you need to have the Logic App in Azure Portal.
    • When developing logic app locally, you need to use authentication type either Raw or ActiveDirectoryOAuthAs.
    • You need to format the connection.json file as given below and the same is illustrated in MS Docs for local development.
    {
       "managedApiConnections": {
          "salesforce": {
             "api": {
                "id": "/subscriptions/*****/providers/Microsoft.Web/locations/westus/managedApis/salesforce"
             },
             "connection": {
                "id": "/subscriptions/******/resourceGroups/***/providers/Microsoft.Web/connections/salesforce"
             },
             "connectionRuntimeUrl": "****",
             "authentication": {
                "type": "Raw",
                "scheme": "Key",
                "parameter": "@appsetting('salesforce-connectionKey')"
             }
          }
       }
    }
    
    • You can also refer to this github issue which says the same.