Serial Console access on Azure Virtual Machine

Finally come the day that Microsoft was able to announce this feature. Accessing the serial console on an Azure VM is a huge step forward. But why is so important? It’s huge! Sometimes when our friend Mr Murphy comes and makes everything goes south, you are in a certain way limited on the diagnostic tools that you have, to troubleshoot the cause of that machine is not booting. Have access to the boot of the server (Linux or Windows) is crucial at this time. Serial Console access will end those day of redeploy a VM using the same disk, when this option is viable, off course. You can see the announcement here.

But let’s dive into the Accessing the Serial Console. On each VM that you have running on Azure, under the SUPPORT + TROUBLESHOOTING, you will find the Serial console (preview).

When you click on that, automatically start to connect to the Serial Console of that VM.

After a few seconds, finishes the connection. And show me this screen. But I can’t do anything.

If you scroll up, then some light at the end of the tunnel. OK, I need to enable the SAC (Special Administrative Console) on the server.

To access the Serial Console on the server you need the enable it. To enable, just follow the steps below:

  1. Connect to your VM through RDP (in this case a Windows VM)
  2. Open the cmd with elevated (administrative privileges)
  3. From the cmd prompt run the following commands
    bcdedit /ems {current} on
    bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200
  4. Reboot the VM

And then, you have access to the serial console of your server.

Cheers,

Marcos Nogueira
Azure MVP

azurecentric.com
Twitter: @mdnoga

Azure Cloud Shell vs Azure CLI

At a local community event, after my presentation I was answering some questions and one of the attendee ask me if Azure Cloud Shell is the same tool as Azure CLI.

So here is, Azure Cloud Shell is a containerized based shell running in the Azure Portal (or in the browser), using either a Linux (Bash) or Windows (PowerShell) base containers. Both containers are supported by Azure CLI, as well as the Windows based containers supporting Azure PowerShell. For more information How to use Azure Cloud Shell, visit the previous post (here).

As far as I know, Microsoft updates the CLI and the PowerShell version on a regular basis to whatever is the most stable and updated version. The update is applied to the respective container (Bash to the Linux container, and PowerShell to the Windows container (Windows Server 2016)), so everyone is always running the latest version on Azure Cloud Shell.

Is that mean that when we enable the Azure Cloud Shell, we are creating 2 containers? Yes. If you see the previous post, about how to use Azure Cloud Shell (see link above), you will see that on creation of the resources needed, beside the Resource Groups, Storage Accounts and File Shares, you are also creating the containers. Although, those are on the fly. That means every time you open the Azure Cloud Shell, you are connecting to the respective container.

Bash and PowerShell with possibility to run CLI?

You have the choice to run a Windows based cloud shell or a Linux based one. On the Windows one, comes with Azure PowerShell and also Azure CLI (on Bash on Windows). On the Linux one, comes with Bash and Azure CLI. In future, it will also support Azure PowerShell on Linux.

The Azure Cloud Shell comes with preinstalled open source PowerShell in both, Windows- and Linux-based Cloud Shell. I want to clarify that on Windows based cloud shell, Azure CLI runs directly in cmd.exe (Bash on Windows is not enabled in cloud shell yet).

Cheers,

Marcos Nogueira
Azure MVP

azurecentric.com
Twitter: @mdnoga

How to use Azure Cloud Shell

Since when they announce the Azure Cloud Shell (see post here), I’ve been waiting to use the PowerShell on the Azure Cloud Shell. I’m still growing my learning how to use the Azure CLI, but PowerShell I’ve been using for years, and I feel way more comfortable with it.

So, how I can use Azure Cloud Shell? Just open the Azure Portal, and on the top bar, between the Notifications and the Settings you will find the Azure Cloud Shell icon   .

When you click on the icon, it will ask you to configure the Azure Cloud Shell. The process will provision machines, where you can run the shells (Azure CLI and Azure PowerShell). It’s a fairly simple process. Just follow the steps below.

  1. Choose what is your Shell of choice. It doesn’t matter if you choose Bash or PowerShell. You can always switch back and forward after the initial setup.
  2. Choose what is the subscriptions that you want to use. Then you have the simple option of creating the storage or click in Show advanced setting. In this case I opt for the advanced settings.
  3. On the Advanced setting, you can specify the Resource Group, Storage Account and File Share names that you want to use.

    NOTE: Just remember that you have to follow the requirements how to create storage account and file shares (small caps and alphanumeric characters).
  4. In this case I select the Bash. After I click create, starting to provision the machines. First create all the resources from the previous step.
  5. After the creation of the resources, it’s connecting to the Bash terminal.
  6. And that is the end! Now you can start to use the Azure CLI on the Azure Portal.

Changing to PowerShell (or Shell)

After you create the Azure Cloud Shell, you can switch from Bash to PowerShell and vice versa. To do that, just follow the steps:

  1. Click on the Shell that you are using. In this case I was using Bash. When you click the drop box, you will see the other Shell.
  2. Select the Shell that you want. In this case PowerShell, then click Restart.

  3. After that, the Azure Cloud Shell is shutdown the previous Shell and it will restart on the new Shell (even if you never use it before).
  4. Now it’s creating all the resources required for the first use.
  5. After the creating of all the resources, it will connect to the terminal.
  6. Finished! Now you can you use the PowerShell on Azure portal.

Because you are login at the Azure Portal, you don’t need to run the PowerShell command Login-AzureRm. You can start from there.

Cheers,

Marcos Nogueira
Azure MVP

azurecentric.com
Twitter: @mdnoga

Using PowerShell on Azure Cloud Shell

On the past May 10th, during the keynote of the Microsoft Build 2017 Conference in Seattle (WA), Microsoft announce the Azure Cloud Shell (see post here). Although on the May 4th when I enter at the Azure Portal I saw already the Azure Cloud Shell. Since that day, I was eager to start playing with Azure Cloud Shell, specially using PowerShell.

But it’s not yet available (at least for me). So, if you are like me, and follow the news and all the blogs related, at the Azure Blog they are giving a sneak peak of the power of the PowerShell on Azure Cloud Shell (see the post here).

On the blog post, they said the PowerShell experience will be the same as the Bash experience, where you will:

  • Get authenticated shell access to Azure from virtually anywhere.
  • Use common tools and programming languages in a shell that’s updated and maintained by Microsoft.
  • Persist your files across sessions in attached Azure File storage.

Additionally, the PowerShell experience will provide:

  • Azure namespace capability to let you easily discover and navigate all Azure resources.
  • Interaction with VMs to enable seamless management into the guest VMs.
  • Extensible model to import additional cmdlets and ability to run any executable.

But, on the bottom of that post there the magic gate to have access to this wonderful and Powerful world of using PowerShell on Azure Cloud Shell. So, if you want (like me), to start using Azure Cloud Shell, Sign-up here to participate in a limited preview of PowerShell in Azure Cloud Shell.

Cheers,

Marcos Nogueira
azurecentric.com
Twitter: @mdnoga

Azure Cloud Shell Everywhere

WOW! Microsoft did it again! If you didn’t saw the announcements at the Microsoft Build 2017 Conference, you should!

They announce a lot of new things, but regarding Azure one of may favorite is the application for IOS specific!

I see this App, as a savior in so many ways! Those times that you have a problem and you need immediately access to run a PowerShell script or that an action like restart a virtual machine or even something else, now you have the right tools at your reach! Be able to access Azure subscription through my mobile phone is amazing!

From what I was able to see and play with is basically your azure portal but on a IOS App! I’ve been setting up and playing on Azure with this app and it’s is really good.

Here are some of the screenshots from the Azure IOS App.

 

As you have on the Azure Portal, you can select what you want to see, by choosing your favorite. This is the shortcut view of what is the most interesting to you.

When you select the resource the information and the tasks that you can do are really like what is available on the Azure Portal.

Even the notification that you have in the Azure Portal is available here. So you can track what is going on your Azure tenant.

When you select, the Virtual Machine is really good to see a lot of information. Usually on Apps for smartphones you have a subset of capabilities of the main too (in this case the Azure Portal), but with this Apps you can do >80% of your daily basic tasks through this App.

And as you expected, Azure Cloud Shell will be available on the Azure App as well. Although it’s not available yet. At least for me (see picture bellow).

But this is probably the serious reason why I will use this app a lot. I store a lot of my scripts in my OneNote and be able to copy/paste into this PowerShell window and setup a S2S vpn, for example, while you are waiting for your food arrived is something that every “Azure Geek”/”Azure Centric Nerd” dream of, Right? The possibilities are unlimited!

 

 

Cheers,

Marcos Nogueira
azurecentric.com
Twitter: @mdnoga