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

 

 

 

 

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,998)