我正在部署一个 ARM 模板,其中包括:
天蓝色函数+逻辑应用程序。
下列的link https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/logic-apps/logic-apps-scenario-function-sb-trigger.md我创建了一个简单的流程:
azure 函数中的方法之一调用逻辑应用程序。我们将该方法命名为“A”。逻辑应用程序为“B”:
A 打电话给 B。
逻辑应用 (B) 包含“回调 URL”。方法 (A) 需要具有逻辑应用 (B) 的回调 URL。我需要通过“复制”这个值来设置这个变量:
在我的天蓝色应用程序功能中,我需要将此值设置为应用程序设置。
现在,我的 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函数中设置“应用程序设置”后是否可以获取“逻辑应用程序”回调URL?
- 如果没有 - 我是否需要编写一个 powershell 脚本来解决这个问题?
- 如何从资源管理器访问该值?
我在路径中看到“accessEndpoint”:https://management.azure.com/subscriptions/ https://management.azure.com/subscriptions/{订阅ID}/资源组/{资源组名称}/providers/Microsoft.Logic/workflows/{logicAppName}?api-版本=2016-06-01
但是一旦我在应用程序设置中使用此值,我的访问就会被拒绝。
来自逻辑应用网站的回调 URL 看起来很熟悉:
https://{服务器}.logic.azure.com:443/workflows/{工作流程}/runs/{someid}/contents/TriggerInputs?api-version=2016-06-01&se=2017-10-30T13%3A34%3A27.3219438Z&sp=%2Fruns%2someid2%2Fcontents%2FTriggerInputs%2Fread&sv=1.0&sig={someid3}