-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terratest in container #546
Comments
How are you authenticating to Azure? Running locally Terraform defaults to Azure CLI authentication. As a dev, we are usually always signed into it. But Terraform recommends using Azure's Managed Service Identity (MSI) or a Service Principal when connecting outside of your local development environment. I ran into this when trying to automate my own Terratests against Azure modules I am building. Here is the security I had to setup. https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html I was running my CI on hosted Azure DevOps agents and they all have Azure CLI on them, but I don't think it is required. I would try setting up the environment variables the link above suggests with a service principal that has access to provision resources in your subscription. |
Hi, AZURE_SUBSCRIPTION_ID |
Good to know. I am just starting to explore azure go sdk. I had to set those environment variables up in my CI pipeline in order to work with Terraform too. |
So I have more details for anyone trying to automate tests against Azure with Terratest These are the environment variables that Terraform is looking for: For the Azure SDK for Go, you need to configure a different set of environment variables. |
Please see #89 for the status on Terratest with Azure. In particular, we're starting some work around it, and when that work is done, we'll be able to come back to this question! |
Closing as the original issue was solved. |
terratest for azure example fail while running in a container vs natively.
is azure cli mandatory in order to run the tests ?
The text was updated successfully, but these errors were encountered: