繁体   English   中英

在Azure Logic App API连接上使用Azure密钥保管库

[英]Using Azure Key vault on Azure Logic App API Connection

我在Azure逻辑应用程序上使用过Azure密钥保险库。 但是我无法访问Azure Logic APP API Connection的值。 基本上,我必须从Azure Key保管库获取SQL连接器的用户名和密码。 如果您可以提出建议,我们将如何实现这一目标。 在此处输入图片说明

据我所知,Azure逻辑应用程序无法访问门户网站api连接中的密钥库。 如果要访问密钥库,则可以使用rest api对其进行访问。 您需要在逻辑应用程序中启用msi(下面的链接显示我们可以在“工作流程设置”中进行msi修改,但是当前它已更改,我们需要在逻辑应用程序的“ Identity”刀片中启用它)并使用http操作访问您的密钥库。

您可以参考此链接以获取更多信息: https : //devkimchi.com/2018/10/24/accessing-key-vault-from-logic-apps-with-managed-identity/

创建连接API后,将不会输出任何敏感信息。
使用ARM模板,您可以创建一个API连接,但是当您旋转凭据时它不会更新连接详细信息,您必须重新部署该模板。

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "sqlConnectionAPIName": {
      "type": "string",
      "metadata": {
        "description": "The name of the connection api to access the service bus namepsace."
      }
    },
    "sqlserverName": {
      "type": "string",
      "metadata": {
        "description": "The Name of the SQL Server instance."
      }
    },
    "databaseName": {
      "type": "string",
      "metadata": {
        "description": "The name of the database."
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "type": "Microsoft.Web/connections",
      "name": "[parameters('sqlConnectionAPIName')]",
      "apiVersion": "2018-07-01-preview",
      "location": "[resourceGroup().location]",
      "scale": null,
      "properties": {
        "displayName": "[parameters('sqlConnectionAPIName')]",
        "parameterValues": {
          "server": "[reference(resourceId('Microsoft.Sql/servers', parameters('sqlserverName')), '2015-05-01-preview').fullyQualifiedDomainName]",
          "database": "[parameters('databaseName')]",
          "username": "[reference(resourceId('Microsoft.Sql/servers', parameters('sqlserverName')), '2015-05-01-preview').administratorLogin]",
          "password": "[reference(resourceId('Microsoft.Sql/servers', parameters('sqlserverName')), '2015-05-01-preview').administratorLoginPassword]"
        },
        "api": {
          "id": "[concat('subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/sql')]"
        }
      },
      "dependsOn": []
    }
  ]
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM