Skip to main content

7 posts tagged with "devops"

View All Tags

· 5 min read

Microsoft introduced App Service Static Web Apps in Preview at Build 2020 as"Azure static web apps", a service which allows web developers to build and deploy website to any environment from Github repository for free. Developers can deploy applications in minute while taking the advantage of scaling and cost savings offered by azure functions as backend. One of the frequent questions that i heard from the developers was the availability of Azure Devops support with Azure static web apps.

I have already published an article which demonstrates how to deploy to Azure Static Web Apps using GithubActions. Azure static web apps team announced the public preview of Azure Devops with Azure static web apps yesterday.

In this post you I will walk you through on how to deploy an angular application to Azure static web apps using Azure Devops.

PreRequisites:

Step 1 : Create a Devops repository

Navigate to Dev.Azure.com and create a new Devops Repository as below

Azure Devops repository

Step 2 : Import your static web application to Azure Devops repository

https://github.com/microsoft/static-web-apps-gallery-code-samplesNext step is to import the web application from any source control to your newly created Azure Devops repository. In this case i am importing the same "Meme generator" app which was made of Angular. Meme4Fun is an app to create custom programming memes from a picture and it also identifies features of people in the image which is available as part of code samples for Azure static web apps.

Import Repository to Azure Devops

Step 3 : Create a static web app on Azure

Next step is to create the static web application on azure, navigate to azure portal and create a new resource by searching for Static Web apps, and create it.

Note : Since I am going to leverage Azure Devops as the deployment method, select Other as the option.

Choose Devops as the Deployment

Once the deployment is successful, navigate to the new Static Web Apps resource and select Manage deployment token.

Manage deployment token

Step 4: Create the Pipeline task in Azure Devops

If you are using Azure Devops to deploy applications in the past, you will need to have the pipeline in plact to deploy to particular resource. In this case, lets create a build pipeline to deploy the angular application.

Next step is to select the template, since we are deploying an angular application, you can select the template as angular with nodejs

Angular template

Also for static web apps it is important to include the following step in the yaml which has the app_locationapi_location, and output_location , you need to pass those values if you have those details if not keep it empty.

Different values details

and the final configure YAML will look similar to the below,

# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
ng build --prod
displayName: 'npm install and build'
- task: AzureStaticWebApp@0
inputs:
app_location: "/"
api_location: "api"
output_location: "dist/meme4fun"
env:
azure_static_web_apps_api_token: $(deployment_token)

Next step is to provide the The **azure_static_web_apps_api_token** value is self managed and is manually configured. Select Variables in the pipeline and create a new variable named as "deployment_token"(matching the name in the workflow) below.

Add new Variable

Paste the deployment_token value which was copied from Azure portal

Make sure to check "Keep the value secret" and save the workflow and run.

With that step Azure Devops will execute the pipeline and deploy the application to azure static web apps.

Successful deployment

Now you can access the application from the static static web app from the URL.

Static web app with azure devops deployment

If you had any trouble in executing the above steps, you can watch the same tutorial published as a video here.

It's great to see that with few steps of configuration, i was able to deploy the application with Azure Devops. If you have enabled backend support with the azure functions, it can be deployed as well. Support with Azure Devops has been one of the most requested features by developers and great to see it in live now. It's your chance to explore various application deployments with different frameworks, hope this is useful. Cheers!

· 6 min read

If you are hosting your application on any environment whether it's in cloud or on-prem, an effective monitoring helps to increase the uptime by proactively notifying us of critical issues so that you resolve them before they become problems. An effective monitoring is a part of Devops process which helps you to achieve the following,

  • A proactive approach.
  • Get visibility of your infrastructure and application issues
  • React fast to an issue and mitigate quickly.
  • Increase your application availability
  • Reduce application downtime

I have been involved in lot of discussions with customers and partners on how to setup alerts in order to proactively get to know the issues and help the customers. One of the frequent questions i noticed is that about how to setup SMS alerts. In this post i wanted to cover about how to setup SMS alert on Azure at a minimal cost.

PreRequisities:

You will need to have an Azure Subscription. If you do not have an Azure subscription you can simply create one with free trial.

Services used:

  • Azure Logic Apps
  • Azure Monitor
  • Twilio API
  • Azure Virtual Machine

There is no SMS notification service readily available on Azure as of now. Even though Azure Communication Service which Integrate SMS into existing applications and workflows with Azure services Logic Apps and Event Grid is still in preview and not supported in many countries. In this case you could integrate with any of the SMS providers. In this case i will use one of the famous SMS provider which i have used in many of the projects in the past.

Step 1 : Create the Resource Group

