Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Azure for Developers

You're reading from  Hands-On Azure for Developers

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781789340624
Pages 606 pages
Edition 1st Edition
Languages
Author (1):
Kamil Mrzygłód Kamil Mrzygłód
Profile icon Kamil Mrzygłód

Table of Contents (24) Chapters

Preface 1. Azure App Service 2. Azure WebJobs 3. Deploying Web Applications as Containers 4. Distributed Applications and Microservices with Service Fabric 5. Using Azure Search 6. Mobile Notifications with Notification Hub 7. Serverless and Azure Functions 8. Integrating Different Components with Logic Apps 9. Swiss Army Knife - Azure Cosmos DB 10. Reactive Architecture with Event Grid 11. Using Azure Storage - Tables, Queues, Files, and Blobs 12. Big Data Pipeline - Azure Event Hub 13. Real-Time Data Analysis - Azure Stream Analytics 14. Enterprise Integration - Azure Service Bus 15. Using Application Insights to Monitor Your Applications 16. SQL in Azure - Azure SQL 17. Big Data Storage - Azure Data Lake 18. Scaling Azure Applications 19. Serving Static Content Using Azure CDN 20. Distributing Load with Azure Traffic Manager 21. Tips and Tricks for Azure 22. Assessments 23. Other Books You May Enjoy

Azure WebJobs

Azure WebJobs are one of the underlying features of Azure App Service. They allow for the easy running of so-called "jobs" using different intervals, or even running them infinitely. They are very flexible and provide a special SDK, so users can work with them efficiently and quickly.

The following topics will be covered in this chapter:

  • How to create Azure WebJobs
  • Working with different trigger types (continuous and triggered)
  • Using different file types for WebJobs

Technical requirements

To perform exercises from this chapter, you will need the following:

  • Access to an Azure subscription
  • Visual Studio 2017 with Azure development workload installed

Creating WebJobs

Working with WebJobs is much simpler than working with App Services, as this is a much easier service to configure and use. In fact, there are two ways of working with them:

  • Using Azure Portal and deploying a job manually
  • Using Visual Studio to develop and deploy it manually

What is more, you can leverage the WebJobs SDK to prepare an application triggered by an external service. This will be covered at the end of this chapter, and will be an excellent introduction to Azure Functions, described later in this book.

Creating and deploying WebJobs in Azure Portal

The easiest and quickest way to start working with WebJobs is to create a custom console application, perform an action, and then deploy it using...

Using different file types for WebJobs

When you are working with WebJobs, you are not limited to using EXE files. Currently, this service supports the following applications:

  • Windows executables (.exe, .bat, and .cmd)
  • Powershell (.ps1)
  • Bash (.sh)
  • Python (.py)
  • PHP (.php)
  • Node.js (.js)
  • Java (.jar)

As you can see, the preceding list is quite similar to the supported languages in App Services. This should be understandable now, as you have learned that WebJobs are in fact an integral part of Web Apps in Azure. Let's try something practical—we will deploy a simple Node.js application, which will publish to Azure as a WebJob.

Creating and deploying a Node.js application as a WebJob

JavaScript is one of the most popular...

Summary

As you have seen, Azure WebJobs are a really helpful and useful feature of App Services that let you quickly develop jobs running either continuously or triggered on schedule. They start to shine when you have a working web app, which could be used to host them and execute many different actions asynchronously (such as generating a report or reading a queue, which will feed your application's database later). Thanks to the support of different programming languages, you do not have to limit yourself to only one particular platform. Last but not least, they are a great introduction to Azure Functions, which are one of the most popular services in Azure and extend the current possibilities of WebJobs even further. In Chapter 3, Deploying Web Applications as Containers, you will learn about deploying Web Apps as containers, what extends even more the capabilities of...

Questions

  1. Can you run WebJobs using the Free or Shared tier?
  2. What run modes does WebJobs currently supprt?
  3. Can you run a Java application using WebJobs?
  4. How can you ensure that runtime will find your job starting file?
  5. Can you publish a WebJob containing more than only one file? If so, how can you do that?
  6. How can you ensure that a WebJob will not be scaled out to multiple instances?
  7. Can a WebJob access the application settings of the App Service that hosts it?
lock icon The rest of the chapter is locked
You have been reading a chapter from
Hands-On Azure for Developers
Published in: Nov 2018 Publisher: Packt ISBN-13: 9781789340624
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}