2

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?

greendaysbomb
  • 364
  • 2
  • 6
  • 23
  • Not sure if you can try with an Az login first? It might pick the token and use it for az copy login – Ked Mardemootoo Jun 04 '21 at 17:30
  • I have used `az login` with it set to AzureUSGovernment, and I retrieved a tenant ID and an ID. I tried using both to login with `azcopy login`, with no avail on either. – greendaysbomb Jun 04 '21 at 17:43
  • Ahh yes you're right. So when you do `azcopy login tenantId` you get a device code? What if you do az logout and then azcopy login? Just trying different scenarios to see if we can get a different error – Ked Mardemootoo Jun 04 '21 at 17:47
  • So when I do `azcopy login --tenant-ID`, I receive the error I got above (this happened even after using `az logout` just now). When I use `azcopy login`, I follow the instructions and enter the code, and get this error: `Sign in Sorry, but we’re having trouble signing you in. AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '579a7132-0e58-4d80-b1e1-7a1e2d337859'.` – greendaysbomb Jun 04 '21 at 18:09

1 Answers1

2

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
Mike
  • 346
  • 1
  • 6