aztfmod / rover

The rover is a docker container in charge of the deployment of the Terraform platform engineering for Azure
MIT License
171 stars 142 forks source link

DefaultAzureCredential: failed to acquire a token. #261

Closed LaurentLesle closed 2 years ago

LaurentLesle commented 2 years ago

When running vnet peering between vnet in different subscriptions, CAF Terraform module through this error:

Error: checking for presence of existing Resource: (ResourceId "/subscriptions/xxxxresourceGroups/yyyyy/providers/Microsoft.Network/virtualNetworks/vnet/virtualNetworkPeerings/vnet2" / Api Version "2021-05-01"): DefaultAzureCredential: failed to acquire a token.
Attempted credentials:
EnvironmentCredential: incomplete environment variable configuration. Only AZURE_TENANT_ID and AZURE_CLIENT_ID are set
ManagedIdentityCredential: no default identity is assigned to this resource
AzureCLICredential: ERROR: Tenant shouldn't be specified for managed identity account

When running rover with User MSI, rover inject the tenant id in the variable ARM_TENANT_ID.

LaurentLesle commented 2 years ago

Closed as fixed in the module