Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Make sure that you are connected to the master database and the user you will create has access to read the metadata.

Code Block
USE [master]
GO
CREATE LOGIN [datical_login] WITH PASSWORD=N'password_goes_hereN'
GO
GRANT VIEW SERVER STATE to [datical_login]
GO
Info

The default Azure password complexity rules are the following: minimum length of 8 characters, minimum of 1 uppercase character, minimum of 1 lowercase character, minimum of 1 number.

...

Role/Permission

When is this required?

Permissions

db_owner

This is required if you need to perform all configuration and some maintenance activities on the database.

Manage fixed-database role membership, configuration, and maintenance activities.

db_ddladmin  

This is required if do not connect as the database owner.

Run any Data Definition Language (DDL) command in a database.

db_datawriter

This is required if you do not connect as the database owner.

Add, delete, or change data in all user tables.

db_datareader

This is required if do not connect as the database owner.

Read all data from all user tables.

db_loginmanager

This is required if grants are allowed in scripts. If you have this role, you can create and delete logins in the virtual master database.      

Perform grants to all objects in the database.

VIEW DATABASE STATE

This is required for Datical operations.

Read data from dynamic management views scoped to the database.

...

Code Block
USE [database_1]
GO
CREATE USER [datical_user] FOR LOGIN [datical_login]
GO
EXEC sp_addrolemember N'db_ddladmin', N'datical_user'
GO
EXEC sp_addrolemember N'db_datareader', N'datical_user'
GO
EXEC sp_addrolemember N'db_datawriter', N'datical_user'
GO
EXEC sp_addrolemember N'db_loginmanager', N'datical_user'
GO
GRANT VIEW DATABASE STATE to [datical_user]
GO
ALTER SERVER ROLE [db_owner] ADD MEMBER [datical_user]
GO

Example script to assign additional roles to datical_user for the reference database environments and packaging only:

...