Showing posts with label Azure. Show all posts
Showing posts with label Azure. Show all posts

Friday, September 4, 2020

Cross cutting concerns in Microservices Architecture

 Here's the list of cross cutting concerns/Common platform services:

  1. Logging & Tracing
  2. Exception Handling
  3. Caching
  4. Swagger documentation
  5. Health Check
  6. Dapper
  7. ISC (Inter service communication)
  8. Resilience
  9. Email
  10. KeyVault

 

Notes:

Logging & Tracing - Azure Application Insights

Caching - Azure cache for Redis

Swagger - Swashbuckle & ASP.NET Core

Health Check - in ASP.NET Core (HealthStatus.Healthy, Unhealthy, Degraded)

Dapper - Micro ORM for Azure SQL

ISC - Inter service communication  (HttpClient.GetAsync(url))

Resilience - Circuit breaker/polly framework

Email - SendGrind

KeyVault - Azure Key Vault


Saturday, March 28, 2020

Azure Cache for Redis - Observation

Redis cache is an open source In-Memory data store.

In-memory is best way to store and get data faster, but its not ideal for persisting data.

Nuget package StackExchange.Redis helps to configure Redis cache on .NET code

ConnectionMultiplexer class helps to establish connection with Redis cache.


Note: Redis Pricing Tier C0 Basic offers up to 250MB cache and is sufficient for the hands-on 


Wednesday, March 18, 2020

Terraform - Getting started

Terraform is an opensource tool for creating, changing and versioning infrastructure. It uses config files.

In other words, it uses Infrastructure as a Code (IaC) to provision cloud resources or any infrastructure.

Terraform execution steps are:

  1. init
  2. plan
  3. apply
  4. destroy
Terraform generates execution plan, before applying them.
Terraform plan command throws if any syntax or runtime error exits.
Terraform apply command provision the infrastructure on the cloud.
Terraform destroy command deletes the infrastructure from the cloud.

Reference:

Monday, March 16, 2020

Load Balancer Types in Azure

Load Balancers helps to distribute incoming network traffic
  1. Azure Load Balancer
  2. Azure Application Gateway
  3. Azure Traffic Manager

 Azure Load Balancer operates at Layer 4 of OSI model (TCP/UDP). It is a single point of contact for clients.

Azure Application Gateway operates at Layer 7 of OSI model (HTTP/HTTPS). It is a web traffic load balancer. That is it manages traffic to web applications

Azure Traffic Manager is DNS Based traffic load balancer. It manages traffic across multiple azure regions.


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

Saturday, August 17, 2019

Common Azure Database Migration Issues

Data Migration Assistant helps to assess your on-premise database readiness to migrate to Azure. DMA identifies the compatibility issues and provides the recommendation on alternatives.

Unsupported features:

  1. Windows Authentication is not supported on Azure SQL database
  2. Service Broker feature is not supported Azure SQL database


Compatibility issues:
  1. Deprecated datatypes (TEXT, IMAGE, NTEXT). Alternative varchar(max), nvarchar(max), varbinary(max) 
  2. Table hints in indexed view definitions are ignored in compatibility mode


Sunday, August 11, 2019

Assessing and planning Microsoft Azure Migration

Many of the organizations are planning to migrate workload/applications to cloud.

Fist step is to access the azure readiness of the workload. There are set of tools available for assessment. How do we start?

  1. Azure Migrate
  2. Service Map
  3. Site Recovery

Azure Migrate helps to assess the VMWare VMs in the data center. Currently it doesn't support physical servers.


Site Recovery helps to migrate VMs and physical servers to cloud.

Vertical and Horizontal Scaling

Vertical scaling is known as Scale up.
It is a process of adding resource to increase power of an existing server
Example: Adding CPU or Memory

Horizontal scaling is known as Scale Out.
It is a process of adding more servers.
Example: More than one server will be processing the input request from user

Benefits of moving to cloud

Few of the advantage of using cloud are

  • Cost-Effective: Pay-as-you-go - It is consumption based model. 
  • Scalable: Support both vertical & horizontal scaling
  • Elastic: It is easy to scale in & scale out depending on business need.
  • Reliable: data backup, disaster recovery and data replication
  • Reduced IT workforce - Cloud provider is responsible for maintaining physical hardware.

Sunday, November 25, 2018

Fault domain and update domain with Azure

Both are availability settings.
It ensures availability of virtual machines during unforeseen situations or during upgrades.

Fault domain:

  • Fault domain is racks of computers.
  • Set of hardware components that share a single point of failure
  • In a data center, rack of computers can be fault domain, which might be sharing same power source or network connection
  • To minimize impact of possible hardware failure, Microsoft Azure deploys instances to at least 2 or more fault domains

Update domain:
  • Upgrade domain keep your application running during upgrades
  • Take down instances one by one, so that at any given time at least one running instance serving request
  • There will be 5 upgrade domains by default, it can increase up to 21

Conclusion
  • Fault domain - for unplanned failures
  • Update domain - for planned maintenance operations

References:

Sunday, September 23, 2018

Introduction to Microst Azure Cloud Services

Prerequisites:


Getting started:

  1. VS 2015 (Enterprise)  > New Project > Microsoft Azure Cloud Services
  2. Select ASP.NET Web Role 
  3. Select "MVC" as template

Microsoft Azure Compute Emulator:
It helps to test Azure Cloud Services locally


Types of Web Role:
  1.  ASP.NET Web Role  (service with a web user interface)
  2.  WCF Service Web Role (web role for WCF Service)
  3.  Worker Role (background processing Service)
  4.  Worker Role with service Bus Queue

Difference between Cloud Service and Web Role:
  • Cloud service is a container or a boundary or a box, which can put different services.
  • We can add different web role into a cloud service

Reference: