What is the connection string to use Azure Storage Emulator with a Webjob?

风流意气都作罢 提交于 2019-12-06 23:04:36

问题


I have a simple WebJob which I wish to test with the Azure Storage Emulator.

I currently have set the AzureJobsRuntime and AzureJobsData set to use development storage as follows:

<connectionStrings>
    <add name="AzureJobsRuntime" connectionString="UseDevelopmentStorage=true;" />
    <add name="AzureJobsData" connectionString="UseDevelopmentStorage=true;" />
</connectionStrings>

The webjob is very simple:

public static void Main(string[] args)
{
    JobHost host = new JobHost();
    host.RunAndBlock();
}

public static void Process([QueueInput("queue")] string input, [BlobOutput("containername/blobname")]TextWriter writer)
{

}

This throws an exception on startup:

InvalidOperationException:

Windows Azure Storage account connection string is not formatted correctly

I have been able to create the queue and add messages to it from a website using the same connection string and the CloudStorageAccount class.


回答1:


Unfortunately the WebJobs SDK does not support using Azure storage emulator as some features it uses are not supported by this emulator.



来源:https://stackoverflow.com/questions/22723561/what-is-the-connection-string-to-use-azure-storage-emulator-with-a-webjob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!