cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Access denied due to invalid subscription key via Custom Vision

I have a trained Custom Vision project and a PowerApp setup.

I created a Custom Vision Connection giving it the Prediction Key I get from the CV Project.

 

I use the following formula from a camera view's onSelect action:

UpdateContext({predictValues: CustomVision.PredictImage("<my-project-id-here>", Camera.Stream).Predictions})

 

But I keep getting the following response:

{
"error": {
"statusCode": 401,
"message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}

 

I have tried both Key1 and Key2 from the Azure project on the CV Connection.

I tried the Subscription-Id from the Azure Project (I know it's wrong, but I was desperate) on the CV Connection.

I have tried the Project-Id as parameter in the formula function, also the above keys as parameter in the formula function.

 

No matter what I try, I get the Above Error (401).

 

Any ideas on how to get that formula function to work with Azure Custom Vision API?

4 REPLIES 4
Highlighted
Frequent Visitor

Re: Access denied due to invalid subscription key via Custom Vision

Mind I tried Camera.Photo as well as Camera.Stream

Highlighted
Community Support
Community Support

Re: Access denied due to invalid subscription key via Custom Vision

Hi @JKlop ,

Do you want to use Computer Vision API connector within your app?

Do you create a custom connector based on the Computer Vision API within your PowerApps?

Where do you put the Subscription key when you created your custom connector based on Computer Vision API?

 

I have created a custom connector based on the Computer Vision API within my PowerApps, the customer connector works well on my side.

Please check if you have specified the Subscription key of your Computer Vision project as the API Key Authentication within your customer connector as below:1.JPG

Set the Parameter name property to following:

Ocp-Apim-Subscription-Key

More details about authorizing the Computer Vision API Call, please check the following artcile:

https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/vision-api-how-to-topics/h...

 

In addition, please also check if you have typed a proepr Host value within your custom connector as below:2.JPG

When you created a Computer Vision project, it would generate related Computer Vision API Endpoints for you. Please use the generated Endpoints within your custom connector.

 

Please also check if the Subscription key of your Computer Vision project is valid (rather than be overdue). Also please consider re-create a new connection to your customer connector, check if the issue is solved.

 

More details about the Computer Vision API, please check the following article:

https://westus.dev.cognitive.microsoft.com/docs/services/5adf991815e1060e6355ad44/operations/56f91f2...

More details about customizing connector in PowerApps, please check the following video:

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Access denied due to invalid subscription key via Custom Vision

Thank you for coming back, I haven't tried your solution yet, but is there any reason for the following:

Capture.PNG

Why is the above connector available withing powerapps, if I can not use it?

I want to try something simple, and now it turns out it has to get more complicated, it was easier to do natively in C# and java...

Highlighted
Frequent Visitor

Re: Access denied due to invalid subscription key via Custom Vision

I didn't want to use a custom connector, I just wanted to use the one provided already, but doesn't work.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Users online (5,924)