Hi Yochanan,
I am trying to setup this database maintenance job using Runbooks and I am getting the following errors and I am new to Azure and its not clear why I am getting these two errors. Our server is set to allow remote connections and the server does exist. Could you share your thoughts? Thanks for the help.
Error 1:
AzureSQLServerName : The term 'AzureSQLServerName' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ AzureSQLServerName = "*****.database.window ...
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (AzureSQLServerName:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
2nd error:
Invoke-Sqlcmd : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.) At line:6 char:16 + ... LOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Userna ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException + FullyQualifiedErrorId : SqlExceptionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Thanks,
Kumar.