My articles about DevOps

Integrate a Web App with a CosmosDB database using a Virtual Network Service Endpoint in Azure

Consider the following real-life application scenario. Your Web App (Azure App Service) accesses a CosmosDB instance to read data. Your users access the web application from its UI, and you want to ensure they cannot directly access the CosmosDB instance using its public URL.

In this article, you will learn:

  • How to use a System Managed Identity and RBAC roles to access your CosmosDB instance from your Web App
  • How to integrate your Web App and your CosmosDB with an Azure Virtual Network
  • How to create a Service Endpoint to allow only the Virtual Network to access CosmosDB
  • All the necessary az CLI commands to complete the tutorial, without using the Azure Portal UI :)
Read the complete article

Deploy a .NET & Angular application to an Azure App Service with multiple environments using an Azure Pipeline and Bicep

In this article, I will show you a full tutorial on how to create a .NET application using Angular for the frontend and deploy this application with Azure DevOps pipelines on multiple App Service environments.

You are going to learn:

  • How to use pipeline templates to simplify the structure of our pipeline
  • How to use multiple stages to split semantically different jobs
  • How to use multiple Azure environments by elevating the power of a for loop in the pipeline
  • How to use Bicep for setting up the needed Azure infrastructure
  • How to deploy the application on an Azure App Service by using different deployment slots

You can find the code for this tutorial on my GitHub account.

Read the complete article

Use the TableOutput attribute to write in a Storage Account from your Function by using a Managed Identity

Consider the following scenario in Azure:

  • We want to create a new Azure Function triggered by an HTTP request containing some data.
  • We want to write this data as new entities into a Storage Table.
  • We want to avoid storing any connection string in your code and instead use an Entra ID Managed Identity.
  • We want to avoid writing any specific code by using the SDK for accessing the Table.

The TableOutputAttribute comes to the rescue. Let us see how.

Read the complete article

Access Azure Key Vault secrets using a Service Principle with certificate within an Azure DevOps pipeline

Azure Key Vault is a cloud service that provides secure storage for secrets, keys, and certificates of your applications. Integrating Key Vault with Azure DevOps pipelines enhances security by managing sensitive information efficiently.

This article will guide you through the process of accessing secrets from an Azure Key Vault using a Service Principal with a certificate within an Azure pipeline. We will start for the very first steps of creating all the needed resources in Azure, before going back to Azure DevOps. For training reasons, we will perform all the configuration steps with CLI commands, avoiding the Azure Portal UI.

Read the complete article

The way to fix the You don’t appear to have an active Azure subscription error in Azure DevOps

I recently wanted to configure the CI/CD process in Azure DevOps of a new application I created and wire it with my Azure account so that the application will be deployed on an App Service. A missing user permission in the project settings was the problem. Lets see the steps to solve the error.

Read the complete article

Understanding and Resolving the BCP001 Error in Bicep

Bicep, a domain-specific language (DSL) for deploying Azure resources, simplifies the process of writing infrastructure as code. However, like any programming language, it has its own set of rules and syntax that must be followed. One common error that developers encounter is the BCP001 error, which occurs when Bicep encounters an unrecognized token.

Read the complete article

Understand iterator methods and the yield keyword in C# with the help of examples

An iterator in C# is a method that utilizes the yield keyword to return elements one at a time to the caller. Such methods are very useful for traversing collections, without needing to create an intermediate collection inside the method for storing results.

This article will help you understand how to use yield by using practical examples.

Read the complete article

Tips and tricks for accelerating your pipelines on GitLab

When practicing continuous integration and continuous deployment (CI/CD), optimizing build, test, and deploy times becomes crucial. GitLab, a popular platform for managing CI/CD pipelines, offers several strategies to speed up your workflows. Let’s explore some tricks you can use to accelerate the entire process.

Read the complete article

Azure DevOps - Get the capacity of your team in the current sprint programmatically

Microsoft Azure DevOps provides a solid way of tracking your team-progress while using the scrum principles.

Nuget Packages with WebApi Clients are provided for accessing your team information via code. For example you can access the queries of your team, the work items of your backlog and much more!

