0
votes

Using Logic Apps I am trying to copy blobs from one container into several separate dynamically created containers however there doesn't appear to be a "create container" action in Logic Apps.

I have tried using the "Create Blob" action with the desired container name specified as part of the "Blob Name" parameter however this fails with a 404 message.

{
  "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"
}

The original request is -

{
    "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"
}

IS there a way to create a blob container us Logic Apps?

2

2 Answers

2
votes

According to the documentation, there's no "create container" operation:

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

What you can do is write an Azure Function and chain it as part of your workflow in order to create the container:

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

2
votes

For now there is no action to create blob container, you could implement it with azure function like Thiago proposed. Suppose you could use the rest api to do it. The below test use the sas token to do it you could try other authorize way.

enter image description here