我正在使用 Invoke-Sqlcmd 从 Azure 存储文件共享中获取 -InputFile。我正在使用 Get-AzureStorageFileContent 从 Azure 存储中获取文件,但出现以下错误。任何帮助或见解表示赞赏。
Get-AzureStorageFileContent :远程服务器返回错误:(404)未找到。HTTP 状态代码:404 - HTTP 错误消息:指定的资源不存在。在行:35 字符:1
下面是 Powershell 脚本:
$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