aztfexport icon indicating copy to clipboard operation
aztfexport copied to clipboard

China Azure

Open m1rl0k opened this issue 2 years ago • 3 comments

I get errors when trying to authenticate to use tfexport against az china;

image this is without a service principal;

this is with service principal and azureprofile.json set to to use; image

obviously have set to azure china cloud, did az login.. gave owner to service principal on the sub trying to read... have tried multiple resource groups; etc what may i be missing? Any insights @magodo

m1rl0k avatar Dec 19 '23 00:12 m1rl0k

@m1rl0k I've tested via the SP auth way (i.e. ARM_CLIENT_ID + ARM_CLIENT_SECRET), would you mind give that a try? Currently, I don't have an Azure China account to test the CLI auth scenario.

magodo avatar Dec 19 '23 04:12 magodo

Update: I've successfully to make aztfexport work for China cloud via CLI auth, by the following steps:

  1. az cloud set --name AzureChinaCloud
  2. az login --service-principal <options>
  3. aztfexport <command> <options>

magodo avatar Dec 19 '23 06:12 magodo

yes thank you this worked; however we had to export arm_environment: china and then all works with your metbod

m1rl0k avatar Dec 21 '23 14:12 m1rl0k