How to Connect to Azure SQL Databases using Access Token in Powershell

preview_player
Показать описание
Join this channel to get access to perks:

Join the Telegram Group for the scripts and assistance:

To Download the scripts follow the video

We strongly believe there is always chance of betterment, so suggestions are most welcome.

Happy learning, and All the Best in your professional journey!

The journey of improvement is ongoing and never be an end.

Connect With me,

#azuresql #azure #sqldba #sqlserverdba #sql #sqlserver #sqlserverdeveloper #performance #performancetuning #performanceoptimization #mssql #mssqlserver #mssqlserverdba

Thank you!
MS SQL DBA Tech Support
Рекомендации по теме
Комментарии
Автор

Connect-AzAccount


$tenantId = "give your values"
$clientId = " give your values "
$clientSecret = "give your values"

# Get the access token
$body = @{
grant_type = "client_credentials"
client_id = $clientId
client_secret = $clientSecret
}

$token = $tokenResponse.access_token
Invoke-SqlCmd -ServerInstance "give your values.database.windows.net" -Database "Master" -AccessToken $token -Query "select * from sys.databases"

MSSQLDBATechSupport
visit shbcf.ru