Get-AzSqlElasticPool : No account found in the context

Tried to run the below code using Azure Devops powershell task however it gives me error as

Get-AzSqlElasticPool : No account found in the context. Please login using Connect-AzAccount

. Please help me resolve it

Set-AzSqlElasticPool -ResourceGroupName “$rgName” -ServerName “$serverName” -ElasticPoolName “$elasticpoolName” -VCore $vCore

if ($false -eq $?)
{
Write-Error “Msbuild exit code indicate script failure.”
Write-Host “##vso[task.logissue type=error]Msbuild exit code indicate script failure.”
exit(1)
}

The error tells you exactly what to do, use connect-azaccount to log in.

1 Like

This is what I was getting when I used Connect-AzAccount

Connect-AzAccount : Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from…

This got resolved when I used Azure PowerShell task instead of PowerShell.

Thanks krzydoug for your reply

Glad you got it going!