I am trying to run terraform apply on a folder with a tf file, after running init.
However, I get the error below:
Error running plan: 1 error(s) occurred:
- provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: resources.ProvidersClien t#List: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Stat us=403 Code="AuthorizationFailed" Message="The client '17cd0b64-08fb-48db-ad9f-4dd56361bb47' with object id '17cd0b64-08 fb-48db-ad9f-4dd56361bb47' does not have authorization to perform action 'Microsoft.Resources/subscriptions/providers/re ad' over scope '/subscriptions/9a305d25-7f89-43d4-a691-62ad0f63c5c8'."
The tf file has my tenant id, subscription id, all the other required fields, but the error keeps happening. Please advise?
EDIT: Below is my tf file
provider "azurerm" {
subscription_id = "****"
client_id = "**client_id**"
client_secret = "****"
tenant_id = "**+*"
}
# Create a resource group
resource "azurerm_resource_group" "production" {
name = "productiongs"
location = "West US"
}