error code 409 on when calling Availability status in 2 of our three subscription

Gosnell, Brian 21 Reputation points
2022-10-13T21:14:19.787+00:00

This one is seriously perplexing me and My system admin. We have three subscriptions which our resource groups are assigned(one for each dev, qa, and Prod). We also registered an application in the tenant space and assigned it Classic Virtual Machine Contributor. I grab a client credential client token, pass it as a bearer token and call the Microsoft.ResourceHealth/availabilityStatuses?api-version=2018-07-01 api with the correct Subscription ID and ResourceGroup Name. It works great in the DEV RG and Subscription. I also grabbed an account token personally and copied into the Authorization header and it works on Dev

However when we try to run in QA or PROD, I get the following message when I run through Postman

250263-microsoftteams-image.png

There is no difference in the Resource Groups set up as we added the the application to the Classic Virtual machine contributor.

250273-microsoftteams-image-1.png

250264-microsoftteams-image-2.png

Any help with this would be greatly appreciated.

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
967 questions
Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2022-10-14T19:31:29.937+00:00

    Hi @Gosnell, Brian ,

    Thanks for your post! I understand that you are receiving the following error on your QA and PROD subscriptions:

    { "code": "AuthError", "message": "An error occured in authentication or authorization. Make sure the resource provider has been registered with this subscription" }  
    

    This error means that you are not registered for Resource Health provider in those subscriptions. You need to enable the "Microsoft.ResourceHealth" Resource provider on your subscription by following the guidelines here:

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services

    https://learn.microsoft.com/en-us/rest/api/resources/providers/register

    You can go to the Subscription > select Resource providers > select the "Microsoft.ResourceHealth" resource provider > and select "Register."

    250608-image.png

    It looks like the 409 error is indicating that the resource provider is in an unavailable status in your subscriptions.

    Once you register the resource provider on those to subscriptions, the error should be resolved.

    -

    If the information helped you, please Accept the answer. This will help us and other community members as well.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.