In this post we will connect Azure SQL Database using PowerShell.
I assume that you have a Azure Database Created using Azure Portal and the login information which was provided at the time of database creation.
Import Azure PowerShell Module.
import-module ‘C:Program Files (x86)Microsoft SDKsAzurePowerShellServiceManagementAzureAzure.psd1’
Azure SQL Database can only be accessed using SQL Server Authentication
#Create Azure SQL Database server connection context
# Define a SQL Database server credential – Specify the username, and password in the Popup dialog
$cred=Get-Credential
$sqlDatabaseServerNameFQDN=’faw5udm867.database.windows.net’
$ctx=New-AzureSqlDatabaseServerContext -FullyQualifiedServerName $sqlDatabaseServerNameFQDN -Credential $cred
Get-AzureSqlDatabase -ConnectionContext $ctx | SELECT Name,CollationName,Edition,MaxSizeGB,Createdate |Format-Table