6

I would like to know about JobHostConfiguration on Azure WebJobs SDK. Where I can find the config ? is it on app.config ?

How can JobHostConfiguration identified this is IsDevelopment or not ? I cannot find it on app.config

What config that JobHostConfiguration read ?

Thank You

Adityo Setyonugroho
  • 877
  • 1
  • 11
  • 29

1 Answers1

7

Where I can find the config ? is it on app.config ?

Yes, it is in app.config file. You also could add some new configs manually in this file.

How can JobHostConfiguration identified this is IsDevelopment or not ?

It depends on whether the JobHost is running in a Development environment. The default value is false. If you want it to be true, you could add the following code in app.config file to let the JobHost run in a Development environment. And you could read this article to learn more about this configuration.

<appSettings>
    <add key="AzureWebJobsEnv" value="Development"/>
</appSettings>

The result is like this:

enter image description here

What config that JobHostConfiguration read ?

It could read many information of config, such as the connection string of Azure Web Jobs. You could click New Project>Cloud>choose Azure WebJob to create a Web Jobs to try.

Read connection string in app.config file:

<connectionStrings>
    <!-- The format of the connection string is "DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY" -->
    <!-- For local execution, the value can be set either in this config file or through environment variables -->
    <add name="AzureWebJobsDashboard" connectionString="your storage connection string" />
    <add name="AzureWebJobsStorage" connectionString=" your storage connection string " />
  </connectionStrings>

enter image description here

Janley Zhang
  • 1,567
  • 7
  • 11
  • Thank you for your amazing explanation. I get it clearly, you are amazing haha. I was exploring by using sample Azure WebJobs on Visual Studio, it was confusing a bit for first timer exploring some config and flow. And regarding to Dashboard Connection String, is it can be same as Storage String ? Thanks a lot – Adityo Setyonugroho Feb 28 '18 at 06:32
  • Yes they all use the same connection string. The connection string is copied from storage account(This link:https://stackoverflow.com/questions/6985921/where-can-i-find-my-azure-account-name-and-account-key) – Janley Zhang Feb 28 '18 at 06:40
  • Wow thank you so much, you're the expert on these. Can I have discussion on the future with you with these Azure development ? :) – Adityo Setyonugroho Feb 28 '18 at 06:48
  • If you have any questions post to Azure theme in stackoverflow, I'm glad to help you to solve the problem. – Janley Zhang Feb 28 '18 at 06:53
  • Thank you, btw, I am running a sample from Visual Studio for queue, I am adding queue to my storage, but my function is not triggered. Is there anything that I need to setup ? I am following this https://github.com/Azure/azure-webjobs-sdk/wiki/Queues – Adityo Setyonugroho Feb 28 '18 at 07:04
  • It is a new question. Maybe you could try to post a new thread for this issue to Azure theme and provide more details. I can not pass simple words in comment to solve your issue. – Janley Zhang Feb 28 '18 at 07:09
  • Adding `` is not working in a `.net 4.8` project with the `Azure WebJobs template`. – Matteo Pietro Peru Sep 27 '22 at 09:55