As the first step, we need to create the resource group that contains all the resources needed. In your case, you might already have an Azure environment with all the resources. Navigate to Azure Portal and create the resource group named “smsalert”

Create Resource Group

Step 2 : Create the application and deploy on Azure VM

In this case, i will be focusing on setting up alerts on a Virtual Machine, If you already have an application deployed on any compute services such as AppService or AKS you could replicate the same steps. You might not need to do this step as its about application deployment. I will use the Devops starter resource to deploy a Dotnet core application and choose VM as the compute option to deploy my application.

Search for Devops starter in the search bar and create a new ASPNet core application and choose VM as the destination to be deployed.

Deploy ASPNET core app using Devops starter

Once the application is deployed you could access the application from the url and you can login to the VM as well.

ASPNetCore app on VM via Devops starter

Now we have the application deployed on VM, assume if you want to monitor the performance and setup alert whenever it breaches certain condition, lets setup azure monitor integrated with Logic apps.

Step 2 : Create Logic app Integrated with Twilio

You need to setup a Twilio account inorder to send the SMS alerts, the free tier gives a worth of 15$ credits which would be enough for 4000 messages. You will also get a number to send SMSes from the account portal. If you need a custom number you can set it up with extra cost.

Twilio SMS account

Let's create the logic app, you can search for Logic app resource on the search bar and create a Logic app with the name smsalert under the same resource group.

Logic App to send SMS alerts

Next step is to configure the steps in logic app , whenever a request is received from the azure monitor, we need to send the SMS to relevant members in the team which can be configured with 2 steps as below,

Add the first step as when an http request is received and we need to map the schema of alert inorder to get the information from the alert and to send the sms. Paste the schema object in the request body.

Next step is to add the twilio connector inorder to send the SMS when an alert is recieved. you can configure the twilio send text message step as below, you need to pass the account SID and the access token in the configuration.

You can also pass a custom text which consists of any of the parameters that recieved from the alert, say for ex. CPU percentage, time etc.

Twilio configuration

Now we are ready with the logic app integrated with Twilio, next step is to create the alert rule on the vm to send the SMS

Step 3 : Setup Alert Rule to send SMS notification.

Open the VM resource , on the blade navigate to Alerts and click on new alert rule, by default you can see that the resource is selected as the VM, next step is to setup the condition when you need to fire the alert, this can be a combination of multiple configurations, you can choose it from the predefined configurations. In this case i will choose the condition as "When the percentage CPU goes above 10%".

Setup condition for Alert

Fire alert when the CPU percentage goes over 10% over a period of 1 min

We are good with the condition just for this demo purpose, but you can play around multiple conditions in combinationas you need for your environment.

Step 4: Add Action Group

In the "Add action group" section, we have to create an Action Group Name and we need to choose the Logic app as action and select the logic app which you have created in the above step,

Once you are done with the action group, just pass the alert rule details and set the severity level.

We are done with all the steps needed to send the SMS alert, now whenever the CPU usage goes above 10% the configured number will get an SMS message. If you want to send the SMS to multiple members in the team, you could just use the for condition in logic app and send it to multiple members.

Step 5 : Manage Alert Rules

You can also manage the alert rules based on the severity and if the action has been taken on those alerts and recrtified from the manage alerts section.

That's all i wanted to cover in this post, one thing to note is that i have seen many customers who already have setup email notifications via the Azure monitor, but SMS is not still readily available in all countries if you've noticed.

Hope this helps to setup SMS alerts on any resource that you use as compute option to run your application. Cheers!

· 5 min read

Overview:

Are you hearing the word Devspaces for the first time?. Let me put this way, Imagine a developer having to deal with a large application which has chunks of Microservices and want to get some functionality done?. There will be many risks and one of them would be dealing with right environments. As we know the best way to counter this issue within a team would be to containerize and host it on cloud. Which will let the developer to work on the particular feature and debug the container without creating the environment locally. That is what exactly Azure Dev Spaces does.

What is Devspaces?

Devspaces allows you to build, test and run code inside any Kubernetes cluster. With a DevSpace, you run everything remotely inside pods running on top of a Kubernetes cluster. Additionally, the DevSpace CLI takes care things automatically such building and pushing images for you when you make changes to your Dockerfile. If you are making a source code change, the DevSpace CLI does not require you to rebuild and redeploy.

It rather syncs your locally edited source to straight to the containers running inside Kubernetes.  This makes you to edit locally but compile and run everything remotely inside Kubernetes and still use modern development features such as hot reloading. Azure Dev Spaces supports development with a minimum development machine setup. Developers can live debug on Azure Kubernetes Services (AKS) with development tools like Visual Studio, Visual Studio Code or Command Line.

With the recent announcement of Bridge To Kubernetes GA, Azure Dev Spaces will be retired on October 31, 2023. Developers should move to using Bridge to Kubernetes, a client developer tool.

What is Bridge to Kubernetes?

It was formerly called as Local Process with Kubernetes. Bridge to Kubernetes is an iterative development tool offered in Visual Studio and VS Code through extensions that you can pick up in the marketplace. IT allows developers to write, test and debug microservice code on their development workstations while consuming dependencies and inheriting existing configuration from a Kubernetes environment. There are lot of different tools and methods for solving these kind of challenges when you are working on a single micro-service in the context of a larger application. Those different methods and tools into three main types .There's the local, remote and hybrid approach as shown in the image below

Development Approaches

If you look at the above picture, developers are shifting from Local development methods to hybrid methods which offers the best way to deal with building applications to the cloud with containers/kuberentes. With Hybrid approach, it allows developers to write code on their development workstation, but also allow them to connect to external dependencies that are running in some remote environment. So it actually fulfilling all those external dependencies by connecting them. Let's say if you are running your application on Kubernetes on Azure, you can connect all the dependencies from your local environment and have the whole end-to-end workflow.

Bridge to Kubernetes Scenario

Consider the above scenario in the diagram, Assuming that i am working on a Microservice that deals with Products and the other Microservices which are developed using different stack are deployed on Kubernetes cluster on Azure. If i want to connect to any or multiple microservices and run some integration tests in my local environment Bridge to Kubernetes will help to achieve the requirement. Following are some of the Key features that Bridge to Kubernetes offers similar to Devspaces,

Accelerating and Simplifying Microservice Development

It basically eliminates the need to manually push code, configure and compile external dependencies on your development environment so that you can focus on code without worrying about other factors.

Easy Debugging Code

It lets you to run your usual debug profile with the added kuberentes cluster configuration. It allows developers to debug code in the way they want would while taking advantage of the speed and flexibility of local debugging.

Developing and Testing End-to-End

One of the important feature is the Integration testing during development time. Select an existing service in the cluster to route to your development machine where an instance of that service is running locally. Developers can initiate request through the frontend of the application running in Kubernetes and it will route between services running in the cluster until the service you specified to redirect is called same as how you would do debugging by adding a breakpoint in your code.

How to get started with Bridge to Kubernetes?

You can Start debugging your Kubernetes applications today using Bridge to Kubernetes.You need to download the extensions from the Visual Studio and VS Code marketplaces.

Bridge to Kubernetes VSCode extension

If you would like to explore more with a sample application follow the example given on Use Bridge to Kubernetes . Also kindly note the Bridge to Kubernetes collects usage data and sends it to Microsoft to help improve our products and services.

Start using Bridge to kuberentes and deploy things to production even faster than before! Cheers!

· 7 min read

Quarantine, self isolation , social distancing for the past one month, I’m living with these words. While most of us are investing this time to learn new technologies/tools. I challenged myself to skill up myself and have deep knowledge on certain services on Azure.

Kubernetes provides a uniform way of managing containers. Its aim is to remove the complexity of deciding where applications should be scheduled to run, how to locate them, how to ensure they are running, autoscale or deploy. Azure Kubernetes is a service on Azure that help Customer achieve their business goals, by providing a layer of automation on top of their infrastructure. Going towards the technical features, Azure Kubernetes has a lot to offer, but at the end of the day, is a great platform for saving money or growing faster.

Azure Kubernetes service offers great set for microservice architectures. If your application needs to start hundreds of containers quickly or will terminate them just as quickly and to have full control of those services, AKS is a great option. There are other scenarios such as Bigdata, IOT scenarios you would consider AKS as a preferred choice. In this post i will explain how to easily setup your application running on AKS cluster in 10 minutes with CI/CD pipelines.

PreRequisities:

You will need to have an Azure Subscription. If you do not have an Azure subscription you can simply create one with free trial.

How to build & Deploy the application:

If you are a beginner with Azure Kubernetes Service, Azure Devops is the best place that you need to look in order to understand how an Application is deployed on Azure Kubernetes. The Azure DevOps Project simplifies the setup of an entire continuous integration (CI) and continuous delivery (CD) pipeline to Azure with Azure DevOps. Cool thing is that, you can start with existing code or use one of the provided sample applications. It enables you to quickly deploy that application to various Azure services such as Virtual Machines, App Service, Azure Kubernetes Services (AKS), Azure SQL Database, and Azure Service Fabric.

Lets Deploy an Node.js App to Azure Kubernetes Service :

Navigate to Azure Portal and search for Azure Devops Project in the market place/search bar.

