azure - 使用 ARM 模板通过服务主体身份验证为 Azure 数据工厂创建 API 连接

标签 azure azure-resource-manager azure-logic-apps

我创建了一个使用 Azure 数据工厂连接器的逻辑应用。

我可以从门户创建具有服务主体身份验证的 API 连接:

enter image description here

但我找不到任何有关如何使用 ARM 模板创建 API 连接的文档。

但我需要使用具有相同服务主体身份验证的 ARM 模板进行创建。

最佳答案

您可以使用 ARM 模板为 Azure 数据工厂创建 API 连接,如下所示:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "connectionAPIName": {
      "type": "string"
    },
    "clientId": {
      "type": "string"
    },
    "clientSecret": {
      "type": "securestring"
    }
  },
  "resources": [
    {
      "type": "Microsoft.Web/connections",
      "apiVersion": "2018-07-01-preview",
      "name": "[parameters('connectionAPIName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "displayName": "[parameters('connectionAPIName')]",
        "parameterValues": {
          "token:clientId": "[parameters('clientId')]",
          "token:clientSecret": "[parameters('clientSecret')]",
          "token:TenantId": "[subscription().tenantId]",
          "token:grantType": "client_credentials"
        },
        "api": {
          "id": "[concat('subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/azuredatafactory')]"
        }
      }
    }
  ],
  "outputs": {}
}

关于azure - 使用 ARM 模板通过服务主体身份验证为 Azure 数据工厂创建 API 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57889261/

相关文章:

azure - 如何使用 Bicep 为所有 api 配置 APIM 的诊断设置

powershell - 使用 Powershell 的 Azure 资源管理器 IP 安全限制

适用于逻辑应用的 Azure API 管理反向代理

azure - 如何在逻辑应用 HTTP 触发器/操作上启用“即发即忘”/异步模式?

azure - 应用程序网关,具有隔离的应用程序服务环境和 Web 应用程序

Azure 数据工厂 V2 - 发送自定义电子邮件(无逻辑应用)

azure - facebook 或 google 登录时 Aspnetcore 关联失败,确认电子邮件时 token 无效

Azure 应用服务 - 对 VNET 服务的调用不起作用

azure 二头肌 : get array out of an array of objects

azure - 如何使用逻辑应用程序中的 API 管理操作将正文参数传递给 API Post 操作?