【问题标题】:Timeout while uploading files to azure storage将文件上传到 Azure 存储时超时
【发布时间】:2018-02-16 04:16:50
【问题描述】:

使用 Powershell 将 zip 文件上传到 Azure 存储时出现超时错误

使用的命令:

$context = New-AzureStorageContext -StorageAccountName 
storageaccount -StorageAccountKey "SomeKey"

Set-AzureStorageBlobContent -Blob storageaccount -Container 
artifactscontainer "F:\ABC\DEF\DEF.zip" -Context $context -Force

我得到的错误是:

Set-AzureStorageBlobContent : The client could not finish the operation within specified timeout.

注意:

文件大小为 50 MB

【问题讨论】:

  • 您是否尝试过设置默认超时间隔?

标签: powershell azure blob azure-storage


【解决方案1】:

如果您使用的是早于 4.3.1 的 Azure PowerShell 模块,请从 here 下载最新的模块,然后重试该操作并告诉我它是如何进行的。

【讨论】:

  • 即使安装了最新的模块也没有用:(
【解决方案2】:

根据您的错误,此问题可能是由您的 Blob 服务操作的默认超时间隔异常引起的。

确保您的本地网络正常并且您的防火墙允许此流量。然后你可以使用试试这个解决方案: 你可以使用

-ClientTimeoutPerRequest 指定一个服务请求的客户端超时间隔,以秒为单位。如果上一个调用在指定的时间间隔内失败,则此 cmdlet 会重试请求。如果此 cmdlet 在间隔过去之前未收到成功响应,则此 cmdlet 将返回错误。您可以将超时时间从 90 秒增加到 600 秒。

示例:

Set-AzureStorageBlobContent -Blob storageaccount -Container artifactscontainer "F:\ABC\DEF\DEF.zip" -ClientTimeoutPerRequest <Int32> -Context $context -Force

更多关于-ClientTimeoutPerRequest,参考这个官方文档:https://docs.microsoft.com/zh-cn/powershell/module/azure.storage/set-azurestorageblobcontent?view=azurermps-4.3.1#optional-parameters

有关设置 blob 服务操作的默认超时的更多信息,请参阅此文档:https://docs.microsoft.com/zh-cn/rest/api/storageservices/setting-timeouts-for-blob-service-operations

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-30
    • 2014-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-24
    • 2017-08-19
    • 2017-01-04
    相关资源
    最近更新 更多