Search code examples
azure-authentication

Getting authorization error when trying to create a Container App


I am encountered with the following Error while I am trying to create a New Container App - Please find the below Container App details and Error Type - i am not aware whether this error is due to my subscription. PLease help me to to find appropriate solution

The Authorization Error is: {"code":"AuthorizationFailed","message":"The client 'XXXX.XXXXXX@uk.nationalgrid.com' with object id 'XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourceGroups/read' over scope '/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/resourceGroups/my-environment' or the scope is invalid. If access was recently granted, please refresh your credentials."}

Appreciate if i get an appropriate solution to my error.


Solution

  • I agree with @Anand Sowmithiran that You are getting this Authorization Failed error as you are account associated with the provided Azure credentials does not have sufficient permissions to perform the requested Create azure container app action. To check this, follow below steps.

    • To Resolve these, you need to check the Resource provider Microsoft. App is registered or Not Registered as mentioned in MS document. enter image description here

    • Follow this MS resource providers document to check registered resource provider.

    Go to your subscription>> Settings>>Resource Providers >> then as shown in below image search for Microsoft. App. Microsoft. Appis registered in my case and check in your case is it registered or Not Registered. If it is not registered, then to create container app it should be registered.

    enter image description here

    • And in case Microsoft. Appregistered then you need to check for sufficient permissions.
    • As shown in below image Go to your Subscription>>Access control (IAM) >>Add>>Add role assignment(enabled)>>select Contributor role.
    • In my case add role assignment is disabled so i can't add role .Check whether your role assignment is enabled then you need contributor role to perform this action.
    • So, check with your admin and ask for appropriate role permissions.

    enter image description here