I am using Invoke-Sqlcmd to pick up -InputFile from an Azure Storage File share. I am using the Get-AzureStorageFileContent to get the file from Azure Storage but getting the error below. Any help or insight is appreciated.
Get-AzureStorageFileContent : The remote server returned an error: (404) Not Found. HTTP Status Code: 404 - HTTP Error Message: The specified resource does not exist. At line:35 char:1
Below is the Powershell script:
$ctx = New-AzureStorageContext -StorageAccountName $azureStorageAccount -StorageAccountKey $storageKey
Get-AzureStorageFileContent -ShareName $azureFileShare -Path $azureFilePath -Destination $destination -Context $ctx
# Set Connection parameters
$params = @{
'Database' = $Database
'ServerInstance' = $ServerInstance
'Username' = $dbusername
'Password' = $dbpassword
'InputFile' = $ctx+'\'+$scriptFile
}
Invoke-Sqlcmd @params