In this article we will focus on getting the capacity of the current sprint for each member of your team. This is the code snippet that does our job:

Read the complete article

Secure your Azure Functions while in development

Azure Functions are compact and lightweight chunks of code hosted in Azure cloud and can be accessed via HTTP. Since these functions might access sensible data of your application, you want a safe way to call them.

When you are in the development phase, you can use the Host Keys which is a way of authenticating yourself when calling an Azure Function.

When in production, you will have to change to App Service Authentication, since the Host Keys should not be stored in the client’s machines.

Read the complete article

Implement a static Vue app and deploy it on Azure using CI/CD. Part 2, Continuous Delivery

In the previous article we focused on building the Continuous Integration Pipeline of our hello-world Vue app.

In Part 2 we are going to do the steps for deploying the result of the CI Pipeline to Azure. From there our static website is going to be visible to the rest of the world.

Here are the steps you will have to take:

Read the complete article

Implement a static Vue app and deploy it on Azure using CI/CD. Part 1, Continuous Integration

While I have some extra free time because of the Corona virus outbreak, I decided to experiment with Vue and build a small static HTML Hello-World application for getting to know the framework better. The website contains no backend code.

The article focuses on how to automate the Build and Deploy process of our small application. I will try to clarify the steps needed till our static website is visible through an Azure URL.

In this article I will skip the Vue logic of my app and focus solely on the DevOps tasks that have to be made in Azure DevOps. Our static website will then be deployed on an Azure Storage Container. The article focuses on Windows users.

Read the complete article

How to disable a Nuget Feed in a .NET project

Most of us use private feeds in NuGet for storing our NuGet Packages. However, some projects might have stricter security restrictions that others, making it necessary to disable certain feeds to avoid using them as references.

To “blacklist” feeds, you can use the following configuration:

Read the complete article

Create an Azure Function with Storage Table in Visual Studio Code

Back in 2017, I wrote an article about how to program an Azure Function in Visual Studio. With the current article I want to give the current state of creating Functions, this time in Visual Studio Code.

We are going to create a GET Function that retrieves all the rows from an Azure Storage Table and returns them the caller.

Here are the steps from scratch:

Read the complete article

Connect to an MSSQL Database running on a Docker Container

Running an MSSQL Database inside a Linux Docker Container can be done for many reasons. You might want to host your dockerize your whole web application or even the DB part of it. When using such a Container you want to have an easy way to see the content of the Database. For that we can use the SQL Server Management Studio tool.

Read the complete article

How to solve the "ERROR [IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified" error when setting up an ODBC connection

Lately I was setting up a web application inside a Docker. container which communicates via ODBC with a database. In order to be able to query the database, I had to add the name of the database and the credentials into the odbc.ini and odbcinst.ini files. My queries were failing with the following message: “ERROR [IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified”

Read the complete article

How to install Windows SSL certificates into your Docker Linux container

When using web applications inside a Docker Container you might come across SSL certificates that have to be installed on the running Container. Things get a little bit more complicated when you want to install Windows certificates into a Linux Image. Following you can see the steps to achieve this task.

Read the complete article

How to keep the IIS Application Pools always awake

When working with “9 to 5” web applications you deal with idle time periods where the users submit few or no requests to specific services of your application. In that cases the first request landing to a service hosted on IIS will take much longer than usual because the service was in sleep mode for better management of resources.

We can avoid this behavior and keep our services in an always-running mode by applying the following three configurations in IIS:

Read the complete article

How to solve the "project.assets.json not found. Run a NuGet package restore to generate this file" problem in .NET Core applications when using MSBuild

While I was developing a .NET Core web application and wanted to automate the build process in VSTS, I got the following error, when I was triggering the build:

Error: Assets file ...\project.assets.json not found. Run a NuGet package restore to generate this file. Process 'msbuild.exe' exited with code 1.

The issue here is that needed .NET Core files are missing, when we start build our application. I solved this problem by defined an extra initial step in my build process.

Read the complete article