web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Access denied due to i...
Power Apps
Unanswered

Access denied due to invalid subscription key via Custom Vision

(1) ShareShare
ReportReport
Posted on by 8

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?

  • JKlop Profile Picture
    8 on at

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

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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/howtocallvisionapi#authorize-the-api-call

     

    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/56f91f2e778daf14a499e1fa

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

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

     

    Best regards,

  • JKlop Profile Picture
    8 on at

    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 Profile Picture
    8 on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard