ARM template for creating API connection to On-Premise SQL

Published Jun 09 2020 08:41 AM 3,420 Views
Senior Member

Scenario:

ARM template definition for creating connection to on-premise SQL server from Logic Apps.

ARM Definition:

This can be tweaked according to how you define parameters in parameters file.

Here the possible authentication modes for SQL are :

Windows authentication: Authtype - Windows

SQL server authentication: Authtype- basic

  {

   "type": "Microsoft.Web/connections",

   "apiVersion": "2018-07-01-preview",

   "name": "[parameters('sql_1_Connection_Name')]",

   "location": "[parameters('logicAppLocation')]",

   "properties": {

    "displayName": "[parameters('sql_1_Connection_DisplayName')]",

    "customParameterValues": {},

    "api": {

     "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sql')]"

    },

    "parameterValues": {

     "server": "[parameters('sql_1_server')]",

     "database": "[parameters('sql_1_database')]",

     "username": "[parameters('sql_1_username')]",

     "password": "[parameters('sql_1_password')]",

     "authType": "basic",

     "gateway": {

      "id": "/subscriptions/{{subscriptionId}}/resourceGroups/{{reosurceGroupName}}/providers/Microsoft.Web/connectionGateways/{{On-Premise DatagatewayName}}"

     }

    }

%3CLINGO-SUB%20id%3D%22lingo-sub-1450911%22%20slang%3D%22en-US%22%3EARM%20template%20for%20creating%20API%20connection%20to%20On-Premise%20SQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450911%22%20slang%3D%22en-US%22%3E%3CH3%20id%3D%22toc-hId-1172063292%22%20id%3D%22toc-hId-1172087383%22%3EScenario%3A%3C%2FH3%3E%0A%3CP%3EARM%20template%20definition%20for%20creating%20connection%20to%20on-premise%20SQL%20server%20from%20Logic%20Apps.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--635391171%22%20id%3D%22toc-hId--635367080%22%3EARM%20Definition%3A%3C%2FH3%3E%0A%3CP%3EThis%20can%20be%20tweaked%20according%20to%20how%20you%20define%20parameters%20in%20parameters%20file.%3C%2FP%3E%0A%3CP%3EHere%20the%20possible%20authentication%20modes%20for%20SQL%20are%20%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWindows%20authentication%3C%2FSTRONG%3E%3A%20Authtype%20-%20Windows%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESQL%20server%20authentication%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAuthtype-%20basic%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%22type%22%3A%20%22Microsoft.Web%2Fconnections%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%22apiVersion%22%3A%20%222018-07-01-preview%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%22name%22%3A%20%22%5Bparameters('sql_1_Connection_Name')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%22location%22%3A%20%22%5Bparameters('logicAppLocation')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%22properties%22%3A%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22displayName%22%3A%20%22%5Bparameters('sql_1_Connection_DisplayName')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22customParameterValues%22%3A%20%7B%7D%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22api%22%3A%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22id%22%3A%20%22%5Bconcat(subscription().id%2C%20'%2Fproviders%2FMicrosoft.Web%2Flocations%2F'%2C%20parameters('logicAppLocation')%2C%20'%2FmanagedApis%2F'%2C%20'sql')%5D%22%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22parameterValues%22%3A%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22server%22%3A%20%22%5Bparameters('sql_1_server')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22database%22%3A%20%22%5Bparameters('sql_1_database')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22username%22%3A%20%22%5Bparameters('sql_1_username')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22password%22%3A%20%22%5Bparameters('sql_1_password')%5D%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22authType%22%3A%20%22%3CSTRONG%3E%3CEM%3Ebasic%3C%2FEM%3E%3C%2FSTRONG%3E%22%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22gateway%22%3A%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22id%22%3A%20%22%2Fsubscriptions%2F%3CSTRONG%3E%7B%7BsubscriptionId%7D%7D%3C%2FSTRONG%3E%2FresourceGroups%2F%3CSTRONG%3E%7B%7BreosurceGroupName%7D%7D%3C%2FSTRONG%3E%2Fproviders%2FMicrosoft.Web%2FconnectionGateways%2F%3CSTRONG%3E%7B%7BOn-Premise%20DatagatewayName%7D%7D%3C%2FSTRONG%3E%22%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1450911%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22introducingazurelogicapps_960.jpg%22%20style%3D%22width%3A%20960px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197560iC66D6F4C7D64B533%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22introducingazurelogicapps_960.jpg%22%20alt%3D%22introducingazurelogicapps_960.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EARM%20template%20for%20creating%20API%20connection%20to%20On-Premise%20SQL%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Version history
Last update:
‎Jun 09 2020 08:41 AM
Updated by: