gpt4 book ai didi

powershell - 如何通过 PowerShell 或模板将 Azure 混合连接链接到 Azure Web 应用?

转载 作者:行者123 更新时间:2023-12-04 01:23:37 26 4
gpt4 key购买 nike

有没有办法以自动方式将混合连接添加到 Azure Web 应用程序? (通过 PowerShell 或资源模板,甚至是对 Azure API 的 REST 调用?)

目前,我有一个使用资源管理器模板部署的 Azure Web 应用程序,并且所有内容都已正确配置,但是我无法弄清楚如何将 Web 应用程序链接到模板中现有的 BizTalk 混合连接或通过 PowerShell(某种自动化方式)。

Azure Web App Hybrid Connection

最佳答案

现在可以使用 Microsoft.Web sites/hybridConnectionNamespaces/relays 在 Azure 资源管理器 (ARM) 模板中完成此操作。模板引用。

这是一个简短的示例,展示了它的样子。

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"resources": [
{
"apiVersion": "2019-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('appName'))]"
],
"name": "[concat(variables('relayName'), '/', parameters('hybridConnectionName'))]",
"properties": {
"hostname": "[split(json(reference(variables('hybridConnectionResourceId'), '2017-04-01').userMetadata)[0].value, ':')[0]]",
"port": "[split(json(reference(variables('hybridConnectionResourceId'), '2017-04-01').userMetadata)[0].value, ':')[1]]",
"relayArmUri": "[variables('hybridConnectionResourceId')]",
"relayName": "[parameters('hybridConnectionName')]",
"sendKeyName": "[parameters('hybridConnectionSendKeyName')]",
"sendKeyValue": "[listkeys(concat(variables('hybridConnectionResourceId'), '/authorizationRules/defaultSender'), '2017-04-01').primaryKey]",
"serviceBusNamespace": "[variables('relayName')]"
},
"tags": {
"displayName": "hc-some-name"
},
"type": "hybridConnectionNamespaces/relays"
}
]
}
]
}

关于powershell - 如何通过 PowerShell 或模板将 Azure 混合连接链接到 Azure Web 应用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34503638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com