Hello
I need to run an azure runbook from azure automation account against an azure database for mysql.
I enabled "Run as an Account" option and added SQL Server module at automation account. I created credentials for azure database for mysql.
The SQL script is located in an Azure File Share folder.
The runbook script looks like this
$AzureSQLServerName = "XXXXXX.mysql.database.azure.com"
$AzureSQLDatabaseName = "XXXXXXX"
$AzureSQLInputFilePath = "https://XXXXX.file.core.windows.net/XXXXXXXXXX/XXXXXXXXXXXXXXXX.sql"
$Cred = Get-AutomationPSCredential -Name "XXXXXXXXX"
$SQLOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Username $Cred.UserName -Password $Cred.GetNetworkCredential().Password -Database $AzureSQLDatabaseName -InputFile $AzureSQLInputFilePath) 4>&1
Write-Output $SQLOutput
But I receive this error message :
Invoke-Sqlcmd : The given path's format is not supported. At line:7 char:16 + ... LOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Userna ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidResult: (............mysql.database.azure.com:PSObject) [Invoke-Sqlcmd], NotSupportedException + FullyQualifiedErrorId : ExecutionFailed,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
It seems request is valid for azure sql server but not for azure database for mysql.