Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
New AzureStorageContainer:远程服务器返回错误:(403)powershell中禁止_Azure_Azure Storage_Azure Powershell_Azure Storage Emulator - Fatal编程技术网

New AzureStorageContainer:远程服务器返回错误:(403)powershell中禁止

New AzureStorageContainer:远程服务器返回错误:(403)powershell中禁止,azure,azure-storage,azure-powershell,azure-storage-emulator,Azure,Azure Storage,Azure Powershell,Azure Storage Emulator,问题 我开始使用azure blob存储,因此请跟随我开始使用。我正在尝试本地连接到存储模拟器,并使用Powershell尝试创建一个新容器,但在使用以下脚本时 $context = New-AzureStorageContext -StorageAccountName "devstoreaccount1" -StorageAccountKey "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/K

问题

我开始使用azure blob存储,因此请跟随我开始使用。我正在尝试本地连接到存储模拟器,并使用Powershell尝试创建一个新容器,但在使用以下脚本时

$context = New-AzureStorageContext -StorageAccountName "devstoreaccount1" -StorageAccountKey "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
New-AzureStorageContainer "sascontainer" -Permission Off -Context $context
$now = Get-Date
New-AzureStorageContainerSASToken -Name "sascontainer" -Permission rwdl -ExpiryTime $now.AddHours(-1.0) -Context $context -FullUri
我得到这个信息:

New AzureStorageContainer:远程服务器返回错误:(403)禁止。HTTP状态代码:403-HTTP错误消息:服务器无法验证请求。 确保包括签名在内的授权标头的值格式正确

我所做的

  • 已检查azureStorageEmulator.exe.config
导致我检查模拟器设置的时间(为此我调用了
http://127.0.0.1:10000/devstoreaccount1/sascontainer
)。响应是一个错误,但这表明emulator设置为UTC时间,比我的计算机时间晚1小时,这是我在脚本中允许的

  • 下载Microsoft Azure storage explorer并通过该工具成功连接。我试图在这个工具中寻找一些有用的东西来帮助我,但无法做到这一点

  • 问题
    如何通过powershell连接azure storage emulator要访问storage emulator,我们可以使用新AzureStorageContext-Local 或者
    新建AzureStorageContext-ConnectionString“UseDevelopmentStorage=true”

    有了更多详细信息,我们还可以使用设置
    -ConnectionString

    "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;"
    
    像您这样只指定StorageAccountName和StorageAccountKey就是访问
    http://devstoreaccount1.blob.core.windows.net
    在线。因为默认情况下,服务端点是
    ://您提到的


    和的参考。

    我有相同的问题,但在您对问题的描述中找到了解决方案。 我所需要的就是调整时间(先关闭,然后打开自动时间调整)

    在我的例子中,同样的PowerShell脚本,昨天起作用的东西今天就不起作用了。 发生了什么变化?事实上,我刚刚重新启动了我的笔记本电脑,登录了我的ubuntu帐户,然后又重新启动了windows。它把时间变换了好几个小时。我知道这个错误,但通常我不太关心它。
    但在使用在线服务时,可能会导致类似的身份验证问题。

    我的建议对您有用吗?如果是这样,你可以接受它,或者如果你有进一步的问题,只要问。嗨,这个问题是一个正在进行的项目的一部分,我将很快再次工作。一旦我试过了,我会让你知道的。不着急,只要在你方便的时候回复就行了。