Wednesday, January 29, 2020

When to use Azure Web Job and Azure Functions

Web Jobs are suitable for continuously running jobs. Azure function is not supported or designed for it.


Web job is a supporting mechanism to an existing application. Azure functions can be a supporting application or an application itself.


Web Jobs can have only 2 triggers (Manual or Timer). Azure Functions can have different triggers (Queue, Blob Storage, table storage etc)


Azure functions can be triggered from external events (Example - When message comes to Queue/Bus, New file is uploaded to blob storage etc). Web Jobs cannot do this.

Thursday, January 23, 2020

Availability set and Availability Zone

One of the business continuity strategy is high availability. Availability set & Availability Zone helps to achieve this. This ensure availability of apps during catastrophic failures.

Availability set - VMs are placed within the same data center. Keep them in different racks. So that one goes down, other is available.

Availability Zone - VMs are placed in different data centers under same region

Tuesday, January 21, 2020

Cloud Migration Strategies


  1. Rehost
  2. Refactor
  3. Re-architect

Rehost - This is the fastest way to move to cloud. Move all your workload to VM. Also known as "lift and shift". IaaS.


Refactor - Make few changes in the application and host it on Azure. This is through PaaS. (Example: Azure App Service or Azure SQL)


Re-architect - Breakdown large application into smaller micro-services. Or through SaaS offering

Azure Web Job

Web job is a process that runs in the background. It complements the main application. In other words, it is supporting mechanism to an existing application.

There are 2 types of Web Jobs:

  1. Continuous Web Job
  2. Triggered Web Job

Continuous Web Job runs until it stopped.
Triggered Web Job will only run when triggered.

Triggered Web Job can start in 2 ways:
  1. Manual
  2. Scheduled

Observations:
  • Web job can be configured on any existing Azure App Service (Web App or Web Api)
  • Web job supports .exe, .ps, .cmd etc.
  • Dotnet framework console application can be configured as Web Job
  • By default, dotnet core console project output is dll. Hence may not be able to configure directly
  • Web job can be scheduled using CRON expressions

Azure Application Insights - Observations


  • There is few minutes delay in seeing logs in Azure Application Insights
  • Data retention can be up to 730 days(2 years). Upto 90 days is free, post that is chargeable.
  • Instrumentation key uniquely identifies Application Insights in Azure portal
  • A local web app (not published) with Instrumentation Key can send messages to Application Insights
  • Use TelemetryClient to log custom events into Azure Application Insights
  • Kusto Query Language (KQL) - helps to query Application Insights