Host your ASP.NET Core 2.2 Web App with IIS (in-process and out-of-process hosting model) and deploy to Docker Windows Containers

One of the new features of ASP.NET Core 2.2 is support for hosting ASP.NET Core Web App with IIS using in-process or out-of-process hosting model. This article will cover steps needed to

  • Host ASP.NET Core 2.2 Web API with IIS using in-process hosting model
  • Host ASP.NET Core 2.2 Web API with IIS using out-of-process hosting model
  • Host ASP.NET Core 2.2 Web API in Docker Windows containers (with IIS)

In ASP.NET Core 2.2, a new ASP.NET Core Module (AspNetCoreModuleV2) has been introduced which is a native IIS module that plugs into the IIS pipeline and provides in-process or out-of-process hosting capabilities. AspNetCoreModule used to be the module in previous version.

Continue reading “Host your ASP.NET Core 2.2 Web App with IIS (in-process and out-of-process hosting model) and deploy to Docker Windows Containers”

Add real-time web functionality to Angular application using ASP.NET Core SignalR, Azure SignalR service and Azure SignalR Service bindings for Azure Functions 2.0

This is the next part of the series on developing and deploying

  • Angular, ASP.NET Core Web API and SQL Server to Azure Kubernetes Service
  • Function Apps using Azure Functions 2.0 runtime

In this article I am going to go through steps needed to add real-time web functionality to Angular App using ASP.NET Core SignalR and Azure SignalR Service bindings for Azure Functions 2.0. The specific topics which this article is going to cover are

  • Add ASP.NET Core SignalR to ASP.NET Core 2.1 Web API
    • ASP.NET Core SignalR
    • ASP.NET Core SignalR scale out using
      • Azure SignalR Service backplane
      • Redis Cache backplane
  • Publish/Subscribe messages to SignalR Hub from Angular App
  • Publish/Subscribe messages to SignalR Hub using Azure SignalR Service bindings for Azure Functions 2.0 from Angular App
  • Build Docker images and deploy to Azure Kubernetes Service

The previous articles of this series are

Azure Kubernetes Service (AKS) – Deploying Angular, ASP.NET Core and SQL Server on Linux

ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets

Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)

Azure Functions 2.0: Create Function App from Docker Image (Functions triggered by Cosmos DB, Blob storage, Event Hub and SignalR service bindings)

The tools used to develop these components are Visual Studio for Mac/VS Code/VS 2017, AKS Dashboard, Docker for Desktop and kubectl.

Continue reading “Add real-time web functionality to Angular application using ASP.NET Core SignalR, Azure SignalR service and Azure SignalR Service bindings for Azure Functions 2.0”

Azure Functions 2.0: Create Function App from Docker Image (Functions triggered by Cosmos DB, Blob storage, Event Hub and SignalR service bindings)

This is second part of the series on developing and deploying Azure Functions 2.0 where I will

  • Create a function triggered by Azure Cosmos DB
  • Create Azure SignalR Service bindings for Azure Functions 2.0
  • Publish Docker Image to Docker Hub
  • Create Function App from Docker Image in Azure Portal
  • Deploy functions to Azure Kubernetes Service from VS Code

The first part of the series provides details on creating functions triggered by Azure Blob storage and Event hub in Visual Studio Code along with deploying Azure Functions to Azure Kubernetes Service (AKS).

Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)

Dev tools used to develop these components are Visual Studio Code for macOS and Docker. The complete source code for this article can be downloaded from GitHub.

Continue reading “Azure Functions 2.0: Create Function App from Docker Image (Functions triggered by Cosmos DB, Blob storage, Event Hub and SignalR service bindings)”

ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets

This article is second part of the series on Deploying Angular, ASP.NET Core and SQL Server on Linux to Azure Kubernetes Service (AKS) cluster. The first part, describes steps needed to deploy these components to AKS. App configuration in ASP.NET Core is based on key-value pairs established by configuration providers. Configuration providers read configuration data into key-value pairs from a variety of configuration sources. In this article I am going to share multiple ways to load App configuration in ASP.net Core Web API

  • Hosting Environment specific appsettings.json
  • Dockerfile Environment Variables
  • Kubernetes
    • Container Environment variables with data from ConfigMap/Secret
    • Populate Volume (Config file) with data stored in a ConfigMap/Secret
  • Azure Key Vault Secrets

The tools used to develop these components are Visual Studio for Mac/VS Code/VS 2017, AKS Dashboard, Docker for Desktop and kubectl. The formatting of code snippets in this article may get distorted (especially yaml), thus please refer to GitHub repository for complete source code for this article.

