Hello everyone,
I am using azure blob as the storage for my power apps application. I tried out-of-the-box integration of powerapps portal with azure blob. But I want to have additional functionalities like searching files stored in Azure blob storage from the powerapps model driven app. And also adding metadata to the files when we are uploading files within dynamics system.
So I am thinking of using azure blob search api and put metadata api's.
This is the first time I am working on API's. I wanted to know how to call API from Dynamics?
Thank you..
So, first you need to define how you are calling. If you want to add a Search experience, then it is almost certainly client side. This is a problem, because calls executed client side potentially expose your authentication mechanism (assuming you won't be using the currently logged in user's AD token to authenticate to Blob) and also can run into Cross-Origin Scripting (CORS) issues that will block your traffic from going through.
So, in order to protect your authentication and escape CORS issues, you will probably need to create an intermediary (An Azure Function, perhaps?) that is itself an API you can call, passing in the current user's AD token, and it then uses a connection string or whatever mechanism to hit the Blob.
Alternatively, you can use a Release build PCF; because the script gets bundled your auth information is relatively secure, but in this case you still run the risk of a CORS exception, so you might need to create an intermediary anyway.
Anyway, working with APIs is really easy (other than auth and CORS). You just pick your endpoint, pick your verb, and wrap up your message body and send it. There are about a million walkthroughs on basic API calls, including this handy reference to Blob APIs. Also, I would recommend you check out Postman; it is a very convenient API testing tool that lets you rapidly try out API calls without needing to write code, then once you have a working call, Postman will give you the exact code to make that same code in the language of your choice (very nice!).
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional