Connect to Azure WebJob Storage

I have these connection strings in my App.config for Azure WebJob

<add name="AzureWebJobsDashboard" connectionString="UseDevelopmentStorage=true"/>
<add name="AzureWebJobsStorage" connectionString="UseDevelopmentStorage=true"/>

      

because I want it to be the default for the Azure Storage Emulator for developers. However, when these WebJobs are used on Azure, they still seem to point to local storage, even though I set up these connection strings in the Azure Portal interface:

App settings for Azure Portal apps

I am assuming it is still pointing to local storage because I am getting this error:

Microsoft.WindowsAzure.Storage.StorageException: Unable to connect to remote server ---> System.Net.WebException: Unable to connect to remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket that it denied access permissions 127.0.0.1:10001 in System.Net.Sockets.Socket.DoConnect (EndPoint endPointSnapshot, SocketAddress socketAddress) in System.Net.ServicePoint.ConnectSocketInternal (Boolean connectFailure, Socket s4, Socket s6, Socket & socket, IPAddress & address, ConnectSocketState, IAsyncResult asyncResult, Exception and Exception)

in our protocol, right at the first point, we are trying to connect to Azure Storage.

Am I missing something? Have I set up the connection strings for the WebJobs correctly? How do I set them as the default for developer local storage, but you have a real connection string for an app running in Azure?

+3


source to share


1 answer


First, I'm pretty sure that the configurations in the Azure portal take precedence over the configurations in web.config / app.config.

As per the image you uploaded, I saw that you have selected Event Hub and SQL Database types for Azure Storage connection strings. When choosing Event Hub type for your Azure Storage connection string, you will have some problems, please change the connection type to Custom to fix this issue.

enter image description here



You can print the connection strings in your WebJob to confirm this.

var host = new JobHost(config);

Console.WriteLine(config.DashboardConnectionString);
Console.WriteLine(config.StorageConnectionString);

      

+1


source







All Articles