Continue reading “ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets”

Azure Kubernetes Service (AKS): Azure AD SAML based Single Sign on to secure Elasticsearch and Kibana and securing communications in ELK

This is second part of the series on deploying Elasticsearch, Logstash and Kibana (ELK) to Azure Kubernetes Service cluster. In this article I am going to share steps needed to enable Azure AD SAML based single sign on to secure Elasticsearch and Kibana hosted in AKS. I will also go through steps needed to secure communications in ELK cluster. The first part describes steps needed to deploy ELK to AKS and consume messages from Azure Event Hub

Azure Kubernetes Service (AKS): Deploying Elasticsearch, Logstash and Kibana (ELK) and consume messages from Azure Event Hub

The third part describes steps needed to ingest Azure Redis Cache messages into Elasticsearch using Logstash’s Redis plugin.

Ingest Azure Redis Cache messages into Elasticsearch, Logstash and Kibana cluster deployed in Azure Kubernetes Service (AKS)

Using SAML SSO for Elasticsearch with AAD means that Elasticsearch does not need to be seeded with any user accounts from the directory. Instead, Elasticsearch is able to rely on the claims sent within a SAML token in response to successful authentication to determine identity and privileges. I have referred to this article to enable SAML based single sign on for Elasticsearch.

Kibana, as the user facing component, interacts with the user’s browser and receives all the SAML messages that the Azure AD sends to the Elastic Stack Service Provider. Elasticsearch implements most of the functionality a SAML Service Provider needs. It holds all SAML related configuration in the form of an authentication realm and it also generates all SAML messages required and passes them to Kibana to be relayed to the user’s browser. It finally consumes all SAML Responses that Kibana relays to it, verifies them, extracts the necessary authentication information and creates the internal authentication tokens based on that. The component diagram has been updated to add Azure AD SAML based SSO integration.

The dev tools used to develop these components are Visual Studio for Mac/VS Code, AKS Dashboard, kubectl, bash and openssl. The code snippets in this article are mostly yaml snippets and are included for reference only as formatting may get distorted thus please refer to GitHub repository for formatted resources.

Continue reading “Azure Kubernetes Service (AKS): Azure AD SAML based Single Sign on to secure Elasticsearch and Kibana and securing communications in ELK”

Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)

Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure. You can read about Azure Functions 2.0 general availability @ Introducing Azure Functions 2.0.  Runtime 2.0 runs on .NET Core 2, which means it can run on all platforms supported by .NET Core, including macOS and Linux. This enables cross-platform development and hosting scenarios.

In this article I am going to

  • Create Azure Functions triggered by Azure Blob storage and Event hub in Visual Studio Code
  • Debug locally in Visual Studio Code
  • Deploy Azure Functions to Azure Kubernetes Service

Dev tools used to develop these components are Visual Studio Code for macOS, Docker, AKS Dashboard and kubectl.

Continue reading “Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)”

Azure Kubernetes Service (AKS) – Deploying Angular, ASP.NET Core and SQL Server on Linux

Azure Kubernetes Service (AKS) makes it simple to deploy a managed Kubernetes cluster in Azure. The sample application for this article is developed in Angular, ASP.net core and SQL Server. I will go through the steps needed to deploy these components to AKS.

The dev tools used to develop these components are Visual Studio for Mac/Visual Studio 2017 and Visual Studio Code. AKS Dashboard as well as kubectl commands are used to create Kubernetes resources in AKS.

The sample use case is a front end app (Angular) which loads users from Web API (ASP.net Core) and these users are saved in SQL Server DB. The steps needed to deploy these components to AKS are

  • SQL Server on Linux 
    • Create PersistentVolumeClaim
    • Create Secret to specify sa user password
    • Create service for SQL Server
    • Create deployment for SQL Server
  • ASP.net Core Web API 
    • Create ASP.net Core Web API sample application
    • Create a Docker Hub repository
    • Create a docker image 
    • Publish docker image to Docker Hub 
    • Create service for ASP.net Core Web API
    • Create deployment for ASP.net Core Web API 
  • Angular App 
    • Create an Angular App sample application
    • Create a Docker Hub repository
    • Create a docker image 
    • Publish docker image to Docker Hub 
    • Create service for Angular App
    • Create deployment for Angular App

Continue reading “Azure Kubernetes Service (AKS) – Deploying Angular, ASP.NET Core and SQL Server on Linux”