I am creating a continues webjob and want to see each function call from the dashboard(from https://xxx.scm.azurewebsites.net/azurejobs/#/jobs/continuous/xxx). I understand that I need to set the AzureWebJobsDashboard on portal as connection string.
I also believe that this could be set in the code throught DashboardConnectionString in JobHostConfiguration class. After doing that I can see azure-jobs-host-output and azure-webjobs-hosts in the storage account, but I am still seeing the missing AzureWebJobsDashboard warning on xxx.scm.azurewebsites.net, not be able to see each triggered function call log. I am sure that the connection string value is same when I set in as AzureWebJobsDashboard on portal config.
The reason I want to configure this in code is that we store webjobDashboardConnectionString and webjobStorageConnectionString in key vault and want to rotate them. And I don't want to maintain a app.config, so I don't have connection string field in app.config.
here is the code that shows how I implement this.
Am I missing something here? Since I searched around and didn't see anyone else asking this.
var config = new JobHostConfiguration();
config.DashboardConnectionString = webjobDashboardConnectionString;
config.StorageConnectionString = webjobStorageConnectionString;
ServiceBusConfiguration serviceBusConfig = new ServiceBusConfiguration
{
ConnectionString = serviceBusConnectionString
};
config.UseServiceBus(serviceBusConfig);
config.NameResolver = new ServiceBusQueueNameResolver();
var host = new JobHost(config);
host.RunAndBlock();
I know that connection strings and application settings are environment variables for webjob, and I do print them by
Console.WriteLine("getting dashboard env var: {0}", Environment.GetEnvironmentVariable("CUSTOMCONNSTR_AzureWebJobsDashboard"));
Can I set the environment variable directly?
I haven't try this out but just thought about this.
Microsoft.Azure.WebJobs, Version=2.2.0.0
Microsoft.Azure.WebJobs.Host, Version=2.2.0.0
Microsoft.Azure.WebJobs.ServiceBus, Version=2.2.0.0
I am experiencing the same, but I set the connection strings in the appsettings.json file.
It would seem that the check is performed only for connection strings set in the azure portal.
The check should really cover all possible places where these values can be set. Or just remove it.
It's quite disconcerting seeing a warning and an error for the same thing every time I look at the dashboard.
Is there any solution here?
Is there any solution here?
I am using the workaround, 'Application settings' -> 'Connection strings', create a variable called 'AzureWebJobsDashboard', use 'Custom' type, and remove last section of your connection string which is ';EndpointSuffix=core.windows.net'.
And at the same time, I still have the code "config.DashboardConnectionString = webjobDashboardConnectionString;", not sure if this effect anything
Is there any update on this? or this might be a SDK version issue?
If you didn't set up this field in the webjob, you will get following error msg:
Unhandled Exception: System.InvalidOperationException: A host ID is required. Either set JobHostConfiguration.HostId or provide a valid storage connection string. ---> System.InvalidOperationException: Microsoft Azure WebJobs SDK 'Storage' connection string is missing or empty. The Microsoft Azure Storage account connection string can be set in the following ways:
- Set the connection string named 'AzureWebJobsStorage' in the connectionStrings section of the .config file in the following format
, or - Set the environment variable named 'AzureWebJobsStorage', or
- Set corresponding property of JobHostConfiguration.
I believe 1 and 3 doesn't work well, at least in the SDK version that I use.
It still doesn't work. Setting the _config.DashboardConnectionString_ value has no effect on the Kudu dashboard. Is there any QA out there or we are the first few people who have ever used this setting?
There is another report https://stackoverflow.com/a/51217978