Skip to content

RicardoGaefke/ricardogaefke-webjobs

Repository files navigation

ricardogaefke-webjobs

Repo for Linux WebApp WebJobs

Build status Release status
Build Status Release Status

How it works

This is a simple example of async integration using Azure WebJobs on an Azure Linux Docker Compose WebApp. It has a simple form to send an XML file with your name and email. Inserted data is sent to server and you'll always receive an answer. If everything runs fine, you'll receive an email with your XML converted to a JSON file. Otherwise, you'll receive an error message.

Azure WebJobs are background services that are perfect for services integration and/or long time tasks (like PDF generation and external API calls).

WebJobs run connected to Azure Storage Queues and one of the best resources (in my opinion) is the ability to use a poison queue. When a run fails after X times (default is five), the message is sent to a -poison queue. So if for any reason your message falls in an error, you can have a second WebJob connected to the -poison queue to handle the situation.

GitHub Integration

The content of this example can be found at https://webjobs.ricardogaefke.com/.

Azure Pipelines

This application is automatically built, tested and deployed by Azure Pipelines. Each git push to master or to a PR is built and tested by Azure Pipelines. In case of master if the build is ok the Release takes place and updates the app using Docker integration.

This is the public Pipeline.

Docker Registry

The containers of this app can be found at docker/ricardogaefke/ricardogaefke-webjobs.

I am using Docker registry to create and publish the containers of this app using the Release Pipeline. There are two Docker repos being used here:

  • 1 - ricardogaefke-webjobs This is used to save the containers used by app (webjob_site, webjob_nginx, webjob_xml, webjob_xml_poison).
  • 2 - ricardogaefke-webjobs-deploy This repo is used just to trigger the Azure WebHook and update the WebApp after publishing all containers to previous Docker repo.

Tech summary:

  • ASP.NET Core - High-performance, open-source , multi-format framework for building modern Internet-connected and cloud-based applications.
  • Azure - A cloud plataform.
  • Azure Pipelines - Implement continuous integration and continuous delivery (CI/CD) for the app and platform of your choice.
  • Azure SQL - Azure SQL Server.
  • Azure Storage - Azure Storage.
  • Azure WebApp - A modern web app service that offers streamlined full-stack development from source code to global high availability.
  • Azure Webjobs - Azure Webjobs.
  • C# - Language C# to .NET Platform.
  • Docker - Platform for developers and sysadmins to build, run, and share.
  • JQuery - A fast, small, and feature-rich JavaScript library.
  • Linux - Linux documentation.
  • NGINX - Free, open-source, high-performance HTTP server, reverse proxy, and IMAP/POP3 proxy server.
  • Semantic UI - Interface integration and performance.
  • Typescript - Typed superset of JavaScript that compiles to plain JavaScript.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details.