Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic of Azure WebJobs SDK

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

like image 394
Adityo Setyonugroho Avatar asked Feb 28 '18 04:02

Adityo Setyonugroho


People also ask

What is Azure WebJobs SDK?

The Azure WebJobs SDK is a framework that simplifies the task of writing background processing code that runs in Azure WebJobs. It includes a declarative binding and trigger system that works with Azure Storage Blobs, Queues and Tables as well as Service Bus.

What is Azure WebJobs used for?

WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There is no additional cost to use WebJobs. You can use the Azure WebJobs SDK with WebJobs to simplify many programming tasks.

What is the difference between Azure functions and WebJobs?

Summary. Azure Functions offers more developer productivity than Azure App Service WebJobs does. It also offers more options for programming languages, development environments, Azure service integration, and pricing. For most scenarios, it's the best choice.

What is Azure WebJobs hosts?

azure-jobs-host-output container is the key for troubleshooting web jobs. This container hosts logs created by the WebJob runtime during initialization and termination of every execution.


Video Answer


1 Answers

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

like image 181
Janley Zhang Avatar answered Oct 19 '22 15:10

Janley Zhang