The error message indicates that the client does not have the necessary permissions to register the Microsoft.Web provider. You need to ensure that the service principal has the appropriate role assigned to perform the action 'Microsoft.Web/register/action' on the specified subscription. If access was recently granted, refreshing your credentials may also help.
Here are the steps you can take to address this authorization error:
- Verify that the client 'b97bfe1d-76f8-4454-b109-61fcf93b0b94' has the required permissions to register the Microsoft.Web provider and perform the specified action.
- If the client does not have the necessary permissions, you need to grant the required permissions to the client. This can be done through Azure Role-Based Access Control (RBAC) by assigning the appropriate role to the client at the subscription level or resource group level.
- Ensure that the client has the 'Microsoft.Web/register/action' permission over the scope '/subscriptions/c52ebc8b-e04a-460e-82e0-324373aed357'.
This can help ensure that the client's credentials are up to date and reflect the latest permissions granted.
For your reference, please review the following documentations for further clarification:
https://learn.microsoft.com/en-us/azure/api-management/quickstart-terraform?tabs=azure-clihttps://learn.microsoft.com/en-us/azure/developer/terraform/troubleshoot#unable-to-list-provider-registration-status
By following these steps and ensuring that the client has the necessary permissions and access rights, you should be able to create API management from Azurerm Terraform API without encountering the authorization error.