question

Csar-6596 avatar image
0 Votes"
Csar-6596 asked OuryBa-MSFT commented

SQL Login with '@' in the name (e.g. emails) not working in Azure SQL Managed Instance

While starting to migrate my system from on-premises SQL to Azure SQL Managed Instances, I found out that SQL Logins are not working in Azure because they are email addresses, and no user seems to work with an '@' in the name. For example, an user with name 'test' can connect to the Managed Instance, but users like 'test@domain.com' or 'test@test' can't.

I tried to add the instance name like this 'test@domain.com@instanceName' with no luck.

Any workaround for this? Thanks in advance

P.S: I asked this in stackoverflow a month ago, with no answer

azure-sql-database
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @Csar-6596 Welcome to Microsoft Q&A and Thank you for posting your question.
Which Migration tool are you using ?

0 Votes 0 ·

Thank you for your answer.

I am not using any tools, I have my own tools to progressively migrate and I used to create logins like this:

 CREATE LOGIN [user@domain.com] WITH PASSWORD = 'X', DEFAULT_LANGUAGE = Español;
 CREATE USER [user@domain.com] FOR LOGIN [user@domain.com]

but in Azure I had to replace it with:

 CREATE LOGIN [user..domain.com] WITH PASSWORD = 'X', DEFAULT_LANGUAGE = Español;
 CREATE USER [user..domain.com] FOR LOGIN [user..domain.com]
0 Votes 0 ·

1 Answer

OuryBa-MSFT avatar image
0 Votes"
OuryBa-MSFT answered OuryBa-MSFT commented

Hello @Csar-6596 Thanks for being patient while working on this. Could you please create a login like test@test@xxxxxxx.database.windows.net that should map. Please let us know if that works.

If that helps please accept answer so it can be beneficial for others community members facing the same issue.

Regards,
Oury

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your answer. It works if I create the login including the sufix, but I was expecting to be able to keep logins as original emails. If this it's the only option, it's cleaner for me to replace the @ with 2 consecutive dots, as this solution is not attached to the instance name. Thank you.

 CREATE LOGIN [test@test@**********.database.windows.net] WITH PASSWORD = 'X', DEFAULT_LANGUAGE = Español;


1 Vote 1 ·

@Csar-6596 I am glad that resolve your issue.

Regards,
Oury

0 Votes 0 ·