< Back

New-AzureSQLDbOwner

Mon Jan 13, 2020 7:13 pm

NAME New-AzureSQLDbOwner



SYNOPSIS

Generates a user/password pair for Azure SQL authentication and adds that user as a dbowner for the target

database.





SYNTAX

New-AzureSQLDbOwner [-SqlDbName] <String> [-SqlDbUser] <String> [-SqlDbPwd] <String> [-KeyVaultName] <String>

[<CommonParameters>]





DESCRIPTION

Generes a user/password pair for Azure SQL authentication and adds that user as a dbowner for the target database.

It then uploads the generated pair to keyvault with relevant tags applied.





PARAMETERS

-SqlDbName <String>

The name of the Azure SQL database that we want to add the new dbowner user to.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SqlDbUser <String>

The Azure SQL username to use as login to create the generated user.

This user needs to be sa in the database.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SqlDbPwd <String>

The Azure SQL password to use as login to create the generated user.

This user needs to be sa in the database.



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-KeyVaultName <String>

The name of the keyvault where we are adding the generated username/password pair.



Required? true

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-AzureSQLDbOwner -SqlDbName my-sql-db -SqlDbUser my-SqlSaUser -SqlDbPassword my-SqlSaPwd -KeyVaultName

my-keyvault



Will generated a username/password pair and add is as a dbowner for my-sql-db database. It will use

my-SqlSaUser/my-SqlSaPwd

to create the new user, this needs to be an sa user with access to the master database.











RELATED LINKS