boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

Terraspace azure China #105

Open ccseancc opened 3 years ago

ccseancc commented 3 years ago

When I use terraspace with azure China service principal, and run terraspace up, it prompt login fail error. Set ARM_environment cannot help to solve the issue , testing result with azure_check.rb also fail , and it seems will ignore the ARM_environment value

HoLengZai commented 2 years ago

I guess to login Azure China you do not use the standard Microsoft login page (as it's managed by 21Vianet), so something needs to be changed in Terraspace to point to the right URL to be able to use Service Principal. Do you have the login page to log in to your Azure China subscription?

tongueroo commented 2 years ago

Haven’t played with Azure China yet. Wondering if someone who has knows what the login url is suppose to be or point in the right direction.

The Azure login is handled with the armrest gem and the login url is currently set here https://github.com/boltops-tools/armrest/blob/3bb38d3466556a7b77c6786fd252de02da533e10/lib/armrest/api/auth/login.rb#L4

HoLengZai commented 2 years ago

Thanks @tongueroo. I do not use Azure China so I cannot really try but i found this article from Microsoft Docs: https://docs.microsoft.com/en-us/azure/china/resources-developer-guide#check-endpoints-in-azure Look for Azure AAD row

So on the line 4, it should be that URL to reach Azure China data centers https://login.chinacloudapi.cn/