Why am I getting an exception. Is the Azure WebJobs SDK Dashboard connection string missing or empty when it is not empty at all?

I have the simplest webjobs SDK example that should start when a new file is placed in the blob input container and copies it to another.

Below is the code and the App.config file with the account name and key that was intentionally changed to XXX.

The problem is that when I run this locally, I get an exception below.

Fix System.InvalidOperationException was unhandled HResult = -2146233079 Message = Microsoft Azure WebJobs SDK The dashboard connection string is missing or empty.

I already tried:

  • Create the variable JobHostConfiguration and configure the connection string there. I get the same error.
  • By publishing this actual Azure WebJob and placing the connection string in the configuration of the Azure Portal website, I get the same error in Job logs. Note that the job mode was set to Continuous, and the AlwaysOn parameter was set to webapp.
  • Enter connection information in the appSetting entry instead of the connectionStrings link. I saw him in one place on the blog, still not working.
  • Use UseDevelopmentStorage in the connection string, but it complains that the Azure Storage emulator is not supported.

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 I don't like the fact that I used to have a lot of complex scripts running on this machine.

At this moment I am at a loss. Any help is much appreciated, thanks.

the 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>
+4
2

. , 2 . Dashboard AND Storage.

- Storage vs Dashboard, , , 2 .

AzureWebJobsStorage .

+3

JobHostConfiguration.

class Program
{
    static void Main()
    {
        //Configure JobHost
        var storageConnectionString = "your_connection_string"; //You can load this from .config file obviously
        var config = new JobHostConfiguration(storageConnectionString);

        //Pass configuration to JobJost
        var host = new JobHost(config);
        // The following code ensures that the WebJob will be running continuously
        host.RunAndBlock();
    }
}

, .

+1

Source: https://habr.com/ru/post/1654499/


All Articles