如何使用 Azure 逻辑应用程序创建 blob 容器?

How to create a blob container with Azure Logic Apps?

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

我尝试使用 "Create Blob" 操作,并在 "Blob Name" 参数中指定了所需的容器名称,但是失败并显示 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 容器?

根据文档,没有 "create container" 操作:

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

目前还没有创建 blob 容器的操作,您可以像 Thiago 提议的那样使用 azure 函数来实现它。假设您可以使用 rest api 来做到这一点。下面的测试使用 sas 令牌来做你可以尝试其他授权方式。