Tuesday, May 26, 2020

Microsoft Cloud Subscriptions

Note: please may attention to the publication date of this article. Microsoft is always changing the rules!

Deciding how to start using Azure,  Microsoft 365, and Dynamics 365 can sometimes be a daunting experience. What is confusing is a whole lot of people competing along-side of Microsoft to sell you the same Microsoft-hosted services, and not a lot of explanation as to how this is organized or what is best for you.

This figure shows the four options end-users are presented with, ordered by functionality and price descending. I will address the benefits and cost of each of these.


Saturday, May 23, 2020

Active Directory Scenarios with Azure

This is a short post to help you decide what kind of Active Directory structure you need in your Azure or on-premises/Azure environment. "What choice should I make?" and "What are the trade-offs?" are questions I frequently hear, so hopefully this will organize it for you.

There are basically six scenarios for using Active Directory. They all have pros and cons, mostly with effort vs flexibility. Of course what you should pick depends on what you need.


Tuesday, May 12, 2020

PATH and Login bash on MacOS

It took a while to run down why certain older versions of programs were always launched when I was in Visual Studio Code, but not when I opened a terminal window. I first found this in relationship to nvm and documented it in this post: VS Code and the Node Version Manager. Unfortunately it affects other commands too, and it isn't just a VS Code issue, so I thought a more general post was in order.

Of course we know that the PATH environment variable is a colon-separated list of directories that are searched sequentially and the first match for a command is used:

$ echo $PATH
/usr/local/Cellar/python/3.7.4/bin:/usr/bin:/usr/local/bin

So in ~/.bash_profile we make sure that we set up the path in the correct order. For example, there is a python program in /usr/bin, so if we install a new python version we make sure the PATH points to the new installation before it points to /usr/bin. Python 3.7 has to come before /usr/bin in the PATH!

Some folks like to put PATH modifications in ~/.bashrc which is fine. You just have to remember that ~/.bashrc is supposed to run for every bash instance, so don't keep extending the PATH every time it gets called. This post explains it: Always Modify PATH and Other Variables Conditionally.

The problem is that MacOS VS Code (and other tools) may launch bash with a -l  or --login option. This creates a problem on MacOS because the bash program has been altered so that -l forces /usr/bin and /usr/local/bin to the front of the PATH. It is actually a really good security feature to make sure that built-in programs are located before a Trojan horse. Unfortunately sometimes we need to override that. Specifically, three important things that happen when -l is used:

Always Modify PATH and Other Variables Conditionally

You MUST use conditional statements while modifying the PATH environment variable (and others) in your shell startup files. I will use bash for this example, but the reasoning is the same for all shells.

A typical modification to the PATH in ~/.bash_profile looks something like this:

export PATH=$PATH:/usr/local/Cellar/node/14.2.0/bin

The problem is that if the file is "sourced" twice in the shell, your path ends up looking like this, with the same directory there twice. It works, but it slows things down:

$ source ~/.bash_profile
$ echo $PATH
/usr/bin:/usr/local/Cellar/node/14.2.0/bin:/usr/local/Cellar/node/14.2.0/bin
$