gre*_*eat 3 azure azure-functions
我正在开始使用Azure功能进行开发.我已经能够连接到我的实际azure存储帐户队列,以测试如何使用Azure功能进行编程.现在我的下一步是使用Microsoft Azure存储资源管理器来使用本地存储帐户,这样我就不必连接到azure了.我在本文中看到了如何操作:https://docs.microsoft.com/en-us/azure/storage/storage-configure-connection-string#create-a-connection-string-to-the-storage-模拟器
in the appsettings.json I changed my values to this exactly:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
"AzureWebJobsDashboard": "",
"StorageConnectionString": "UseDevelopmentStorage=true"
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用Visual Studio启动Azure Fuctions CLI时,我收到以下错误消息:
ScriptHost初始化失败Microsoft.WindowsAzure.Storage:远程服务器返回错误:(403)Forbidden.
有没有遇到过这个?
请更改以下代码行:
"AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
Run Code Online (Sandbox Code Playgroud)
要么:
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
Run Code Online (Sandbox Code Playgroud)
要么:
"AzureWebJobsStorage": "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;"
Run Code Online (Sandbox Code Playgroud)
这应该照顾403错误.
基本上,存储模拟器具有与云存储帐户不同的端点.例如,云存储帐户的默认blob端点为http:// [youraccount] .blob.core.windows.net,而存储模拟器的blob端点为http://127.0.0.1:10000.当您只在连接字符串中指定存储模拟器的存储帐户名称和密钥时,存储客户端库会将其视为云存储帐户,并尝试使用该帐户连接到http://devstoreaccount1.blob.core.windows.net你提供的关键.由于云中devstoreaccount1的密钥不是您提供的密钥,因此您收到403错误.
| 归档时间: |
|
| 查看次数: |
1380 次 |
| 最近记录: |