title: Getting callback url for logic app in ARM
body: <p>I'm deploying an ARM template, which includes:
  azure functions + logic apps.</p>
  
  <p>Following <a href="https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/logic-apps/logic-apps-scenario-function-sb-trigger.md" rel="noreferrer">link</a> i've created a simple flow:
  one of method from azure functions calls logic app. Let's name the method as "A". The logic app as "B":</p>
  
  <p>A calls B.</p>
  
  <p>The logic app (B) contains "callback URL". Method (A) needs to have a callback url to the logic app (B). I need to set up this variable by "copy" this value:</p>
  
  <p><a href="https://i.stack.imgur.com/bEBWo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bEBWo.png" alt="enter image description here"></a></p>
  
  <p>And in my azure app function I need to set this value as application setting.</p>
  
  <p>Right now, my ARM looks (more and less) like that:</p>
  
  <pre><code>{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
      //(...)
    },
    "variables": {
      //(...)
    },
    "resources": [
      {
        "type": "Microsoft.Storage/storageAccounts",
        //(...)
      },
      {
        "type": "Microsoft.Web/serverfarms",
        //(...)
      },
      {
        "apiVersion": "2015-08-01",
        "type": "Microsoft.Web/sites",
        "name": "[variables('functionAppName')]",
        "location": "[resourceGroup().location]",
        "kind": "functionapp",
        "dependsOn": [
          "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
          "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
        ],
        "resources": [
          {
            "apiVersion": "2015-08-01",
            "name": "web",
            "type": "sourcecontrols",
            "dependsOn": [
              "[resourceId('Microsoft.Web/Sites', variables('functionAppName'))]"
            ],
            "properties": {
              "RepoUrl": "[parameters('repoURL')]",
              "branch": "[variables('branch')]",
              "IsManualIntegration": true
            }
          }
        ],
        "properties": {
          "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
          "siteConfig": {
            "appSettings": [
              {
                "name": "AzureWebJobsDashboard",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
              },
              //next my app settings
            ]
          }
        }
      },
      {
        "name": "[variables('logicAppName')]",
        "type": "Microsoft.Logic/workflows",
        "location": "[resourceGroup().location]",
        "apiVersion": "2016-06-01",
        "dependsOn": [
          "[resourceId('Microsoft.Web/connections', variables('servicebusConnectionName'))]",
          "[resourceId('Microsoft.Web/sites/sourcecontrols', variables('functionAppName'), 'web')]"
        ],
        "tags": {
          "displayName": "order-create"
        },
        "properties": {
          "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
              //(...)
            },
            "parameters": {
              "$connections": {
                "defaultValue": {},
                "type": "Object"
              }
            },
            "triggers": {
              "manual": {
                "type": "Request",
                "kind": "Http",
                "inputs": {
                  "schema": {}
                }
              }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {}
          },
          "parameters": {
            "$connections": {
              "value": {
                "servicebus": {
                  "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'servicebus')]",
                  "connectionId": "[resourceId('Microsoft.Web/connections', variables('servicebusConnectionName'))]",
                  "connectionName": "[variables('servicebusConnectionName')]"
                }
              }
            }
          }
        }
      },
      {
        "type": "MICROSOFT.WEB/CONNECTIONS",
        "apiVersion": "2016-06-01",
        "name": "[variables('servicebusConnectionName')]",
        "location": "[resourceGroup().location]",
        "properties": {
          "api": {
            "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'servicebus')]"
          },
          "displayName": "[parameters('servicebus_1_Connection_DisplayName')]",
          "parameterValues": {
            "connectionString": "[parameters('servicebus_1_connectionString')]"
          }
        }
      }
    ],
    "outputs": {}
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>It's possible to enforce logic app "callbackUrl" during deployment?</li>
  <li>It's possible to get the 'logic app' callback URL after deploying the logic app and set the "app settings" in azure functions?</li>
  <li>If not - do I need to write a powershell script to work on that?</li>
  <li>How can I access this value from resources manager?</li>
  </ol>
  
  <p>I see "accessEndpoint" in path:
  <a href="https://management.azure.com/subscriptions/" rel="noreferrer">https://management.azure.com/subscriptions/</a><strong>{subscriptionId}</strong>/resourceGroups/<strong>{resourceGroupName}</strong>/providers/Microsoft.Logic/workflows/<strong>{logicAppName}</strong>?api-version=2016-06-01</p>
  
  <p>but once i use this value in my app settings i have access denied.</p>
  
  <p>Callback URL from logic app site looks familiar to:
  https://{server}.logic.azure.com:443/workflows/<strong>{workflow}</strong>/runs/<strong>{someid}</strong>/contents/TriggerInputs?api-version=2016-06-01&amp;se=2017-10-30T13%3A34%3A27.3219438Z&amp;sp=%2Fruns%2<strong>someid2</strong>%2Fcontents%2FTriggerInputs%2Fread&amp;sv=1.0&amp;sig=<strong>{someid3}</strong></p>