Azure-sdk-for-net: Misleading (outdated?) exception message when VS re-authentication needed

Created on 23 Feb 2018  路  8Comments  路  Source: Azure/azure-sdk-for-net

Not sure if this belongs here or somewhere in an Azure VS extensions repo, but after upgrading to VS 15.5.7 my project started throwing the exception shown at the end, indicating I needed to re-auth my Azure credentials.

This is the main problem:

TS003: Error, TS001: 
This account '[email protected]' needs re-authentication. 
Please go to Tools->Azure Services Authentication, and re-authenticate the account you want to use.

There is no "Azure Services Authentication" in the "Tools" menu (or anywhere in VS2017, if VS search is to be trusted). Instead I had to open Cloud Explorer and click on the little person icon at the top (not the most discoverable feature, if you ask me, I gather a lot of folks leave Cloud Explorer off for performance reasons).

It was also misleading that the top-level message is "No connection string specified".

Full exception sans trace:

Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException
  HResult=0x80131500
Message=Parameters: Connectionstring: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxx.
Exception Message: Tried the following 3 methods to get an access token, but none of them worked.
Parameters: Connectionstring: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxx.
Exception Message: Tried to get token using Managed Service Identity. Unable to connect to the Managed Service Identity (MSI) endpoint. Please check that you are running on an Azure resource that has MSI setup.
Parameters: Connectionstring: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxx.
Exception Message: Tried to get token using Visual Studio. Access token could not be acquired. 
Exception for Visual Studio token provider Microsoft.Asal.TokenService.exe :

TS003: Error, TS001: 
This account '[email protected]' needs re-authentication. 
Please go to Tools->Azure Services Authentication, and re-authenticate the account you want to use.

Parameters: Connectionstring: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxx.
Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. 'az' is not recognized as an internal or external command, operable program or batch file.

  Source=Microsoft.Azure.Services.AppAuthentication
  StackTrace: ...
AppAuthentication customer-reported needs-team-attention

Most helpful comment

Please fix this - I just ran into the same issue and wasted 30min until I found this thread

Repro steps: I changed my password and had a stale auth token I had to refresh

All 8 comments

Thanks for reporting! This will be fixed in a future release.

From VS 15.6 onwards, the Azure Services Authentication settings page is located at Tools->Options->Azure Services Authentication. We will correct this error message to reflect the correct location.

This is still present in Visual Studio 2019. Just got it this morning.

Exception for Visual Studio token provider Microsoft.Asal.TokenService.exe : TS003: Error, TS001: This account '[email protected]' needs re-authentication. Please go to Tools->Azure Services Authentication, and re-authenticate the account you want to use.

The Visual Studio team is tracking this internally. The fix is not yet released.

For me helped just expanding of Storage Accounts in Cloud Explorer.

Please fix this - I just ran into the same issue and wasted 30min until I found this thread

Repro steps: I changed my password and had a stale auth token I had to refresh

Closing this out as there has been no recent engagement. Please feel free to reopen or file a new issue if this remains a problem with the current version of the library.

Closing this out as there has been no recent engagement.

Did you fix it or not? We stopped using Azure due to difficulties controlling/predicting cost, but a bug is a bug.

Was this page helpful?
0 / 5 - 0 ratings