Quote of the Day

more Quotes

Categories

Get notified of new posts

Buy me coffee

All posts in "Devops"

Build and deploy a WebJob alongside web app using azure pipelines

Published December 13, 2021 in .NET , .NET core , ASP.NET core , Azure , Devops - 1 Comment

In this post, I’m going to share some of the issues, misunderstandings I ran into when trying to setup and deploy a WebJob alongside a web application using azure pipelines. The WebJob is a console application, and the web app is an ASP.NET core. Both the WebJob and web app target .NET 5.

Continue reading

Caching node modules and Cypress installation in an azure devops pipeline.

Published March 20, 2021 in Azure , Devops - 0 Comments

I have a back-end-for-front-end application which I scaffolded using Visual Studio. The backend is an ASP.NET core web API, and the front end is Angular. In the angular application, I have Cypress end-to-end tests that I want to run as part of a build pipeline. Accomplishing the objective requires a few things. For instance, I need to install Cypress binaries on the build agent. I also need to start the angular app to which the tests can run again. Installing Cypress binaries is a lengthy process, and with other steps, the entire build can take a long time to finish. After a few trial and error, I finally got the build to run Cypress tests and cache the binaries. Keep in mind that caching makes sense if the time it takes to save and restore the cache data is considerably less than the time it takes to download and install the data directly.

Continue reading

How to retrieve connection strings in azure key vault from ASP.NET using configuration builders, XML transformation and azure devops.

Published May 19, 2020 in .NET , Azure , Devops - 7 Comments

Configuration builders are mechanisms to retrieve connection strings from external sources. Using configuration builders, you may not have to do much codings besides installing packages and providing XML configurations for connecting to popular sources. In this post, I share with you my experience in using configuration builders for .NET to securely retrieve connection strings from an azure key vault. I’ll go over the setup and share some of the issues I face while integrating my app with azure key vault.

Continue reading

Using azure devops File Transform to deploy a same angular build to multiple environments.

Published September 30, 2019 in Angular , Azure , Devops - 4 Comments

For an angular application, at build time, if you pass in a configuration name, then the webpack build tool replaces the content of the environment.ts file with the content of the environment. For instance, if you run the command ng build --prod, angular replaces the content of environment.ts with that of the environment.prod.ts. Similarly, if you run ng build --staging, angular replaces environment.ts with environment.staging.ts, provided the file exists. This approach works but it requires building multiple times for different environments. In this post, I show you the approach I learn from my coworker to build one time and deploy to multiple environments, using angular APP_INITIALIZER and the File Transform task in azure devops.

You can find complete source code for this post on my github.

Continue reading

Build and deploy an ASP.NET core app running on IIS using Azure pipelines

Published August 15, 2019 in ASP.NET core , Azure , Devops , IIS - 1 Comment

This is part III of the series in which I cover how to build and deploy an ASP.NET core app to IIS running on a Windows VM. In part I, I cover how to build and publish an artifact using visual studio. In part II, I cover how to manually deploy the artifact to IIS and go over some of the concepts such as bindings, app pools and website.

In this tutorial, I walks you through the steps to automate the build and deployment process using azure pipelines.

Continue reading

Replacing variables in an angular app using Replace Token extension.

Published May 6, 2019 in Angular , Azure , Devops - 0 Comments

In this post, I am going to talk about the Replace Tokens extension, which I have found to be useful for dynamically replace values at build time. For instance, I have used it to display the build number which comes from azure build pipelines in an angular application.

Making the build number readily available to both programmers and non programmers such as business system analysts (BSA) and end users has a couple of benefits. For instance, by displaying the build number in the app, the analysts can quickly tell whether they are testing the expected build after a deployment. As a developer, I often find myself wondering why certain features work on one environment and not the other. Seeing the build number in the app allows me to quickly check whether an issue has to do with the codes or the environment.

Azure Devops provides an easy way to assemble the build number. You can see the options to edit the build number in your build pipelines, under the Options tab.

Continue reading

Deploy an ASP.NET core application to IIS on Windows Server 2019.

Published March 16, 2019 in ASP.NET core , Devops , IIS - 4 Comments

This is part II of the blog post series in which I share some of ways to build and deploy an ASP.NET core application to IIS running on a Windows VM. In the previous post, I cover how to build and published an ASP.NET core application. The end result is an artifact (a published directory). In this post, I go over how to deploy the artifact to IIS. Along the way, we’ll discuss:

  • Enabling IIS
  • .NET core runtime and hosting bundle
  • IIS website and application configuration
  • IIS application pool

Continue reading

Build and publish an ASP.NET core application using Visual Studio.

Published March 4, 2019 in ASP.NET core , Devops - 2 Comments

This is part I of the blog post series in which I share some of the ways I have learned to build and deploy an ASP.NET core 2 application to IIS running on Windows Server VM.

In this post, we’ll cover just the basics of how to build and publish an ASP.NET core 2 application to a folder using Visual Studio 2017. In the process, we’ll discuss some of the concepts you should be familiar with:

  • Release vs Debug build.
  • Deployment mode: framework dependent deployment vs self contained deployment.

I assume you have a working ASP.NET core application which you want to deploy. If not, you can just create a new ASP.NET core project, following the documentation.

Continue reading