Azure Automation Powersell Runbook fails: 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet
Follow that blog, I reproduced your error.
You can deploy sqlserver module via this page:
Here is my runbook:
$AzureSQLServerName = "jasonsql"$AzureSQLDatabaseName = "jasondatabase"$AzureSQLServerName = $AzureSQLServerName + ".database.windows.net"$Cred = Get-AutomationPSCredential -Name "SQLLogin"$SQLOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Username $Cred.UserName -Password $Cred.GetNetworkCredential().Password -Database $AzureSQLDatabaseName -Query "SELECT * FROM INFORMATION_SCHEMA.TABLES " -QueryTimeout 65535 -ConnectionTimeout 60 -Verbose) 4>&1Write-Output $SQLOutput
Here is the result:
Hope this helps.