How can I set up my Azure storage account to be used in the Cognitive Services API

Frank Lunenburg 0 Reputation points
2024-03-14T10:26:39.83+00:00

I use the Azure Cognitive Services API to test a new model. To do this, I use the endpoint, headers and body given to me bij Custom Vision. I'm able to use the url of the blob where the test image is stored only if the blob is 'Enabled from all networks'. If I limit this to selected 'virtual networks and IP addresses' the API is giving me a bad url error. My own IP is the allowlist of the storage account (under 'Networking')

What I tried:

Use SAS token, will not work. The API only uses the url before the '?' character.

Added the custom vision app to 'Storage Blol Data Reader' role (in IAM). Also makes nog difference.

Added 'Microsoft.CognitiveServices/account' (all in current tenant) to the resource instances in 'Networking' of the container. Also no difference.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,578 questions
Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
233 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nehruji R 4,216 Reputation points Microsoft Vendor
    2024-03-15T09:52:21.1+00:00

    Hello Frank Lunenburg,

    Greetings! Welcome to Microsoft Q&A forum.

    I understand that you’re encountering issues with the Azure Cognitive Services API when restricting access to your blob storage.

    When deploying the Custom Vision API in a limited private network, configure your virtual network to allow access to the Custom Vision service -refer https://video2.skills-academy.com/en-us/azure/ai-services/cognitive-services-virtual-networks?tabs=portal#supported-regions-and-service-offerings, https://video2.skills-academy.com/en-us/rest/api/custom-vision/?view=rest-computervision-v3.1. for detailed guidance. Ensure that your application can reach the Custom Vision endpoint from within the network.

    Verify that the networking settings allow traffic from your application’s location (IP) to the blob storage. Review any firewall rules or network security groups that might affect outbound requests from your application.

    Furthermore, I wonder if you have configured these other settings as well:

    254798-image.png

    Similar SO thread for reference - https://stackoverflow.com/questions/77105932/azure-cognitive-search-on-private-endpoints-implement-function-for-built-in-sk ,https://github.com/Azure-Samples/cognitive-services-vision-csharp-sdk-quickstarts/blob/master/CustomVision/README.md

    I hope you can find this useful to overcome your concern. Please let us know if you have any further queries. I’m happy to assist you further.

    0 comments No comments