这是this question的后续节目。
这个答案涵盖了一个基本的情况,但如果工作流包括SQL Server的DB访问(至少我发现了这一点),则不起作用。此外,标准中提供的惟一SQL Server操作是Execute查询,这是对消费的显著改进
到目前为止,我还没有找到任何方法来实现这种迁移,而不需要手动重新编码工作流既耗时又有风险,因此需要进行广泛的回归测试。
发布于 2021-11-16 08:05:53
正如我在另一个线程中提到的,它确实工作,但是很少需要进行更改。
此外,标准中唯一提供的Server操作是Execute查询,这是对消费的显著改进。
Server在内置连接器中不可用,但在Azure连接器中可用。以下是供您参考的截图:

回答了一个基本的情况,但如果工作流包括对Server的DB访问(至少这是我所发现的),则不起作用。
一个解决办法是,为了使连接器正常工作,您需要对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"
}
}
}
}
}下面是您需要在逻辑中设置的更改。
“参数”:{ "$connections":{ "defaultValue":{},"type":"Object“},
“参数”:{ "$connections":{“$connections”:{ "sql_1":{ "connectionId":connectionName:"sql-4","id":"/subscriptions//providers/Microsoft.Web/locations/northcentralus/managedApis/sql“}
"connection": {"referenceName": "sql"}取代
"connection": {"name": "@parameters('$connections')['sql_1']['connectionId']"}和Get_tables_(V2)"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"
}https://stackoverflow.com/questions/69939602
复制相似问题