首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将消费逻辑应用程序移植到标准

将消费逻辑应用程序移植到标准
EN

Stack Overflow用户
提问于 2021-11-12 08:00:54
回答 1查看 744关注 0票数 0

这是this question的后续节目。

这个答案涵盖了一个基本的情况,但如果工作流包括SQL Server的DB访问(至少我发现了这一点),则不起作用。此外,标准中提供的惟一SQL Server操作是Execute查询,这是对消费的显著改进

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-16 08:05:53

正如我在另一个线程中提到的,它确实工作,但是很少需要进行更改。

此外,标准中唯一提供的Server操作是Execute查询,这是对消费的显著改进。

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

回答了一个基本的情况,但如果工作流包括对Server的DB访问(至少这是我所发现的),则不起作用。

一个解决办法是,为了使连接器正常工作,您需要对Sql的代码视图进行很少的更改。请考虑下面的代码视图。

代码语言:javascript
复制
{
    "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"
                }
            }
        }
    }
}

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

  • 删除参数{}i.

“参数”:{ "$connections":{ "defaultValue":{},"type":"Object“},

“参数”:{ "$connections":{“$connections”:{ "sql_1":{ "connectionId":connectionName:"sql-4","id":"/subscriptions//providers/Microsoft.Web/locations/northcentralus/managedApis/sql“}

"connection": {"referenceName": "sql"}取代

  • 在Get_rows_(V2)中的"connection": {"name": "@parameters('$connections')['sql_1']['connectionId']"}和Get_tables_(V2)

  • 在最后添加了您的工作流类型,即.."kind": "Stateful"

下面是我的逻辑应用程序的代码视图。

代码语言:javascript
复制
{
    "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"
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69939602

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档