将消费逻辑应用迁移到标准版 [英] Migrate Consumption Logic App to Standard

查看:21
本文介绍了将消费逻辑应用迁移到标准版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是this question

的后续内容 该答案涵盖了基本情况,但如果工作流包括对SQL Server的数据库访问(至少我发现是这样),则不起作用。此外,Standard中唯一提供的SQL Server操作是EXECUTE QUERY,这与消耗相比有很大的不同

到目前为止,我还找不到任何方法来实现此迁移,而不需要手动重新编码工作流-既耗时又有风险,需要进行广泛的回归测试

推荐答案

就像我在另一个线程中提到的那样,它确实可以工作,但几乎不需要做任何更改。

此外,Standard中提供的唯一SQL Server操作是EXECUTE QUERY,这与消耗相比有很大的不同。

SQL Server在内置连接器中不可用,但在Azure连接器中可用。以下屏幕截图供您参考:

该答案涵盖基本情况,但如果工作流包括对SQL Server的数据库访问(至少我发现是这样),则不起作用。

一种解决方法是,您只需在SQL连接器的代码视图中进行少量更改即可使连接器工作。请考虑下面的代码视图。

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Get_rows_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['sql_1']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables/@{encodeURIComponent(encodeURIComponent('[dbo].[STATION]'))}/items"
                },
                "runAfter": {},
                "type": "ApiConnection"
            },
            "Get_tables_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['sql_1']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables"
                },
                "runAfter": {
                    "Get_rows_(V2)": [
                        "Succeeded"
                    ]
                },
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "manual": {
                "inputs": {
                    "schema": {}
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "sql_1": {
                    "connectionId": "/subscriptions/<Your suscription>/resourceGroups/<Your resource group>/providers/Microsoft.Web/connections/sql-4",
                    "connectionName": "sql-4",
                    "id": "/subscriptions/<Your suscription>/providers/Microsoft.Web/locations/northcentralus/managedApis/sql"
                }
            }
        }
    }
}

下面是您需要在逻辑中设置的更改。

  • 删除参数{},即..

    "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
    
    "parameters": {
        "$connections": {
            "value": {
                "sql_1": {
                    "connectionId": "/subscriptions/<Your suscription>/resourceGroups/<Your resource group>/providers/Microsoft.Web/connections/sql-4",
                    "connectionName": "sql-4",
                    "id": "/subscriptions/<Your suscription>/providers/Microsoft.Web/locations/northcentralus/managedApis/sql"
                }
            }
        }
    }
    
  • 将GET_ROWS_(V2)和GET_TABLES_(V2)中的"connection": {"name": "@parameters('$connections')['sql_1']['connectionId']"}替换为"connection": {"referenceName": "sql"}

  • 在末尾添加您的工作流程类型,即"kind": "Stateful"

更改后,下面是我的逻辑应用程序的代码视图

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Get_rows_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "sql"
                        }
                    },
                    "method": "get",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables/@{encodeURIComponent(encodeURIComponent('[dbo].[STATION]'))}/items"
                },
                "runAfter": {},
                "type": "ApiConnection"
            },
            "Get_tables_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "sql"
                        }
                    },
                    "method": "get",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables"
                },
                "runAfter": {
                    "Get_rows_(V2)": [
                        "Succeeded"
                    ]
                },
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "manual": {
                "inputs": {
                    "schema": {}
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateful"
}

这篇关于将消费逻辑应用迁移到标准版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