Skip to content
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

Azure Government Use #168

Closed
TaraECI opened this issue Jul 6, 2022 · 11 comments · Fixed by #169
Closed

Azure Government Use #168

TaraECI opened this issue Jul 6, 2022 · 11 comments · Fixed by #169
Labels
bug Something isn't working

Comments

@TaraECI
Copy link

TaraECI commented Jul 6, 2022

Hello -
I love this tool but if I try to run it Azure Gov it errors out because
https://management.azure.com needs to be https://management.usgovcloudapi.net/
when exporting the templates (POST https://management.azure.com/subscriptions/subscriptionID/resourcegroups/RG-Name/exportTemplate)

I know this may well be by design but please imagine what it's like to be dumped with undefined infra in GovCloud you need to get into TF fast.

Don't suppose there is anyway around this?

@magodo
Copy link
Collaborator

magodo commented Jul 6, 2022

@TaraECI You can specify environment variable ARM_ENVIRONMENT to usgovernment, then it should target towards the right endpoint.

@magodo magodo added the question Further information is requested label Jul 6, 2022
@skorb-ucb
Copy link

Seeing the same thing here, but set ARM_ENVIRONMENT=usgovernment doesn't seem to have any effect. A basic aztfy command still errors out with an authentication failure message and we still see requests attempting to get out to management.azure.com in the firewall logs.

@magodo magodo added bug Something isn't working and removed question Further information is requested labels Jul 7, 2022
@TaraECI
Copy link
Author

TaraECI commented Jul 13, 2022

Would it be possible to get a compiled build of this to test for Windows AMD64 head of the release?

@skorb-ucb
Copy link

skorb-ucb commented Jul 13, 2022

FWIW I tried cloning the repo this week but after building we still seem to have authentication issues. Azure CLI login works fine, ARM_ENVRIONMENT is set to 'usgovernment', and terraform init/plan run without error, but aztfy still throws the following:

image

Not sure why it seems to be failing on querying IMDS. This is an Azure instance and IMDS is running but there's no system managed identity, so I don't expect to be able to use it for auth but it doesn't seem like it's moving past it to Azure CLI auth.

@magodo
Copy link
Collaborator

magodo commented Jul 14, 2022

@skorb-ucb This should've been fixed in #171, can you please have another try on the current main branch?

@TaraECI
Copy link
Author

TaraECI commented Jul 14, 2022

@magodo @skorb-ucb I have bit the bullet, installed go and cloned the main branch and can confirm that I can successfully import and generate Terraform configs - thank you both.

@skorb-ucb
Copy link

@magodo, I must have just cloned before that change was committed. Pulled the latest, compiled, and it's working!

@atwork317
Copy link

Thisbstill

@atwork317
Copy link

This still does not work for Azure Government.

@magodo
Copy link
Collaborator

magodo commented Nov 23, 2022

@atwork317 I've just verified the latest releas (v0.9.0) works fine for US Gov cloud.

@atwork317
Copy link

@magodo Thank you for checking. I'm going to try it out now. I'll update with results today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants