cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UB400
Level 10

Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

I'm referring to the Blog Post by Pratap Ladhani https://powerapps.microsoft.com/en-us/blog/custom-api-for-image-upload/

 

At the start of the blog, he mentions how to create an Azure API App. I had a look in Azure and couldn't find s similar screen (understandable as Azure changes really quickly).

 

Where do I start to make this Azure API App? Is it from here?

WebApp.jpg

Or is it from here?

APIApp.jpg

 

If it isn't obvious I have no clue how to proceed, and I was hoping that I could follow that blog and be able to make it happen.

 

I need this functionality for two reasons:

1. To be able to store Images somewhere in order for them to be accessible in Galleries in the App which will be shared by several Users.

2. I would like to build an App that does Expense Claims and I would like the Users to be able to upload images of receipts.

 

Any guidance will be greatly appreciated.

8 REPLIES 8
Community Support Team
Community Support Team

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

Hi UB400,

 

As you want to make a Azure API app, please try to start from the second picture. From the document you have provided, we know that a Azure API App is being selected. Please try the steps to create a Azure API App.

Azure api app.PNG

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Meneghino
Level 10

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

Hi @UB400 please see here for an alternative in SharePoint:

https://powerusers.microsoft.com/t5/PowerApps-Forum/Solved-How-to-save-captured-images-in-SharePoint...

 

If you need the actual jpeg, you just need to convert the base64 string to bytes.

PowerApps Staff pratapladhani
PowerApps Staff

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

Hi UB400,

 

The following article will help you understand how to get started with Azure API Apps:

https://docs.microsoft.com/en-us/azure/app-service-api/app-service-api-dotnet-get-started

 

Hope it helps!

Pratap Ladhani,
Customer & Partner Success PM
Microsoft PowerApps and Microsoft Flow
UB400
Level 10

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

@pratapladhani thank you very much for the guidance. What i gleaned from reading the article you linked to was very valuable, and in the end I downloaded your files and was able to make the API.

 

However I ran into an issue. While the Image gets uploaded to Azure blob storage, it does not show in the Gallery as per your example. As I had only got to the testing stage , I'm still running it without authentication and what i've noticed is that the URL stored in the Collection and that gets displayed in the gallery has ?sv=xxxx etc appended after the .jpg. Is that the authentication string that gets passed on to Azure, as I suspect that is the reason it's not displaying the image.

 

I tried pasting the url into a browser and it returned an authentication error, removing the string of characters after the .jpg shows the image in the browser.

 

Will adding authentication resolve the issue?

UB400
Level 10

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

@pratapladhani I did some more testing. I switched on authentication, on the Azure side. Then when creating the new custom sonnection, I tried using the json file that was created earlier without authentication, however when I tried to select an authentication option for creating the custom connection, the drop down does not show any authentication option, only "no authentication". Please advise.

jmiller
Level: Powered On

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

I found workaround to this was to just comment out/delete the "+ sasBlobToken" bit on line 96 of UploadImageController.cs in Visual Studio.

 

That gets rid of the authentication token on the uploaded image. I'm sure that's very hacky and removes a security layer but for my PoC it does the job nicely.

 

UB400
Level 10

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

@jmiller thanks for sharing. Does your "hack" retain some level of "Security" i.e. does it only allow authorised Users, or is it the same as leaving it open without any Security whatsoever?

PowerApps Staff EvanChakiMSFT
PowerApps Staff

Re: Azure Blob Storage - ImageUploadAPI - need help, don't really understand how to start

We have a less complex approach now, see the blog post on how to save files and lock them down with the updated Azure Blob Storage connector: https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-using-the-azure-blob-storage-...

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 283 members 4,896 guests
Please welcome our newest community members: