gpt4 book ai didi

azure - 使用 azure 逻辑应用将数据从 azure 数据湖迁移到 azure sql

转载 作者:行者123 更新时间:2023-12-03 06:08:17 29 4
gpt4 key购买 nike

enter image description here

我需要创建一个逻辑应用程序,我的要求是,我需要从 azure data Lake Gen2 文件夹迁移 json 文件,并根据某些值需要将该 json 转换为 xml,然后将其发送到 SQL。

因此,根据我的要求,我尝试了如图所示的工作流程,但我不确定我的方法是错误还是正确。

您能否通过提供详细的触发器和操作图像和表达式来提供详细的 Azure 逻辑应用工作流程结构以满足我的要求。

任何早期和详细的回复将不胜感激。

最佳答案

我已在我的环境中重现,以下是预期结果:

输入:

{
"UserID":88888,
"FirstName":"Rithwik",
"LastName":"Bojja",
"Email":"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f7859e839f809e9cb79a969e9bd994989a" rel="noreferrer noopener nofollow">[email protected]</a>"
}

enter image description here

Azure 存储帐户中的文件:

enter image description here

设计:

enter image description here

然后:

enter image description here

输出:

enter image description here

复制的代码 View :

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Get_blob_content_(V2)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "get",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/files/@{encodeURIComponent(encodeURIComponent('JTJmcml0aHdpayUyZnRlc3R0Lmpzb24='))}/content",
"queries": {
"inferContentType": true
}
},
"metadata": {
"JTJmcml0aHdpayUyZnRlc3R0Lmpzb24=": "/rithwik/testt.json"
},
"runAfter": {},
"type": "ApiConnection"
},
"Insert_row_(V2)": {
"inputs": {
"body": {
"Email": "@body('Parse_JSON')?['Email']",
"FirstName": "@body('Parse_JSON')?['FirstName']",
"LastName": "@body('Parse_JSON')?['LastName']",
"UserID": "@body('Parse_JSON')?['UserID']"
},
"host": {
"connection": {
"name": "@parameters('$connections')['sql']['connectionId']"
}
},
"method": "post",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables/@{encodeURIComponent(encodeURIComponent('[dbo].[Users]'))}/items"
},
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Parse_JSON": {
"inputs": {
"content": "@json( body('Get_blob_content_(V2)'))",
"schema": {
"properties": {
"Email": {
"type": "string"
},
"FirstName": {
"type": "string"
},
"LastName": {
"type": "string"
},
"UserID": {
"type": "integer"
}
},
"type": "object"
}
},
"runAfter": {
"Get_blob_content_(V2)": [
"Succeeded"
]
},
"type": "ParseJson"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"azureblob": {
"connectionId": "/subscriptions/b83c1ed3/resourceGroups/rbojja/providers/Microsoft.Web/connections/azureblob",
"connectionName": "azureblob",
"id": "/subscriptions/b83c1ed3/providers/Microsoft.Web/locations/eastus/managedApis/azureblob"
},
"sql": {
"connectionId": "/subscriptions/b83c1ed3/resourceGroups/rbojja/providers/Microsoft.Web/connections/sql",
"connectionName": "sql",
"id": "/subscriptions/b83c1ed3/providers/Microsoft.Web/locations/eastus/managedApis/sql"
}
}
}
}
}

关于azure - 使用 azure 逻辑应用将数据从 azure 数据湖迁移到 azure sql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77083241/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com