Azure Devops Project

Let's go ahead and add a new project.

Add new Azure Devops Project

Azure Devops project enables developers to launch an app withany Azure App Service in just a few quick steps, providing everything needed to develop, deploy and monitor an app. Create a DevOps Project, and it provisions all the Azure resources and provides a Git code repository, Application Insights integration and a continuous delivery pipeline setup for deployment to Azure. The DevOps Project dashboard lets you monitor code commits, builds and deployments from a single view in the Azure portal. How cool is that ?

With the help of Azure DevOps Projects, you can build an Azure application, on an Azure service, in quick time. You also get automatic full CI/CD pipeline integration, built-in monitoring and deployment to the platform of your choice. Azure Devops Project supports almost all the latest languages out there in practice such as .Net,Java,Node.js,PHP,Python and Go.

Next step is to select the Language you want to have the application on, I will go ahead and choose Nodejs as my application language. But you could choose any language that you want to test.

Create Node.js Devops Project

Once you select the language, next step is to select the framework in which you want the application to be based on , For example, if you choose Python it could be based on Flask,Django etc. Similarly you have the flexibility to choose the framework once you decide the language. In this case i will go ahead and choose express.

Select the Framework

Next step is the critical part of the process, This is the step that defines which service you would be using to deploy the app. You can Run your application on Windows or Linux. Simply deploy to Azure Web App, Virtual Machine, Service Fabric or choose Azure Kubernetes Service for your application. Each of those option provides deployment in an elegant and fast way. In this case, we will deploy the application to Azure Kubernetes service.

Azure Kubernetes Service to Deploy

Once you are done with the above step, final step is passing the configuration details for the Kubernetes cluster on AKS as follows,

Most of the settings are self explanatory , you can change the size of underlying VMs based on your requirement. The default number of nodes for your cluster comes as 3 , if you need to make changes to your cluster and the container registry settings click on Additional Settings. Here you can configure the Kubernetes version, Node count, App Insights and resource group location. The HTTP application routing solution makes it easy to access applications that are deployed to your Azure Kubernetes Service (AKS) cluster. In this case we will disable it.

Additional Settings AKS configuration

Container registry is needed as your images needs to be pushed to them. Once you're good with all settings, click ok and done!. You will see a notification box as below.

K8s cluster, Container Registtry, CI/CD pipelines are created

Once everything is created you will be redirected to a Dashboard page as below.

Resources in page

The four stages involved are:

  1. Azure Kubernetes Cluser: Created and configured your Azure Kubernetes Cluster and application endpoint.
  2. Azure Container Registry : Created and application image is pushed to the container registry.
  3. Repository: Created a distributed Git repository and checked in sample code.
  4. CI/CD Pipeline: Seamlessly connected with the Azure Devops collaboration solution allows you to plan, test, release and monitor your solutions.
  5. Application Insights:  Created and configured your Application Insights telemetry which enables active monitoring and learning to proactively detect issues and continuously analyze and test hypotheses without code.

You can see all the resources created on Azure under the resource group

Resource Group with All resources

When you click on the Kuberentes cluster, you can see the Kubernetes related resources such as dashboard logs etc.

Kubernetes cluster resources

And if you navigate to the blade you can see the settings such as Enabling Dev spaces , Kubernetes version, Application Insights etc.

On the Azure Devops side, you will be able to see new Azure Devops project created with Dashboard, Backlog items, CI/CD pipelines etc.

Azure Devops Project with CI/CD pipelines

And when you click on the application endpoint, you would see that the application running successfully on Azure Kubernetes service.

Nodejs App on AKS

In order to verify the services and pods, you could follow the steps provided in the Azure Kubernetes dashboard configuration and when you open up the dashboard, you can see the status of each services.

Azure Kubernetes dashboard

I have spent more than 4 days in the past to configure Kubernetes to deploy my application. But Azure Devops project Simplify and speed up the DevOps process with Azure DevOps services. If you want to explore more kind of scenarios on different services on Azure its worth to explore Azure Devops Labs. I hope it makes it easier to get started with any of the deployment with Azure services. Cheers!

· 4 min read

You might have noticed my recent posts were mostly focused on how to get started and learn Azure in 2020. This post is also to help all Azure enthusiasts to get to know and download all the free ebooks by Microsoft to learn more in depth about Azure. I have added the reference to this blog in my tool Azure 360 as well. There are around 174 ebooks which can be downloadable from the Microsoft site as of now. I have listed the top 60 books which are recommended and liked,shared the most among the social mediums.

Ebooks For Achitects,Developers and Decision Makers

