Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure WebJobs: Is it possible to retrieve the Host Url programmatically in the console app?

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.

like image 482
icube Avatar asked Aug 31 '15 04:08

icube


People also ask

What is the use of WebJobs in Azure?

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.

Is Azure WebJobs deprecated?

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.

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?

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.


1 Answers

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.

like image 168
MrBink Avatar answered Sep 18 '22 01:09

MrBink