使用 Azure 逻辑应用程序将来自 HTTP 的响应保存到 Blob 存储

Save the Response from HTTP to Blob Storage using Azure Logic App

是否可以在使用 Azure 逻辑应用程序时将 HTTP 请求(第一步)的响应保存到 Blob 存储(第二步)中。

谢谢。

假设你没有特殊情况,是的,你肯定可以将Request内容保存到Blob中。任何内容真的。

您将从创建 Blob 操作开始,将触发主体指定为内容。

别想太多了,这和保存到本地文件是一样的模式。

是的,您可以使用 HttpCreate blob 任务来实现。

代码

{
    "$connections": {
        "value": {
            "azureblob": {
                "connectionId": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/connections/azureblob",
                "connectionName": "azureblob",
                "id": "/subscriptions/xxx/providers/Microsoft.Web/locations/xxx/managedApis/azureblob"
            }
        }
    },
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Create_blob": {
                "inputs": {
                    "body": "@triggerBody()",
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['azureblob']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/datasets/default/files",
                    "queries": {
                        "folderPath": "/testing",
                        "name": "Test",
                        "queryParametersSingleEncoded": true
                    }
                },
                "runAfter": {},
                "runtimeConfiguration": {
                    "contentTransfer": {
                        "transferMode": "Chunked"
                    }
                },
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "HTTP": {
                "inputs": {
                    "method": "GET",
                    "uri": "https://reqres.in/api/users?page=2"
                },
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 3
                },
                "type": "Http"
            }
        }
    }
}

更新 1:

只需使用 utcNow('yyyyMMdd')

等表达式更新您的 blob 名称