Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login failed for user '<token-identified principal>' Error 18456 while deploying database from on-premises to Azure SQL database Through SSMS #124971

Open
AmareswarapuBhavani opened this issue Nov 29, 2024 · 2 comments

Comments

@AmareswarapuBhavani
Copy link

AmareswarapuBhavani commented Nov 29, 2024

Document Enhancement Proposal: Unable to 'Deploy Database to Microsoft Azure SQL Database' from SSMS.

Overview:

Getting below error while deploying on-premises SQL database to Azure SQL database:

Login failed for user '<token-identified principal>' Error 18456

Correction Details:

This guide will allow users to:

Handle the above error and will help to get the activity error details.

Steps:

Reason for the error:

>ConnectionError: Login failed for user 'token-identified-principal'.

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.

Steps to avoid this 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:

enter image description here

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:

enter image description here

Deployed database:

enter image description here

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

Conclusion:

By following this guide, users can avoid the above error.

Reference:

Login failed for user '' Error 18456 On Deploy Database

This Document creation request aims to improve user experience and security by providing clear documentation.


title: Create a single database
author: @WilliamDAssafMSFT
ms.author: @wiassaf
ms.reviewer: @MaThoma, @randolphwest
ms.service: azure-sql-database
ms.subservice: deployment-configuration

@PesalaPavan
Copy link
Contributor

@AmareswarapuBhavani
Thanks for your feedback! We will investigate and update as appropriate.

@TPavanBalaji
Copy link
Contributor

@AmareswarapuBhavani
Thank you for bringing this to our attention.
I've delegated this to content author, who will review it and offer their insightful opinions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants