cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UB400 Kudo Kingpin
Kudo Kingpin

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
Community Support

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.
Meneghino Community Champion
Community Champion

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.

Power Apps
Power Apps

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 Kudo Kingpin
Kudo Kingpin

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 Kudo Kingpin
Kudo Kingpin

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
Regular Visitor

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 Kudo Kingpin
Kudo Kingpin

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?

Power Apps
Power Apps

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,226)