title: VS2019 Azure Service Authentication Account Selection for local debugging
body: <p>Using VS2019, I have specified a temporary "developer account", using Tools/Options/Azure Service Authentication/Account Selection, for my app to "authenticate and access Azure resources with when debugging from Visual Studio". The developer  account has access to an Azure SQL database. When I debug, my app gets a token as follows:</p>
  
  <pre><code>SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
              builder["Data Source"] = serverName;
              builder["Initial Catalog"] = dbName;
              builder["Persist Security Info"] = "False";
              builder["MultipleActiveResultSets"] = "False";
              builder["Encrypt"] = "True";
              builder["TrustServerCertificate"] = "False";
              builder["Connect Timeout"] = 15;
  
              var cancellationToken = new CancellationToken();
              var conn = new SqlConnection(builder.ConnectionString);
  
              conn.AccessToken = new AzureServiceTokenProvider().GetAccessTokenAsync("https://database.windows.net/").GetAwaiter().GetResult();
  
              return conn.AccessToken;
  
  </code></pre>
  
  <p>However, when I examine the token returned it is NOT the token for the developer account identity I specified, it is for my normal identity I use to run Visual Studio. A co-worker has been able to do this in VS2019 with a developer account that's in the same Azure AD groups as my developer account. But for some local environment reason this is not working for me. Note that in SQL Server Management Studio I can access the SQL Azure database using my developer account with no problem at all.</p>
  
  <p>Has anyone else had this debugging identity problem and been able to solve it? Thanks in advance for any light you can shed on this.</p>