-
Notifications
You must be signed in to change notification settings - Fork 65
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
Azurestack ASDK - Error: determining environment: unable to locate metadata for environment "stack" from custom metadata host "management.local.azurestack.external" #197
Comments
The provider seems to be ignoring "environment" / "ARM_ENVIRONMENT" |
@matthorgan I was able to get a successful TestAccResourceGroup_basic test (from this repository) using Terraform 1.3.6 and hashicorp/azurestack 1.0.0.
Make sure to follow the README and verify the environment variables are set up correctly. The I set these environment variables in PowerShell (values are left empty for demonstration):
|
Was there ever a solution to this issue? I'm attempting to use the Terraform provider for Azure Stack just now for the first time and ran into this. I have curled that endpoint and there's nothing about environment in it. Is the message giving the wrong impression? |
Solution: It yields output similar to this: [
{
"portal":"https://portal.local.azurestack.external/",
"authentication":{
"loginEndpoint":"https://login.microsoftonline.com/",
"audiences":[
"https://management.azurestacktenant.onmicrosoft.com/1896984d-3500-435a-9eb3-5f4580e945c3"
]
},
"graphAudience":"https://graph.windows.net/",
"graph":"https://graph.windows.net/",
"name":"AzureStack-User-1896984d-3500-435a-9eb3-5f4580e945c3",
"suffixes":{
"keyVaultDns":"vault.local.azurestack.external",
"storage":"local.azurestack.external"
},
"gallery":"https://providers.azurestack.local:30016/"
}
] In some version of the api, it most likely returned a name like "stack" rather than the "AzureStack-User-xxx" name. It's this name that's needed in the ARM_ENVIRONMENT variable. |
Nice one @sebastus. I didn't get a chance to come back to this as I'm not using Azure Stack anymore but this is useful to know, thanks 👍 |
I ran into this issue today as well, using Terraform version 1.4.0, AzureStack provider version 1.0.0 and Azure CLI version 2.29.2. I tried setting |
Community Note
Terraform (and AzureStack Provider) Version
Terraform v1.2.6
azurestack v1.0.0
Affected Resource(s)
azurestack_resource_group
Terraform Configuration Files
Debug Output
https://gist.github.com/matthorgan/27fecca7ee03b3e4ce8efaaf85479658
Expected Behaviour
A resource group should be created
Actual Behaviour
Error before RG is created
Steps to Reproduce
terraform apply
Important Factoids
Attempting to run Terraform on my ASDK environment produces the error
Error: determining environment: unable to locate metadata for environment "stack" from custom metadata host "management.local.azurestack.external"
. I am using theaz cli
for authentication and have confirmed I can create resources via theaz cli
so the permissions are correct.The text was updated successfully, but these errors were encountered: