无法启动 WebJob - "Azure Storage Emulator is not supported"
Unable to start WebJob - "Azure Storage Emulator is not supported"
在开发 Azure WebJob 时遇到异常
Failed to validate Microsoft Azure WebJobs SDK Storage account. The
Microsoft Azure Storage Emulator is not supported, please use a
Microsoft Azure Storage account hosted in Microsoft Azure.'
这似乎很常见,解决方案通常是将连接字符串更新为 a specific value。但是,就我而言,我已经有了这个特定的连接字符串。
此外,我在同一个解决方案中有两个 WebJob:我在这两种情况下使用完全相同的连接字符串,另一个 WebJob 连接没有任何问题。
在App.config我有
<connectionStrings>
<add name="AzureWebJobsDashboard" connectionString="DefaultEndpointsProtocol=https;AccountName= ... ;AccountKey= ... " />
<add name="AzureWebJobsStorage" 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;" />
</connectionStrings>
相同的连接字符串出现在 appSettings:
<appSettings>
<add key="StorageConnectionString" value="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;" />
<!--<add key="StorageConnectionString" value="UseDevelopmentStorage=true" />-->
</appSettings>
我发现输入 UseDevelopmentStorage=true
没有任何区别。
我也试过在 static void Main
:
中手动声明这些
var config = new JobHostConfiguration {
JobActivator = new WebJobActivator(kernel)
};
config.DashboardConnectionString = "DefaultEndpointsProtocol=https;AccountName= ... ;AccountKey= ... ";
config.StorageConnectionString = "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;";
当我这样做时,异常会被抛出
config.StorageConnectionString = ...
我正在 运行ning v5.2 的 Azure 存储模拟器 - 它 是 运行ning。就像我说的,另一个 WebJob 能够连接 运行 没有任何问题,并且它们都有相同的 App.config 文件。
我还注释掉了 WebJob 中的所有其他代码,因此它应该做的就是尝试启动并连接到队列。
最后,即使我声明了实时存储的连接字符串,我仍然会遇到同样的异常。
为什么?这些连接细节有什么问题?
检查您是否 运行 Microsoft.Azure.WebJobs v1.x 或更早。我记得在 Microsoft.Azure.WebJobs 包的 v1.x 中,不支持使用 AzureWebJobsDashboard 或 AzureWebJobsStorage 的模拟器(我不记得哪个不受支持)。直到 >= v2.x 你才可以使用模拟器来获得这些键。
在开发 Azure WebJob 时遇到异常
Failed to validate Microsoft Azure WebJobs SDK Storage account. The Microsoft Azure Storage Emulator is not supported, please use a Microsoft Azure Storage account hosted in Microsoft Azure.'
这似乎很常见,解决方案通常是将连接字符串更新为 a specific value。但是,就我而言,我已经有了这个特定的连接字符串。
此外,我在同一个解决方案中有两个 WebJob:我在这两种情况下使用完全相同的连接字符串,另一个 WebJob 连接没有任何问题。
在App.config我有
<connectionStrings>
<add name="AzureWebJobsDashboard" connectionString="DefaultEndpointsProtocol=https;AccountName= ... ;AccountKey= ... " />
<add name="AzureWebJobsStorage" 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;" />
</connectionStrings>
相同的连接字符串出现在 appSettings:
<appSettings>
<add key="StorageConnectionString" value="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;" />
<!--<add key="StorageConnectionString" value="UseDevelopmentStorage=true" />-->
</appSettings>
我发现输入 UseDevelopmentStorage=true
没有任何区别。
我也试过在 static void Main
:
var config = new JobHostConfiguration {
JobActivator = new WebJobActivator(kernel)
};
config.DashboardConnectionString = "DefaultEndpointsProtocol=https;AccountName= ... ;AccountKey= ... ";
config.StorageConnectionString = "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;";
当我这样做时,异常会被抛出
config.StorageConnectionString = ...
我正在 运行ning v5.2 的 Azure 存储模拟器 - 它 是 运行ning。就像我说的,另一个 WebJob 能够连接 运行 没有任何问题,并且它们都有相同的 App.config 文件。
我还注释掉了 WebJob 中的所有其他代码,因此它应该做的就是尝试启动并连接到队列。
最后,即使我声明了实时存储的连接字符串,我仍然会遇到同样的异常。
为什么?这些连接细节有什么问题?
检查您是否 运行 Microsoft.Azure.WebJobs v1.x 或更早。我记得在 Microsoft.Azure.WebJobs 包的 v1.x 中,不支持使用 AzureWebJobsDashboard 或 AzureWebJobsStorage 的模拟器(我不记得哪个不受支持)。直到 >= v2.x 你才可以使用模拟器来获得这些键。