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 Elasticsearch, Logstash and Kibana (ELK) and consume messages from Azure Event Hub

This article is part of the series of blogs on Azure Kubernetes Service (AKS). In this article I am going to share my experience of setting up Elasticsearch, Logstash and Kibana cluster in Azure Kubernetes Service (AKS) and consume messages from Event Hub. After the end of this article, we are going to have fully functional ELK stack with Azure Event Hub integration.

A sample client App (e.g. IOT device) will be publishing messages to Event Hub and these messages will be ingested into Elasticsearch using ‘Azure Event Hub’ plugin of Logstash. This article needs x-pack features of Elasticsearch thus I will show steps needed to activate trial license.

The second part of this series  goes through steps needed to enable Azure AD SAML based single sign on to secure Elasticsearch and Kibana hosted in AKS. The third part of this series goes through steps needed to ingest Azure Redis Cache messages into Elasticsearch using Logstash’s Redis plugin.

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

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

Azure Dev Spaces – Debug Containers directly in Azure Kubernetes Service (AKS) from Visual Studio 2017

This is second part of the series on Azure Dev Spaces. The first part of this services describes steps needed to deploy Angular App and ASP.net Core Web API to AKS using Azure Dev Spaces. This article will show ease of debugging containers deployed in AKS from Visual Studio 2017.

In the first part of this series, I had created a sample ASP.net Core Web API app and deployed that to AKS using Azure Dev Spaces. The steps needed to debug ASP.net Core Web API application running in AKS are

  • Install Visual Studio Tools for Kubernetes. Once installation completes, open ‘Tools -> Extensions and Updates’ in Visual Studio and update this extension for any updates.
  • Open SampleWebApp solution in Visual Studio. The source code can be downloaded from GitHub.
  • Select Debug target as Azure Dev Spaces

  • Add a breakpoint in Get method of UsersController which we are going to debug
  • Start Debugging and select AKS cluster and Space in Azure Dev Spaces prompt
  • You can get public URL from Output window by selecting Azure Dev Spaces as displayed below
  • Open http://{URL}/api/users in browser and request will hit the breakpoint added previously

You can check the status of URL by running command azds list-uris. If URL isn’t available for more than 5 minutes you will need to delete PODS as explained in previous article. This completes this article which showed how easy it is to debug containers deployed in AKS from Visual Studio 2017 using Azure Dev Spaces.

Azure Dev Spaces – Deploying Angular and ASP.net Core App to Azure Kubernetes Service (AKS)

This article will show the ease of running and deploying containers in Azure Kubernetes Service (AKS) with minimal dev machine setup with Azure Dev Spaces. I am going to reuse sample application components from my previous article on AKS. With Azure Dev Spaces, you can develop on Windows, Mac, or Linux using familiar tools like Visual Studio, Visual Studio Code, or the command line. I have chosen Visual Studio Code on Mac.

In this article, I will share the steps needed to deploy sample application I created in Angular and ASP.net Core Web API using Azure Dev Spaces.

At time of writing this article Azure Dev Spaces is in preview and is isn’t available in all regions.

Continue reading “Azure Dev Spaces – Deploying Angular and ASP.net Core App to Azure Kubernetes Service (AKS)”

Utility to generate Word documents from templates using Visual Studio 2017 and DocumentFormat.OpenXml 2.8

WordDocGenerator is an utility to generate Word documents from templates using Visual Studio 2017, .NET Framework 4.7 and DocumentFormat.OpenXml 2.8.1. WordDocGenerator helps generate Word documents both non-refresh-able as well as refresh-able based on predefined templates using minimum code changes. Content controls are used as placeholders for document generation.

You can download the code from GitHub.

I had created this utility a few years back and you can read more details by going through older blogs which are still relevant (other than Charts which have been removed).

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”