Goo day,
Fellow SQLers,
So... I am an SQLer
I love it... I need a T-Shirt saying " I am an SQLer!" ... But I am also Mongodber, and CosmosDber, and other data platformer... well I need to think about wht best fit for the T-shirt. In the meantime lets go back to the question
Before I migrated, I had a SQL Login for the db
No, you did not. A LOGIN is an instance level entity and not database level entity. You use LOGIN in the intance and USER in the database.
It was given dbo to the db.
I have no idea what you mean here since dbo is a name of built-in schema and also a name of a built-in USER.
I get feeling like you have a bit of confusion regarding SQL Server terms.
What is "dbo" ?
SQL Server Schema is a logical container (collection) of database objects.
Using schema is a useful security mechanism to segregate database objects for better management. Schemas can be owned by any database principal, and each USER in the database has a setting for a default Schema.
The schema is part of the hierarchy Object model, starting with the Server Instance name -> Database name -> Schema name -> and the object name.
Each object can be referred using "four-part naming" based on the hierarchy Object model using the format <Instance name>.<Database name>.<Database Schema name>.<Database Object name>
. For example, we can refer to a table named "Tbl" which is in schema "Scm" which is in Database "DB" in instance "sql2019" like: sql2019.DB.Scm.Tbl
SELECT * FROM sql2019.DB.Scm.Tbl
SQL Server model database (which is used as the template for all databases) ships with several pre-defined schemas that have the same names as pre-defined database users or pre-defined database roles.
Note! Using the same name for different entities is VERY confusing and probably a very bad approach in my opinion.
The name "dbo" is one of these mentioned names. We have a USER named "dbo" and we have SCHEMA named "dbo".
Nothing from the above information is directly related to your issue.
After the migration, when logged into the Azure DB with my personal Azure login/password with ssms it works fine.
Each Azure SQL logical server starts with a single server administrator account that is the administrator of the entire server. This account is not related to the Azure login/password.
The Azure login/password are entities in the Azure Active Directory (AAD). If your description is accurate then it seems like your AAD was configured as second administrator account, which is not the default.
What next?!?
But, I am not able to connect to the Azure db with SSMS on my local laptop using that SQL Login
I get the 18456 error.
(1) Please provide the full error message since we cannot read minds and most of us do not remember all the numbers of all the errors. The error 18456 is a generic Login Failed error message.
(2) Try to connect to the server using the sysadmin SQL LOGIN.
Open the portal in the list of the Azure SQL : https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/microsoft.sql%2Fservers
Click on the Server you want to manage
On the right side you should see the properties of the server. check what is the name of the "Server admin"
Try to connect using this SQL account instead of the AAD account as first step.
Note: you can reset the password in the portal if you do not remember
(3) Next step you can focus on how to connect using your AAD account. For this, check the following links
https://techcommunity.microsoft.com/t5/azure-sql-database/troubleshooting-problems-related-to-azure-ad-authentication-with/ba-p/1062991
https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure?tabs=azure-powershell