Quote of the Day

more Quotes

Categories

Buy me a coffee

All posts in "Azure"

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

Access azure key vault from an ASP.NET core app on IIS using X.509 certificate

In this post, I go over in more details the steps of retrieving secrets from an azure key vault using client id and secret. This approach is one of the three ways to authenticate a Windows virtual machine against azure key vault. It is suitable if your app runs on a virtual machine which is not an azure resource and so cannot use azure managed identity.

At the high level, the process involves these steps:

  • Register the application in azure.
  • Generate and add a X.509 certificate into a certificate store.
  • Grant IIS_IUSRS user permission to access the private key of the certificate.
  • Upload the public key of the certificate to the app’s registration.
  • Grant the app access to the key vault.
  • Add codes to Startup file to authenticate against AD using the certificate.

You can find the sample project for this post here.

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

OIDC implicit flow in angular with MSAL for angular, Microsoft Identity Platform (v2.0) and Azure AD.

In this post, I share my experience about doing OpenID Connect (OIDC) implicit flow using Microsoft Authentication library (MSAL) for Angular, Microsoft Identity Platform (v2.0), and Azure AD. This post is part of the blog post series in which I cover implementing OIDC flows to protect as system that consists of an angular front-end application and asp.net core web apis. In the previous post, I give a high level overview of the technologies involved in protecting such a system.

Continue reading

Protecting angular and ASP.NET core applications – An Overview.

Published June 23, 2019 in Angular , ASP.NET core , Azure , OAuth2 , security - 0 Comments
Protecting angular and ASP.NET core applications
Protect Angular and ASP.NET core applications

In this and upcoming blog posts, I’ll be talking about integrating Azure Active Directory (AAD) and leveraging open source libraries to protect a system consisting of an angular application and ASP.NET core web apis.

In this post, I just want to give a high level overview of the setup and the technologies involved in securing such as system. As such, I likely gloss over some of the points. In subsequent posts, I’ll cover the specific parts in more details.

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

Three ways of authenticating a Windows virtual machine against Azure Key Vault.

Published April 13, 2019 in .NET core , ASP.NET core , Azure , security - 2 Comments

In this post, I share three ways of gaining a Windows virtual machine access to a key vault. The machine can be an azure virtual machine or a non-azure machine such as your personal computer or a on premise server.

Continue reading

Azure queue storage: overview, benefits and usage in .NET/ .NET core application.

Published January 20, 2019 in Azure - 2 Comments

I have seen applications which use a database to simulate a queue as part of processing some workflow tasks. Using a database to simulate a messaging queue mean you have to write more boilerplate codes, sql queries for the CRUD operations as well as handle concurrency issues if your applications run on multiple nodes.

Microsoft has made it easy to utilize messaging and queueing in your application with azure queue storage, which is what I talk about in this post.

Continue reading