How to use parameters for salesforce API connection while deployment of Logic app?

元气小坏坏 提交于 2020-12-07 08:47:15

问题


I have developed a Logic app and want to deploy it using parameter file.

When we use service bus connector into logic app we have service bus connection string so we can make it as a parameter for service bus connection string.

But while using salesforce connector it will ask for login into designer panel and generate a API connection for salesforce.

But while deployment i do not find any connection string or login credential url for salesforce connector.

I wonder how it will work for other resource groups while deployment?


回答1:


Can your Logic App reference the existing salesforce connector? Salesforce connectors need to be authenticated; however, once authenticated I believe you can reference it in your ARM template by using something like the following in the Logic App:

         "$connections": {
        "value": {
          "salesforce": {
            "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', 'CONNECTION REGION', '/managedApis/', 'salesforce')]",
            "connectionId": "[resourceId('Microsoft.Web/connections', parameters('salesforce_Connection_Name'))]",
            "connectionName": "[parameters('salesforce_Connection_Name')]"
          }

You can deploy the connection in the same template with something like this:

 {
      "type": "MICROSOFT.WEB/CONNECTIONS",
      "apiVersion": "2016-06-01",
      "name": "[parameters('salesforce_Connection_Name')]",
      "location": "centralus",
      "properties": {
        "api": {
          "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', 'INSERT REGION', '/managedApis/', 'salesforce')]"
        },
        "displayName": "[parameters('salesforce_Connection_DisplayName')]",
        "nonSecretParameterValues": {
          "token:LoginUri": "[parameters('salesforce_token:LoginUri')]",
          "salesforceApiVersion": "[parameters('salesforce_salesforceApiVersion')]"
        }
      }
    }

You'd have to pass in the LoginURI as a parameter which if you have multiple Salesforce and Azure environments would be a good thing to reuse the same template with different parameters.



来源:https://stackoverflow.com/questions/59369058/how-to-use-parameters-for-salesforce-api-connection-while-deployment-of-logic-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!