Good Reads This Week

DevOps Before and After Kubernetes

This is a fun read, a lil bit of educational, but more of informative IMO. Anoop explains how Kubernetes has changed DevOps: automation. And with idempotency and immutability, we can increase efficiency and economics benefits in DevOps-ing Kubernetes.

 


Exploring the Visual Studio Test Platform

34-minute video that goes back to basic: unit testing, why we need it and how to do it. But this one goes even deeper, how to do it in Visual Studio, Visual Studio Code and Azure Pipelines, executing tests in parallel, migrating, diagnostics crashes and much more! Worth your 34 minutes.

 


Think Like A Startup When Launching Your Analytics Program

Build your analytics program with startup mindset. Yes, it may not be a technical read, more of philosophical, but still a good read regardless.

 


Come discuss your side projects! [July 2019]

I thought this thread is pretty cool, people come together to discuss their own side projects. Get some creative ideas going and some of the projects are actually really cool! This thread is for July 2019, but there is a new thread every month.

 


ASP.NET Core 3.0 Exception Handling

Have you ever used `try/catch` blocks but still miss some errors? Dino explains a more effective way to trap exceptions that go unnoticed and unhandled in ASP.NET Core 3.0

 


Go team proposes parametric polymorphism

Generics is coming to Go language! Parametric Polymorphism, a fancy way to say Generics, however, is still in a draft. But, let’s hope it’s going to be released soon.
Advertisements

Shared Assembly in Visual Studio Projects

Here is steps to create shared assembly file in multiple VS projects:
1. Add new shared assembly file.
2019-06-10 16_38_40-LinqJoin - Microsoft Visual Studio (Administrator)

2. For each project that will use the shared assembly, right click on the `Properties` under the project and add existing item.
2019-06-10 16_43_15-

3. Select the shared assembly file, but add it as a link
2019-06-10 16_39_38-LinqJoin - Microsoft Visual Studio (Administrator)
2019-06-10 16_40_12-LinqJoin - Microsoft Visual Studio (Administrator)

4. Remove attribute in the project assembly that you want to inherit from the shared. For example, if you want to share `AssemblyVersion` across projects, remove them from projects’ assembly and add it shared assembly file.

SharedAssembly.cs

using System.Reflection;

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Azure Resource Manager

Azure Resource Manager Overview

Azure Resource Manager, or ARM, is a way to manage resources in Azure. With ARM, we will be able to define our platform, or infrastructure, as code.

One of the benefits of using code to manage platform / infrastructure is we can check in to source control to see different changes over time. It also allow us to reuse part of the code for other deployment.

Azure Resource Manager also have the following benefits:

  • Manage resources. Deploy, add, remove resources at ease.
  • Resource grouping. Group resource into logical set that makes sense to you, i.e.: environment, location, etc.
  • Resource dependencies. Handle dependencies between different resources.
  • Repeatable deployments. ARM template can be used to perform same. repeatable deployments.
  • Template. Using template and code to define platform / infrastructure. Template is also reusable.

Architecture

With ARM architecture, there are few components. They are:

  • Resource providers. These are the functionalities of the resources, such as compute, storage, etc.
  • Resource types. The actual resource of Azure services that will be deployed.
  • ARM REST APIs. Allow invocation of ARM command thru its APIs.

In general, ARM template has the following structure:

  • Schema (required)
  • Content Version (required)
  • Parameter
  • Variables
  • Resources
  • Output

How it Works

You can also abstract out parameters for a ARM template to its own template parameter file. ARM template parameter must also have schema and version. The version doesn’t have to be the same with the template file.

In ARM template deployment, Azure automatically detect dependencies between resource types and deploy the dependent resource first. For example, if a template has specified to deploy App Service Plan and App Service Web Site, ARM REST API will deploy App Service Plan first, which Web Site depends on.

You can also specify dependency in ARM template as well as deploy resources simultaneously for services that don’t have dependency, i.e. deploying 4 App Service Websites.

Azure Resource Manager will only deploy resources in the template that are not yet exist. When you the specified resource already exists, it will be skipped.

Within ARM template, you can also specify to deploy the application itself, this is useful, for example, when the App Service Web Site deployment will include populating the website with web application from source control.

Reference

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates

https://github.com/Azure/azure-resource-manager-schemas