cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kaine
Advocate I
Advocate I

Can AzureBlobStorage connector create a folder/subfolder for files?

Hi,

Using AzureBlobStorage connector in PowerApps, is it possible to create a folder on the fly?

For example, I would like to group files under the ID of the parent item to which they belong. To be able to do this, I need to create create sub-folders named with the parent ID on the fly.

In my example, I have a Blob storage account with a container called "attachments". Within the "attachments" container, I'd like to check for and create a folder matching the ID of the parent, such as

attachments/20b5b3c2-7493-45ff-b9f9-ab5cccdf644d

I have used the following code, which appears to work, in that the sub-folder is created and the file successfully uploaded, but the execution results in an error:

AzureBlobStorage.CreateFile(Concatenate("attachments/", Parent.Id), "My File.txt", btnAddPicture.Media)

Using the code above results in errors like this:

AzureBlobStorage.CreateFile failed: {
  "status": 404,
  "message": "Specified container 20b5b3c2-7493-45ff-b9f9-ab5cccdf644d does not exist.\r\nclientRequestId: f898671e-78c2-425c-b080-f6d6d1cab5d4",
  "error": {
    "message": "Specified container 20b5b3c2-7493-45ff-b9f9-ab5cccdf644d does not exist."
  },
  "source": "azureblob-we.azconn-we-01.p.azurewebsites.net"
}

 So, in conclusion, the call seems to work, but results in an error. Is there some way that I can avoid this error?

 

Kaine

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Kaine ,

I made a test on my side and the AzureBlobStorage.CreateFile function creates a subfolder for files without any errors.

Snipaste_2020-05-06_16-30-46.png

Please try to refresh the Azure blob storage Connection and format the folder path as '/Container/SubFolder/'.

AzureBlobStorage.CreateFile(Concatenate("/attachments/", Parent.Id,"/"), "My File.txt", btnAddPicture.Media)

Hope this helps.

Sik

 

 

 

 

View solution in original post

2 REPLIES 2
v-siky-msft
Community Support
Community Support

Hi @Kaine ,

I made a test on my side and the AzureBlobStorage.CreateFile function creates a subfolder for files without any errors.

Snipaste_2020-05-06_16-30-46.png

Please try to refresh the Azure blob storage Connection and format the folder path as '/Container/SubFolder/'.

AzureBlobStorage.CreateFile(Concatenate("/attachments/", Parent.Id,"/"), "My File.txt", btnAddPicture.Media)

Hope this helps.

Sik

 

 

 

 

Hi @v-siky-msft ,

Yes, I think that it must have been the trailing slash (/). It all works without complaint now.

Thanks ever so much for your help.

 

- Kaine

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,042)