eBook NameDownload
Azure for ArchitectsPDF
Designing Distributed SystemsPDF
Cloud Migration EssentialsPDF
Kubernetes : Up and RunningPDF
Learning Azure Cognitive ServicesPDF
Effective DevOps—Building a DevOps Culture at ScalePDF
How to Containerize Your Go CodePDF
Build and deploy a multi-container application in Azure Container ServicePDF
Build and deploy multi-container application in Azure Service FabricPDF
Kubernetes objects on Microsoft AzurePDF
Azure Serverless Computing CookbookPDF
Create your first intelligent bot with Microsoft AIPDF
Best Practices for Migrating Windows Servers to AzurePDF
Cloud Database Migration EssentialsPDF
Getting started with Apache Spark on Azure DatabricksPDF
15 Lessons Learned: Migrating SAP to the CloudPDF
Learning Node.js Development and deploy on AzurePDF
Cloud Analytics with Microsoft AzurePDF
Grow Your ISV Business with SaaSPDF
Building Intelligent Cloud ApplicationsPDF
Manage your network more effectively with the Azure Networking CookbookPDF
Developer’s Guide to Getting Started with Microsoft Azure Database for MySQLPDF
Developer's Guide to Getting Started with Cosmos DBPDF
Quick Start Guide to Azure SentinelPDF
The Developer's Guide to AzurePDF
Kubernetes on AzurePDF
Professional Azure SQL Database AdministrationPDF
Devops with ASP.NET Core and AzurePDF
Devops for Containerized AppsPDF
Enterprise Cloud StrategyPDF
Implementing a Zero Trust approach with Azure Active Directory PDF
Microsoft Azure Trips and Tips - DataPDF
Azure AD Application Proxy – Adoption Kit – eBookPDF
Azure Active Directory B2B Collaboration – Adoption Kit – eBookPDF
AI for Retail: Learn the scenarios that are driving today's digital consumerPDF
Building IoT Solutions with Azure: A Developer’s GuidePDF
The enterprise developer’s guide to building five-star mobile appsPDF
Modernizing existing .NET appsPDF
Azure Active Directory Company Branding- Adoption Kit – eBookPDF
Azure Migration SQL Server to Azure SQL Database Managed Instance a step by step guidePDF
Azure Active Directory Connect Health- Adoption Kit – eBookPDF
Azure Active Directory Self-Service Group Management – eBookPDF
AI in Action—explore three technical case studies in one guidePDF
Azure Active Directory Identity Protection – eBookPDF
Azure Multi-Factor Authentication – eBookPDF
Azure Privileged Identity Management – eBookPDF
Azure Active Directory Single Sign-On – eBookPDF
Azure Active Directory Self-Service Password Reset – eBookPDF
Azure Active Directory User Provisioning – eBookPDF
Five Principles for Deploying and Managing Linux in The Cloud with AzurePDF
Optimizing Azure Site Recovery (ASR) WAN OptimizersDOC
Azure VM – Oracle 12c on Linux – Configuration Steps – eBookPDF
Azure Strategy and Implementation GuidePDF
Build your first intelligent app with a guide from O’ReillyPDF
Guide to migrate schema & data from Oracle to Azure SQL DBPDF
How to Set up Azure AutomationPDF
Deploy IBM DB2 pureScale on AzurePDF
Azure AD in Windows 10 cloud subscriptionsPDF
Learn Azure in a Month of LunchesPDF
Microsoft Azure Essentials Migrating SQL Server DatabasesPDF
Migrate your SAP estate to the cloud—securely and reliablyPDF
Microsoft Azure ExpressRoute GuidePDF
Making the Most of the Cloud EverywherePDF
APIs + MicroservicesPDF
Hands-On Linux Administration on AzurePDF
Designing your Hybrid Cloud Strategy: Identity and Access ManagementPDF
Overview of Azure Active DirectoryDOC
Containerize Your Apps with Docker and KubernetesPDF
Solve your big data and AI challenges with an Azure Databricks use case e-bookPDF
Azure Rapid Deployment Guide For Azure Rights ManagementPDF
Practical Microsoft Azure IaaSPDF
IoT in the Real World: Stories from ManufacturingPDF
Continuous Delivery in JavaPDF
Azure Rethinking Enterprise Storage: A Hybrid Cloud ModelPDF
Azure AD/Office 365 seamless sign-inDOC
Exam Ref AZ-900 Microsoft Azure Fundamentals (NOT eBook)PDF
Azure AD & Windows 10: Better Together for Work or SchoolDOC

If you want to access all the Ebooks,Research papers, Reports in one place you can directly go here and get it. Hope these links will be helpful and Azure be the cloud you love!