Azure DevOps Pipelines with Git-flow Tagging

Working with a customer right now and trying to accomplish a number of tasks. First, is getting them accustomed to an enterprise branching strategy.  The second, is helping them become familiar with Azure DevOps and configuring some build and deployment pipelines.  The customer has their own versioning strategy – different across multiple projects – and they communicate with the business stakeholders features and resolved bugs in each release.  Using a “one-size-fits-all” versioning configuration doesn’t work, and Azure DevOps only allows for a few custom placeholders in the Build Number.  Luckily, Git-flow allows you to tag merges with custom versions so I simply had to configure Azure DevOps to use the latest tag on the master branch for the build number.

Read more

Using Sinon+Rewire for Unit Testing with Private Methods

How many times have you tried to follow good programming practices by creating well-defined, single-purposed methods and only exposing the necessary public methods outside of your library and become frustrated with attempting to write unit tests for your code? You then begin to question your decisions about which method(s) should be public and which methods should be private. Additionally, you start to wonder if 100% code coverage is truly necessary. I mean, 75% of code coverage isn’t really that bad, is it? It’s better than 10%, right?

If you scour the web for suggestions, there’s a number of less-than-optimal solutions for this problem. First, I’d like to cover some of these solutions and why they are less than ideal. Second, I’ll provide some production code that contains a private method along with how to successfully achieve 100% coverage with unit tests. The examples provided are in Node.js.

Read more

nslookup Against Azure DNS Returns "No Response from Server"

When attempting to use nslookup to query DNS zones hosted in Azure, you may receive the error message No response from server. This reason for this is because the request defaults to Azure DNS over IPv6 while your local network only supports IPv4.

Let’s look at an example.

Read more

Adding Font Awesome to ASP.NET Core Angular 2 Applications in Visual Studio 2017

If you’re using Visual Studio 2017’s SPA templates for Angular, no doubt you’ve wanted to add third-party libraries such as Font Awesome.  You could reference these dependencies in the index.html, but it would be better for performance if they were included in the webpack bundle.  If you’ve never worked with webpack before, this could initially be a little confusing.  But, don’t worry as it’s actually pretty simple.

Read more

Angular2+ SafeUrl Pipe

Instead of adding a function to the JavaScript of each of your components to properly display HTML links, use an Angular2 pipe.

Create a pipe service called safe-url.pipe.ts and add the following:

Next, inject the pipe service in your app.module.ts:

And, in your Angular module declarations section:

Now, to use in your view:

Adding Skype and Skype for Business HTML Links

Have you ever needed to add links into a web page that enabled a visitor to click to begin a chat or phone call with a Skype or Skype for business user? If you have the necessary plug-ins enabled in the browser, a phone number may be recognized automatically, but that can’t always be guaranteed. There are native URI’s to ensure that, if a site visitor has Skype or Skype for Business installed, a chat or phone call will be initialized.

Read more

Installing and Enabling Telnet Server on Ubuntu Linux

By default, Telnet server is disabled for security purposes in favor of SSH.  However, you can enable Telnet for testing purposes or for legacy scripts.

Read more

Install WordPress on Microsoft Azure PaaS

I have been hosting this blog on WP Engine for a couple of years and my experience has been fantastic.  A while back, I explored moving my blog to Azure, but in order to have the same high-availability that WP Engine offered, I would be required to construct a load-balanced WordPress IaaS implementation – installing, configuring and managing the WordPress app environment and the MySQL database (VMs, load balancers, firewalls, etc.).  Additionally, I could have chosen to use ClearDB as the MySQL provider.  But, all in all, creating a linux-based high-availability environment would be considerably expensive.

Just recently, Microsoft released two new features in Azure – Azure Service Plan on Linux and Azure Database for MySQL Server.  These two components allow me to run a full PaaS implementation of WordPress.  Continue to read to learn how to install WordPress on a Microsoft Azure PaaS environment.

Read more

Azure Functions - Simple Website Demo

In this first demo post, I want to show how to create a simple website using Azure functions. This isn’t anything fancy and, more than likely, you won’t be attempting to do this in production, but it will still serve a purpose for us to get introduced to building functions. It is important to note that, when functions first became available, some people did, in fact, try to host their website(s) by using functions only. Why not? After all, they would only have to pay for the time the function actually ran. This could end up being a mere $1 or $2 each month. Microsoft got wind of this and put some mechanisms in place to prevent this sort of thing. We’re going to sidestep some of these mechanisms by hard-coding some HTTP responses. Again, this isn’t production-worthy.
Read more

Conjunction Junction, What's Your Function: Azure Functions - Overview

So, you’ve heard about Azure Functions?  Possibly read about them somewhere?  Why all the fuss?  What exactly are Azure Functions? Well, you’ve stopped at the right place.  In this post and the next couple of posts, I’m going to talk about Azure Functions, along with their history, use cases and some tutorials.  So, let’s get started.

Read more