Hi @Mallaiah Sangi and @Saraswathi Devadula ,
I moved to "SQL Server Management Studio 21 Preview", and I thought it was fixed, but today it happened again in also in SSMS 21:
> ===================================
>
> Login failed for user '\<token-identified principal\>'. (Framework Microsoft SqlClient Data Provider)
>
> ------------------------------
> For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
>
> ------------------------------
> Server Name: \{my_server_name\}.database.windows.net\
> Error Number: 18456\
> Severity: 14\
> State: 1\
> Line Number: 65536
>
> ------------------------------
> Program Location:
>
> at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action\`1 wrapCloseInAction)\
> at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\
> at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\
> at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)\
> at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)\
> at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover, Boolean isFirstTransparentAttempt, Boolean disableTnir)\
> at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)\
> at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)\
> at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, DbConnectionPool pool, String accessToken, SqlClientOriginalNetworkAddressInfo originalNetworkAddressInfo, Boolean applyTransientFaultHandling)\
> at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\
> at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)\
> at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource\`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\
> at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource\`1 retry, DbConnectionOptions userOptions)\
> at Microsoft.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource\`1 retry)\
> at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource\`1 retry, SqlConnectionOverrides overrides)\
> at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)\
> at Microsoft.SqlServer.ConnectionDlg.UI.ConnectionDialogViewModel.OpenConnection(IDbConnection connection, IServerConnectionProvider serverConnectionProvider)
About your suggestion @Saraswathi Devadula :
Please make sure that the users were added as an Azure SQL Administrator - you can do this in the portal
navigate to the Azure SQL logical Server -> in the left menu select Azure Active Directory
-> confirm your users are registered there or add them using Set admin
I couldn't find in Azure Portal, "Azure Active Directory" in the left menu of my "Azure SQL logical Server" page.
However, I found it in "Microsoft Entra ID" (Azure Active Directory (Azure AD) is now Microsoft Entra ID. Learn more)
Microsoft Entra admin
Microsoft Entra authentication allows you to centrally manage identity and access to your Azure SQL Database. Learn more
Admin name: {my_id} (Admin Object/App ID:{my_guid})
Anyways, if I can connect after restart, it means my Entra Identity have the required permission. It just UI issue, that don't pop-up the web login page after connection lost and the only way I found is to restart the SSMS.
I hope you have more ideas, as I have many times that quite a few tabs are open in SSMS, and restart, means to close all my work.
Thanks again,
Jermy