Unable to login to Azure using `azcopy login --tenant-id` with the Tenant ID from an Azure Government account?

1k views Asked by At

I am using an Azure Government account that has the base URL of portal.azure.us. I am trying to use the azcopy executable on my macOS and run the command ./azcopy login --tenant-id=<tenant ID>. I am 100% sure the tenant ID I am using is correct. However, I get the following error:

Failed to perform login command: 
failed to login with tenantID "XXXX", Azure directory endpoint "https://login.microsoftonline.com", autorest/adal/devicetoken: -REDACTED- occurred while handling response from the Device Endpoint: Error HTTP status != 200

Is this because I am not logged into the Azure Government account properly? How can I get this command to run?

1

There are 1 answers

0
Mike On

To login to Azure Government with AzCopy, you will need to specify the --aad-endpoint for Azure Government. Try using:

azcopy.exe login --tenant-id <tenantid> --aad-endpoint https://login.microsoftonline.us