【发布时间】:2020-04-18 00:15:22
【问题描述】:
我正在使用 Invoke-Sqlcmd 从 Azure 存储文件共享中获取 -InputFile。我正在使用 Get-AzureStorageFileContent 从 Azure 存储中获取文件,但出现以下错误。感谢您提供任何帮助或见解。
Get-AzureStorageFileContent :远程服务器返回错误:(404) 未找到。 HTTP 状态代码:404 - HTTP 错误消息:指定的资源不存在。 在 line:35 char: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
【问题讨论】:
-
Invoke-Sqlcmd在这里无关紧要。失败的事情Get-AzureStorageFileContent。我建议您编辑标题以反映真正的问题 -
您是否已经设置了文件共享
$azureFileShare? -
@Nick.McDermaid 我已经更新了标题。是的,文件共享已经设置好了。
标签: powershell azure-storage-files invoke-sqlcmd