I would like to invoke a REST call from my WebJob, I am wondering if it is possible to programmatically retrieve the Host Url (http://<something>.azurewebsites.net
) from inside my WebJob, instead of hard-coding the URL.
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.
Azure WebJobs are deprecated, but still in use. They are being phased out in favor of Azure Functions. Azure Functions is a more up-to-date and feature rich service which offers a greater degree of flexibility and control.
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.
The azure-webJobs-dashboard container is used by the WebJob dashboard to store host and execution endpoint (function) details. Azure-jobs-host-archive is used as an archive for execution logs.
Web App hostname can be read from the WEBSITE_HOSTNAME
environment variable.
A description of the environment, including environment variables can be found here. Environment variables and their values can be viewed using the Kudu dashboard at https://<web_app>.scm.azurewebsites.net
.
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