You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The azure examples do not contain instructions sufficient for running the tests in non-commercial (ie USGov) cloud environments. "AZURE_ENVIRONMENT" needs to be set as an environment variable for any non-commercial cloud test to work.
Running a simple test case for a USGov cloud deployments results in a "Subscription not found" 404 error thrown by the resource_client attempting to retrieve the test resources for evaluation.
To successfully test the deployment of resources in a non-commercial cloud environment, the "AZURE_ENVIRONMENT" environment variable needs to be set by the user.
To Reproduce
Set your active cloud with the Azure CLI to non-commercial: az cloud set --name AzureUSGovernment
Login to your azure account: az login
Run TestTerraformAzureExample from test/azure/terraform_azure_example_test.go
The test will fail with a 404 error saying your subscription was not found
Set the AZURE_ENVIRONMENT variable: export AZURE_ENVIRONMENT=AzureUSGovernmentCloud
Run TestTerraformAzureExample from test/azure/terraform_azure_example_test.go
The test should pass
Error Trace
resourcegroup.go:16:
Error Trace: /Users/<user>/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/azure/resourcegroup.go:16
Error: Received unexpected error:
resources.GroupsClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="SubscriptionNotFound" Message="The subscription '<subscription_id>' could not be found."
Expected behavior
Tests should pass for non-commercial Azure clouds
Versions
Terratest version: v0.44.0
The text was updated successfully, but these errors were encountered:
Describe the bug
The azure examples do not contain instructions sufficient for running the tests in non-commercial (ie USGov) cloud environments. "AZURE_ENVIRONMENT" needs to be set as an environment variable for any non-commercial cloud test to work.
Running a simple test case for a USGov cloud deployments results in a "Subscription not found" 404 error thrown by the
resource_client
attempting to retrieve the test resources for evaluation.The client_factory has documented the environment variable it uses to know what Azure cloud to use when generating resource clients.
To successfully test the deployment of resources in a non-commercial cloud environment, the "AZURE_ENVIRONMENT" environment variable needs to be set by the user.
To Reproduce
az cloud set --name AzureUSGovernment
az login
TestTerraformAzureExample
fromtest/azure/terraform_azure_example_test.go
export AZURE_ENVIRONMENT=AzureUSGovernmentCloud
TestTerraformAzureExample
fromtest/azure/terraform_azure_example_test.go
Error Trace
Expected behavior
Tests should pass for non-commercial Azure clouds
Versions
The text was updated successfully, but these errors were encountered: