Retrieve VM FQDN via Azure CLI

Surprisingly trying to get an rdp file or enough information to start an rdp session via Azure CLI is anything but trivial. This is what i am currently doing on my machine (zsch):

az vm show -n <name>  -g <group>  -o jsonc -d | grep fqdns

Then, i grab the value and copy to the clipboard. Seems too much work. I need to find an easier way.

Setting up Docker on an Azure VM for Development

One of my goals for 2018 is to ramp up with using containerization as a go to approach to development.  Thus, having a solid development environment that can run Docker is certainly a must.  Just like with many enterprises, Windows 7 or Windows 8.X dominates still and thus you may end up stuck, due to Docker on Windows requirements.

Azure comes to the rescue here with Nested Virtualization feature for Dv3 and Ev3 VMs.

  1. Install a Windows 10 Pro image with Standard_D4_v3 size and make sure its location is either East or West 2.
  2. Install Hyper-V on Windows 10 Pro
    Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
  3. Install Docker for Windows as per standard instructions.

That was easy.  Don’t forget to turn on auto shutdown for your developer VM to conserve credits.  Cheers!

Sitecore 9 is here

I have been recently delving into the Sitecore CMS due to client’s needs.  It has a pretty close community due to the fact that Sitecore folks wants people to pay money for everything but the platform is growing on me.  Thus, I want to make a few folks aware that Sitecore 9 has been announced, presumably at Symposium 2017.  It has a ton of new features but the most exciting that all of its components are supporting PAAS deployments.  It’s time to take a lap around it in Azure.

Resetting the DNS server list to static in Azure

The SharePoint 2013 development environment in Azure that i maintain contains a fully fledged AD/DNS infrastructure. To keep things lean, i did not want to maintain a separate infrastructure VM and just combine the roles. However, every time the machine is restarted, the IP interface settings needs to be adjusted. I need to ensure that the Azure provided DNS server needs to be come secondary DNS server in the list while loopback address stays as primary. I have not fully automated this just yet, but here is the command-line methods to get it done.

netsh interface ip "Ethernet 8" add dnsserver 127.0.0.1 primary
netsh interface ip add dnsserver "Ethernet 8" 100.112.12.40 index=2

To update the DNS services forwarder to the new server ip address:

import-module DnsServer
Set-DnsServerForwarder -IPAddress 100.112.12.40

Managing Azure dev environment from PowerShell

Recently, I’ve been spending some time prototyping the new SharePoint 2013 App Model in my Azure provision SP2013 development environment.  I wanted to make sure that i can shut it down or start it up quickly.  So PowerShell is of course the answer here.

Small assumption is that the Azure Service Name matches the Virtual Machines. It is possible to have multiple virtual machines provisioned under the same service Name

First, ensure that the valid Azure subscription is attached to the Azure command line session:

Get-AzureAccount

If that returns no subscriptions, then use Add-AzureAccount commandlet to add an active subscription.
To start/stop the Azure Virtual Machines I use these commands:

Get-AzureVM -ServiceName <ServiceName> | Start-AzureVM
Get-AzureVM -ServiceName <ServiceName> | Stop-AzureVM -Force:$true

I’ll add more commands as i start doing more complex things with Azure dev boxes as I go along.