首页 > 解决方案 > 如何使用 Azure 逻辑应用创建 Blob 容器?

问题描述

使用逻辑应用程序我试图将 blob 从一个容器复制到几个单独的动态创建的容器中,但是逻辑应用程序中似乎没有“创建容器”操作。

我尝试使用“创建 Blob”操作,并将所需的容器名称指定为“Blob 名称”参数的一部分,但这会失败并显示 404 消息。

{
  "status": 404,
  "message": "Specified container telemetery-30dfb0bd-73b0-42a3-8677-63bde2fd4b43 does not exist.\r\nclientRequestId: blahblahh-e60e-44e1-aec4-c32a21659257",
  "error": {
    "message": "Specified container telemetery-30dfb0bd-73b0-42a3-8677-63bde2fd4b43 does not exist."
  },
  "source": "blahblha-ne.azconn-ne-01.p.azurewebsites.net"
}

原来的要求是——

{
    "method": "post",
    "queries": {
        "folderPath": "/",
        "name": "/telemetery-30dfb0bd-73b0-42a3-8677-63bde2fd4b43/timeline,xml",
        "queryParametersSingleEncoded": "True"
    },
    "path": "/datasets/default/files",
    "host": {
        "connection": {
            "name": "/subscriptions/blahblah-6866-4c8c-b3f1-41039ad2b3eb/resourceGroups/RG-blahblahg/providers/Microsoft.Web/connections/azureblob"
        }
    },
    "body": "file content"
}

有没有办法为我们的逻辑应用创建一个 blob 容器?

标签: azureazure-storageazure-blob-storageazure-logic-apps

解决方案


根据文档,没有“创建容器”操作:

https://docs.microsoft.com/en-us/connectors/azureblobconnector/

您可以做的是编写一个 Azure 函数并将其链接为工作流的一部分,以创建容器:

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet#create-a-container


推荐阅读