ARM template Office 365 connection for logic apps

后端 未结 2 950
野的像风
野的像风 2020-12-18 06:56

I have a logic app that I am trying to automate through an ARM Template.

The logic app requires a connection to Office 365. Below I have the template for the connec

相关标签:
2条回答
  • 2020-12-18 07:34

    I found three post related to the same problem:

    • Deploying a logic app using ARM templates/powershell
    • Azure Logic Apps - ARM template to deploy filesystem API connection
    • How to set the connection string for a Service Bus Logic App action in an ARM template?

    The problem is the same for all API Connection. Connection parameters to access the specific service are stored on Azure and when you try to export the ARM Template there is nothing regarding these specific parameters (which make sens as Azure will not expose your secret, password...).

    The trick is to query Azure Resource Management API to return the parameters needed for any connection in a Logic App.

    Just follow the instructions on this article:

    • Deploying in the Logic Apps Preview Refresh
    0 讨论(0)
  • 2020-12-18 07:40

    Use the below link to install logic app tool which can help to design workflow https://marketplace.visualstudio.com/items?itemName=VinaySinghMSFT.AzureLogicAppsToolsforVisualStudio-18551

    once done you can create office 365 connector and when you open ARM template you can see o365 component in the ARM template. My template looks like :-

    {
      "type": "MICROSOFT.WEB/CONNECTIONS",
      "apiVersion": "2016-06-01",
      "name": "[parameters('office365_1_Connection_Name')]",
      "location": "[parameters('location')]",
      "properties": {
        "api": {
          "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('location'), '/managedApis/', 'office365')]"
        },
        "displayName": "[parameters('office36`enter code here`5_1_Connection_DisplayName')]"
      }
    }
    

    and inside workflow

    "triggers": {
                "When_a_new_event_is_created_(V2)": {
                  "type": "ApiConnection",
                  "inputs": {
                    "host": {
                      "connection": {
                        "name": "@parameters('$connections')['office365']['connectionId']"
                      }
                    },
                    "method": "get",
                    "path": "/datasets/calendars/v2/tables/@{encodeURIComponent(encodeURIComponent('AAMkNbPwESLK3F8s5n1Q3BwAhXXXXXXXXXXXXXXXXXXXXXXXXXXX'))}/onnewitems"
                  },
                  "recurrence": {
                    "frequency": "Minute",
                    "interval": 1
                  },
                  "splitOn": "@triggerBody()?['value']"
                }
              }
    

    ================================================================ And the parameters for workflow

    "parameters": {
              "$connections": {
                "value": {
                  "office365": {
                    "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('location'), '/managedApis/', 'office365')]",
                    "connectionId": "[resourceId('Microsoft.Web/connections', parameters('office365_1_Connection_Name'))]",
                    "connectionName": "[parameters('office365_1_Connection_Name')]"
                  }
    

    ================================================================

    0 讨论(0)
提交回复
热议问题