首页 > 解决方案 > In Azure Logic Apps ARM template, what are the possible values for the AuthType property for a SQL Server connector using On-Premise Data Gateway?

问题描述

I have an Azure Logic App with a SQL Server connector through a On-Premise Data Gateway, the connection is made using SQL Server Authentication. It works fine from the Logic App Designer.

enter image description here

No details about the connection are stored in the ARM template of the SQL Server connection, so if I want to automate the deployment of the Logic App, I need to add some values to the ARM template. The documentation for this is really poor, even though I was able to write this template:

{
  "type": "MICROSOFT.WEB/CONNECTIONS",
  "apiVersion": "2018-07-01-preview",
  "name": "[parameters('sql_2_Connection_Name')]",
  "location": "[parameters('logicAppLocation')]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sql')]"
    },
    "displayName": "[parameters('sql_2_Connection_DisplayName')]",
    "parameterValues": {
      "server": "[parameters('sql_2_server')]",
      "database": "[parameters('sql_2_database')]",
      "username": "[parameters('sql_2_username')]",
      "password": "[parameters('sql_2_password')]",
      "authType": "[parameters('sql_2_authtype')]",
      "sqlConnectionString": "[parameters('sql_2_sqlConnectionString')]",
      "gateway": {
        "id": "[concat('subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('dataGatewayResourceGroup'), '/providers/Microsoft.Web/connectionGateways/', parameters('dataGatewayName'))]"
      }
    }
  }
}

But I can't find the correct value for the authType property corresponding to "SQL Server Authentication". The values windows and basic are accepted, but couldn't find the value for "SQL Server Authentication".

Can someone please tell me what's the value for the authType property corresponding to "SQL Server Authentication"?

标签: sql-serverazureazure-logic-appsarm-template

解决方案


Use following properties json inside your web api connection

"properties": {
    "api": {
      "id": "/subscriptions/<YourSubscriptionIDHere>/providers/Microsoft.Web/locations/australiaeast/managedApis/sql"
    },
    "parameterValueSet": {
      "name": "sqlAuthentication",
      "values": {
        "server": {
          "value": "SampleServer"
        },
        "database": {
          "value": "WideWorldImporters"
        },
        "username": {
          "value": "sampleuser"
        },
        "password": {
          "value": "somepasssword"
        },
        "gateway": {
          "value": {
            "id": "/subscriptions/<subscriptionIDGoesHere>/resourceGroups/az-integration-study-rg/providers/Microsoft.Web/connectionGateways/<NameofTheGatewayHere>"
          }
        }
      }
    }
  },
  "location": "australiaeast"

That should do the trick


推荐阅读