如何将特定参数传递给 Azure 资源模板?

问题描述

我正在使用 Azure 资源模板来创建 (Get-Content -Path $fileName -Encoding UTF8) -replace "(?<=(?:^|\t)DEF_)apple","orange" | Set-Content -Path $fileName 资源类型。 这是模板中包含的相关资源:

Microsoft.Web/connections

资源已正确部署,但当我到达门户时,我看到以下错误

Error on azure

当我以下列形式手动输入缺失的信息时,错误消失:

enter image description here

我的问题是:如何直接在资源模板中传递这些信息?

解决方法

我找到了解决方案。 Azure Resource Template 使用 Azure Resource Rest Api 在云上配置资源。

我发现 this article 在谈论 Logic Apps & API connectors using ARM 时指出 this tool 为您提供 API 调用允许的参数。

我的资源模板现在看起来像这样:

{
  "type": "Microsoft.Web/connections","apiVersion": "2016-06-01","name": "azurequeues","location": "[resourceGroup().location]","kind": "V1","properties": {
    "displayName": "[parameters('queue-storage-name')]","api": {
      "id": "[concat('/subscriptions/',parameters('subscription-id'),'/providers/Microsoft.Web/locations/',resourceGroup().location,'/managedApis/','azurequeues')]"
    },"parameterValues": {
      "storageaccount": "[parameters('storage-account-name')]","sharedkey": "[parameters('storage-account-shared-key')]"
    }
  }
}