Showing results for 
Search instead for 
Did you mean: 
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?

Frequent Visitor

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

Community Support
Community Support

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:


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


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:

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


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.

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


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

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

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,596)