azure – 获取ARM中逻辑应用程序的回调URL

我正在部署一个ARM模板,其中包括:
天蓝色功能逻辑应用程序.

link之后我创建了一个简单的流程:
来自azure函数的方法之一调用逻辑应用程序.我们将方法命名为“A”.逻辑应用程序为“B”:

一个电话B.

逻辑应用程序(B)包含“回调URL”.方法(A)需要有一个回调URL到逻辑应用程序(B).我需要通过“复制”这个值来设置这个变量:

enter image description here

在我的azure app功能中,我需要将此值设置为应用程序设置.

现在,我的ARM看起来(越来越少)像这样:

{
  "$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": {}
}

我的问题是:

>在部署期间可以强制执行逻辑应用程序“callbackUrl”吗?
>在部署逻辑应用程序并在azure函数中设置“app settings”后,可以获得“逻辑应用程序”回调URL吗?
>如果不是 – 我是否需要编写一个PowerShell脚本来处理它?
>如何从资源管理器访问此值?

我在路径中看到“accessEndpoint”:
https://management.azure.com/subscriptions/ {subscriptionId} / resourceGroups / {resourceGroupName} /providers/Microsoft.Logic/workflows/ {logicAppName}?API-版本= 2016年6月1日

但是一旦我在我的应用设置中使用此值,我就会拒绝访问.

来自逻辑应用程序站点的回调URL看起来很熟悉:
HTTPS:// {服务器} .logic.azure.com:443 /工作流/ {工作流} /运行/ {someid} /内容/ TriggerInputs API-版本= 2016年6月1日和安培; SE = 2017-10-30T13?: 34:27.3219438Z&安培; SP = /运行%2someid2 /内容/ TriggerInputs /读取&安培; SV = 1.0&安培; SIG = {someid3}

由于您在ARM中询问如何执行此操作,因此以下解决方案假设LA具有名为manual的触发器:

listCallbackUrl(resourceId('resource-group-name','Microsoft.Logic/workflows', 'logic-app-name', 'manual'), '2016-06-01').value

如果要将逻辑应用程序和功能应用程序部署到同一资源组,则可以排除资源组名称.

以下是将回调Url添加到函数设置的方法:

{ 
  "type": "Microsoft.Web/sites",
  "kind": "functionapp",
  "name": "[variables('function_app_name')]",
  "apiVersion": "2016-08-01",
  "location": "[resourceGroup().location]",
  "identity": { "type": "SystemAssigned" },
  "properties": {
    "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('function_hosting_plan_name'))]",
    "siteConfig":
    {
      "alwaysOn": true,
      "appSettings": [
        {
          "name": "Logic_App_Url",
          "value": "[listCallbackUrl(resourceId('resource-group-name','Microsoft.Logic/workflows/triggers', 'logic-app-name', 'manual'), '2016-06-01').value]"
        }
      ]
    },
    "resources": [
      {
        "apiVersion": "2015-08-01",
        "name": "appsettings",
        "type": "config",
        "dependsOn": [
          "[resourceId('Microsoft.Storage/storageAccounts', variables('storage_account_name'))]",
          "[resourceId('Microsoft.Web/Sites', variables('function_app_name'))]"
        ],
        "properties": {
          "Logic_App_Url": "[listCallbackUrl(resourceId('resource-group-name','Microsoft.Logic/workflows/triggers', 'logic-app-name', 'manual'), '2016-06-01').value]"
        }
      }
    ]
  }
}
本站公众号
   欢迎关注本站公众号,获取更多程序园信息
开发小院