Login failed for user '<token-identified principal>' Error 18456 On Deploy Database - Stack Overfl

From SSMS 2017 I right click the database, then select Tasks->Deploy Database to Microsoft Azure SQL

From SSMS 2017 I right click the database, then select Tasks->Deploy Database to Microsoft Azure SQL database.

In the Wizard Deployment Settings screen, I click "Connect" and log in to my Azure SQL Server:

Then I click "Next" and get this error:

This question explains the need to grant the user access to the database. But we are creating a new database here.

Update I am connecting as the admin

Under Access control (IAM) -> Check access -> View my access I can see that I have Owner as a current role assignment

However when I click Eligible assignments I see

Activate a role to perform operations that require elevated permissions. The role will remain active for a limited time.

and

The tenant needs to have Microsoft Entra ID P2 or Microsoft Entra ID Governance license.

From SSMS 2017 I right click the database, then select Tasks->Deploy Database to Microsoft Azure SQL database.

In the Wizard Deployment Settings screen, I click "Connect" and log in to my Azure SQL Server:

Then I click "Next" and get this error:

This question explains the need to grant the user access to the database. But we are creating a new database here.

Update I am connecting as the admin

Under Access control (IAM) -> Check access -> View my access I can see that I have Owner as a current role assignment

However when I click Eligible assignments I see

Activate a role to perform operations that require elevated permissions. The role will remain active for a limited time.

and

The tenant needs to have Microsoft Entra ID P2 or Microsoft Entra ID Governance license.

Share Improve this question edited Nov 17, 2024 at 0:57 Kirsten asked Nov 15, 2024 at 20:09 KirstenKirsten 18.3k50 gold badges209 silver badges361 bronze badges 1
  • Ensure you user has necessary permissions to create database. – Bhavani Commented Nov 16, 2024 at 5:56
Add a comment  | 

1 Answer 1

Reset to default 1

According to the MS document

CREATE DATABASE permissions are necessary. To create a database a login must be either the server admin login (created when the Azure SQL Database logical server was provisioned), the Microsoft Entra admin of the server, a member of the dbmanager database role in master

The user who you provided is not having the necessary permissions to create database. That may be the reason to get above error. If you are using Entra user to login to SQL server, make sure your Entra user is set as server admin, otherwise set server admin as shown below in SQL server:

If the user is from external provider, add dbmanager role to the user in master db using below command:

ALTER ROLE dbmanager ADD MEMBER <user>;

Then you will be able to deploy the database successfully as shown below:

Deployed database:

Note: Use latest version of SSMS i.e. SSMS v20.2, it will work.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745672748a4639505.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信