0
votes

I am trying to integrate Azure computer vision api's, and I would like to access the images stored on Azure blob storage.

The documentation mentions about running vision API's on remote URLs, however I am not able run them on- URL of images stored on Azure blob storage. Is it possible to run Azure Computer vision APIs on images stored on Blob storage ?

1
Do you get an error? What were the settings of the container? Did you use a SAS?Oliver
If you append a SAS to the URLs for your images in blob storage, it should work.Hong Ooi
@HongOoi can you please post one example of how to append SAS ? Currently my URL for image in Blob storage looks something like this - https://<test>.blob.core.windows.net/visiondemo/000000000285.jpg. What should I add to this?Delta
@Oliver I get 400 Bad Request errorDelta
It's basically an access problem: your blob is private so there's no magic: the computer vision cannot access it. So you have several solutions, depending on how your images are private: set the container to public if your images are public, or use SAS tokens (at the blob or at the container level). For those token, you can use your favorite language (sample: docs.microsoft.com/en-us/azure/storage/blobs/…)Nicolas R

1 Answers

1
votes

I can reproduce this problem if I change my blob container access level to private(anonymous access) it will show bad request. So I suppose the problem is the image url is not accessible.

enter image description here

So one solution is change the access level to Blob or Container, then you image blob url will be accessible.

Another solution is Hong Ooi provide, use the sas url to access the image blob. And about how to generate sas url, the simplest way is generate it from the portal like below pic, click the Generate SAStoken and URL, it will give you the sas url. If you want a sample code, you could refer to this:Create a service SAS for a container or blob with .NET.

enter image description here