Azure Hybrid Cloud Migration Architecture

Azure Hybrid Cloud Migration Architecture

Use Case

This solution provides a continuous integration and continuous deployment (CI/CD) pipeline that pushes each of your changes automatically to Azure app services & AKS cluster, which allows you to deliver value faster to your customers.


DevOps Dataflow

  • Commit code to Azure Git.
  • Continuous Integration Trigger to Azure DevOps.

  • Azure Pipelines builds and stores artifacts in Azure Storage

  • Azure Pipelines deploys Java applications to Azure Web Apps backed by Azure for SQL DB.

  • Azure Application Insights provides metrics on application performance.

  • Monitor applications and make improvements.

  • Azure Pipelines triggers a build job using Azure Container Instances for a dynamic build agent.

DevOps Pre-requisites

Service connection Details-

Azure service connections are used in Azure Pipelines to securely connect to and interact with various Azure services and resources. When you create a service connection in Azure DevOps, it establishes a trust relationship between your Azure DevOps organization and the target Azure service or resource. This connection is essential for several reasons:

 

Artifacts



Components

  • Azure Web Apps: Quickly create and deploy mission-critical Web apps at scale.

  • Azure Database for SQL: SQL database service for app developers

  • Application Insights: Detect, triage, and diagnose issues in your web apps and services.

  • Azure DevOps: Build and deploy multi-platform apps to get the most from Azure services.

  • Container Instances: Easily run containers on Azure without managing servers.

Deploy the scenario.

Azure App Service is a fast and simple way to create web apps using Java, Node 18-LTS as well as support for custom language runtimes using Docker. A continuous integration and continuous deployment (CI/CD) pipeline that pushes each of your changes automatically to Azure app services allows you to deliver value faster to your customers.

Deployment Steps

Create a service principal with the Contributor role with Azure CLI if you don't have one in your subscription.

az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/${SUBSCRIPTION_ID}"

Java CI/CD using Azure Web Apps
API's deployment in Azure APIM
  • Define API in Azure APIM Developer Portal: Create an API definition in the Azure APIM Developer Portal or import an existing API definition.
  • Configure API Properties, and Policies: Configure various properties of the API, set up policies for controlling the API behavior, and define other related settings.
  • Set up Backend Connection and Routing: Configure the connection to the backend service where the API requests will be forwarded. Define routing rules for different API operations.
  • Test and Debug API in APIM: Test the API within the Azure APIM environment to ensure that it is working as expected and troubleshoot any issues.
  • Deploy API to Production: Deploy the API to the production environment, making it accessible to consumers through the Azure APIM gateway.
  • Create Products and Apply API Policies: Create API products to group APIs and apply policies to control access, rate limiting, and other behaviors.
  • Define API Versions, Revisions, and Lifecycles: Manage different versions and revisions of the API, and define lifecycles to control when changes are moved to production.
  • Publish API to Developer Portal and Gateway: Make the API available to developers by publishing it to the Developer Portal. Also, publish it to the gateway for external access.
  • Monitor API Analytics, Health, and Usage: Monitor the API's performance, health, and usage using the analytics features provided by Azure APIM.



Deploying pods in an Azure AKS cluster

By integrating continuous integration and continuous deployment processes, organizations can ensure efficient and reliable deployment of pods within their AKS environment.

  • Setting up CI/CD Pipeline: Begin by creating an Azure Container Registry (ACR) and an Azure Kubernetes Service (AKS) using Azure CLI tools. This provides the foundational infrastructure for the CI/CD pipeline.
  • Code Management: Build the application and push the code to a version control system such as GitHub. This ensures that the latest code changes are readily available for the deployment process.
  • Connection to AKS: Establish a connection to the Azure Kubernetes Service using AKS credentials, allowing seamless interaction with the AKS cluster during the deployment process.
  • Building and Pushing Docker Image: The CI/CD pipeline includes building the Docker image from the Dockerfile and pushing it to the Azure Container Registry. This step prepares the application for deployment within the AKS cluster.
  • Copying Manifest File: The Kubernetes manifest file, which defines the desired state of the cluster, including the pods and services required to run the application, is copied into the Artifact staging directory as part of the deployment process.
  • Artifact Publishing: The build Artifact is published, making it available for subsequent deployment stages within the CI/CD pipeline.
  • Release Pipeline Creation: A release pipeline is created, and the necessary files for deployment, including the Kubernetes manifest file, are selected for inclusion in the pipeline.
  • Stages Creation: Dev, QA, Staging, and Prod stages are established within the release pipeline. Each stage includes the essential steps required for deployment and validation of the application.
  • Pre-deployment Conditions: Pre-deployment conditions are defined, and an approver email ID can be added to ensure proper oversight and authorization for the deployment process.
  • Code Commit and Trigger: Commit the code after updating the necessary files to trigger the build and release pipeline, initiating the deployment process.
  • Deployment Verification: Once the deployment is complete, the application's successful deployment can be verified by obtaining the IP address and browsing the installed app within the namespaces of the AKS cluster.





Comments