cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JKlop
Level: Powered On

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
JKlop
Level: Powered On

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

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

Community Support Team
Community Support Team

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.
JKlop
Level: Powered On

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...

JKlop
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,881)