簡體   English   中英

如何使用ARM(Azure資源管理器)部署具有SQL執行sp動作的Logic APP

[英]How to deploy Logic APP that has SQL execute sp action using ARM( Azure Resource manager)

我想使用ARM部署Logic APP。 該邏輯APP具有“ SQL Execute SP”操作。 我在azure博客上發現了一些快速入門模板。 但是它們都不包含“ SQL Execute SP”操作的操作。

Logic Apps的ARM部署允許您定義App Service Plan和Logic App容器,但不允許您部署整個Logic App。 現在,您可以從Azure Web門戶( https://portal.azure.com/ )設計/部署,也可以僅從Visual Studio構建/部署

這是ARM模板,其中包含來自另一個stackoverflow問題的 SQL操作

感謝Harry分享

resources:
[
  {
    "type": "Microsoft.Web/connections",
    "apiVersion": "2015-08-01-preview",
    "location": "[resourceGroup().location]",
    "name": "sqlconnector",
    "properties": {
      "api": {
        "id": "[concat('subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/sql')]"
      },
      "displayName": "sqlconnector",
      "parameterValues": {
        "sqlConnectionString": "<sql db connection string>"
      }
    }
  },
  {
    "type": "Microsoft.Logic/workflows",
    "apiVersion": "2015-08-01-preview",
    "name": "[parameters('logicAppName')]",
    "location": "[resourceGroup().location]",
    "tags": {
      "displayName": "LogicApp"
    },
    "properties": {
      "sku": {
        "name": "[parameters('workflowSkuName')]",
        "plan": {
          "id": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('svcPlanName'))]"
        }
      },
      "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2015-08-01-preview/workflowdefinition.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
          "$connections": {
            "defaultValue": { },
            "type": "Object"
          }
        },
        "triggers": {
          "recurrence": {
            "type": "recurrence",
            "recurrence": {
              "frequency": "Hour",
              "interval": 1
            }
          }
        },
        "actions": {
          "Execute_stored_procedure": {
            "conditions": [ ],
            "inputs": {
              "body": null,
              "host": {
                "api": {
                  "runtimeUrl": "[concat('https://logic-apis-', resourceGroup().location, '.azure-apim.net/apim/sql')]"
                },
                "connection": {
                  "name": "@parameters('$connections')['sql']['connectionId']"
                }
              },
              "method": "post",
              "path": "/datasets/default/procedures/@{encodeURIComponent(encodeURIComponent(string('[dbo].[<Stored Proc Name>]')))}"
            },
            "type": "apiconnection"
          }
        },
        "outputs": { }
      },
      "parameters": {
        "$connections": {
          "value": {
            "sql": {
              "connectionId": "[resourceId('Microsoft.Web/connections', 'sqlconnector')]",
              "connectionName": "sqlconnector",
              "id": "[reference(concat('Microsoft.Web/connections/', 'sqlconnector'), '2015-08-01-preview').api.id]"
            }
          }
        }
      }
    }
  }
]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM