zgue
zgue

Reputation: 3850

How to save a Blob in a not existing container

I am developing a Logic App which is scheduled every minute and creates a storage blob with logging data. My problem is that I must create a container for the blob manually to get it working. If I create blob within a not existing container

enter image description here

I get the following error:

"body": {
        "status": 404,
        "message": "Specified container tmp does not exist.\r\nclientRequestId: 1111111-2222222-3333-00000-4444444444",
        "source": "azureblob-we.azconn-we.p.azurewebsites.net"
    }

This stackoverflow question suggested putting the container name in the blob name

enter image description here

but If I do so I get the same error message: (also with /tmp/log1.txt)

{
  "status": 404,
  "message": "Specified container tmp does not exist.\r\nclientRequestId: 1234-8998989-a93e-d87940249da8",
  "source": "azureblob-we.azconn-we.p.azurewebsites.net"
}

So you may say that is not a big deal, but I have to deploy this Logic App multiple times with a ARM template and there is no possibility to create a container in an storage account (see this link).

Do I really need to create the container manually or write a extra azure function to check if the container exists?

Upvotes: 1

Views: 398

Answers (1)

Murray Foxcroft
Murray Foxcroft

Reputation: 13785

I have run in this before, you have a couple of options:

  • You write something that runs after the ARM template to provision the container. This is simple enough if you are provisioning through VSTS release management where you can just add another step.
  • You move from ARM templates to provisioning in PowerShell where you have the power to do the container creation. See New-AzureStorageContainer.

Upvotes: 1

Related Questions