Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 911
TaintedLemon Avatar asked Mar 28 '14 21:03

TaintedLemon


People also ask

How do I connect to Azure storage emulator?

To start the Azure Storage Emulator: Select the Start button or press the Windows key. Begin typing Azure Storage Emulator . Select the emulator from the list of displayed applications.

What is my Azure storage connection string?

A connection string includes the authorization information required for your application to access data in an Azure Storage account at runtime using Shared Key authorization. You can configure connection strings to: Connect to the Azurite storage emulator. Access a storage account in Azure.

How do I use Azure connection string?

Connection String within the Azure PortalOpen the Azure Portal via https://portal.azure.com. Navigate to the Azure App Service Web App within the portal. Under Settings open up the Configuration option. The Connection strings section can be used to manage the settings for the application.


1 Answers

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

like image 181
Amit Apple Avatar answered Nov 15 '22 23:11

Amit Apple