I have the most simple example of the webjobs SDK, that is supposed to trigger when a new file is put on an input blob container and copy it to another one.
Below are the code and the App.config, with the account name and key redacted to XXX intentionally.
The problem is that when I run this locally, I get the exception below.
System.InvalidOperationException was unhandled HResult=-2146233079 Message=Microsoft Azure WebJobs SDK Dashboard connection string is missing or empty.
I have already tried:
I just installed the latest version of the SDK today (2.9, I believe?). This is a new machine and I'm just learning Azure and WebJobs, so it's not like I've gotten a lot of complex scenarios working on this machine before.
At this point, I'm at a loss. Any help is greatly appreciated, thank you.
Code:
using Microsoft.Azure.WebJobs;
using System.IO;
namespace TestWebJob1
{
class Program
{
static void Main(string[] args)
{
JobHost host = new JobHost();
host.RunAndBlock();
}
public static void CopyCopy([BlobTrigger("testinput/{name}")] TextReader input, [Blob("testoutput/{name}")] out string output)
{
output = input.ReadToEnd();
}
}
}
App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="AzureWebJobsDashboard" connectionString="DefaultEndpointsProtocol=https;AccountName=XXXX;AccountKey=XXX" />
</connectionStrings>
</configuration>
Very silly. Turns out there are 2 connection strings needed. Dashboard AND Storage.
Since the only difference in the exception text is the word Storage vs Dashboard, I was not really reading the whole text and didn't realize until a read a few more blog posts that there are 2 connections needed.
Adding the connection string with name AzureWebJobsStorage fixed the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With