Open geirivarjerstad opened 8 months ago
Did you find a way around this issue, while still using a managed identity?
No, I am still getting this error, but this time it is slightly different:
Error: DefaultAzureCredential: failed to acquire a token. │ Attempted credentials: │ EnvironmentCredential: missing environment variable AZURE_TENANT_ID │ WorkloadIdentityCredential: no client ID specified. Check pod configuration or set ClientID in the options │ ManagedIdentityCredential: managed identity timed out │ AzureCLICredential: ERROR: Tenant shouldn't be specified for managed identity account
https://github.com/cyrilgdn/terraform-provider-postgresql/blob/f46ec221181b09b153c7fc816e75c7030a3e8ab9/postgresql/provider.go#L271C15-L271C44
I have a custom buildagent for Azure DevOps Pipeline running in an App Service that uses Managed Identity to login into the Azure Database for PostgreSQL database. When the code uses "DefaultAzureCredential", it times out pretty quick and the pipeline fails with this error:
The timeout is short by design: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/TROUBLESHOOTING.md
So we need a way to force the provider with either another timeout value or that it can be configured to use ManagedIdentityCredential directly.
Thanks :)