Tag: Bash

Mastering Azure using Cloud Shell Session

Video: Mastering Azure using Cloud Shell, PowerShell and Bash!

At the NetWork 9 Conference in Neum and at the Global Azure Bootcamp in Switzerland, I presented my session about Mastering Azure using Cloud Shell. Since I got a lot of requests for the session to be online, I recorded my presentation and made it available for everyone. The presentation is a live demo and summary of my blog post “Mastering Azure with Cloud Shell“, which gives you an overview about the Cloud Shell and some of the advanced stuff you can do.

In the session you learn:

I hope you enjoy watching it and let me know what you think in the comments.



Mastering Azure with Cloud Shell

Mastering Azure with Cloud Shell

There are multiple ways to interact and manage resources in Microsoft Azure. You can use the Azure Portal or command line tools like the Azure PowerShell module or the Azure CLI, which you can install on your local machine. However, to set up a cloud management workstation for administrators and developers can be quite a lot of work. Especially if you have multiple computers, keeping consistency between these machines can be challenging. Another challenge is keeping the environment secure and all the tools up to date. The Azure Cloud Shell addresses this any many more things.

Cloud Shell is not brand new, Microsoft announced Cloud Shell at Build 2017. This blog post is about how you can master Azure with Cloud Shell and give you an overview of the possibilities of Cloud Shell.

 

What is Cloud Shell

Cloud Shell Azure Portal

Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Azure Cloud Shell is assigned per unique user account and automatically authenticated with each session. This makes it a private and secure environment.

You get a modern web-based command line experience which can be accessed from several endpoints like the Azure Portal, shell.azure.com and the Azure mobile app, Visual Studio Code or directly in the Azure docs.

In the backend, Azure uses containers and automatically attaches an Azure File Share to the container. You can store the data on it, so your data is persistent. This persists your data across different Cloud Shell sessions.

Cloud Shell Bash and PowerShell

You can choose your preferred shell experience. Cloud Shell supports Bash and PowerShell and included your favorite third-party tools and standard tools and languages. If something like a module is missing, you can add it.



Azure Cloud Shell

Azure Cloud Shell – shell.azure.com and in Visual Studio Code

Back in May Microsoft made the Azure Cloud Shell available in the Microsoft Azure Portal. Now you can use it even quicker by just go to shell.azure.com. First you login with your Microsoft account or Work and School account, and if your account is in multiple Azure Active Directory tenants, you select the right tenant and you will be automatically logged in. So even if you are on a PC where you can not install the Azure CLI or the Azure PowerShell module, you can still easily fire up a shell where you can run the Azure CLI, Azure PowerShell and other CLI tools like Docker, Kubectl, emacs, vim, nano, git and more.

In addition you can also open up Azure Cloud Shell directly from Visual Studio Code

Azure Cloud Shell Visual Studio Code

With that, enjoy your holidays and I wish you a good start in the new year!



Linux on Windows 10

Crazy times – You can now run Linux on Windows 10 from the Windows Store

In the past weeks, some crazy things are happening. Think you’re way back in the time of 2003, could you have ever imagined that Microsoft offers you to run Linux on Windows 10? Well, this is exactly what is happening in the past months.

With one of the Windows 10 releases, Microsoft added the Windows Subsystem for Linux, which allowed you to run a Ubuntu version on your Windows 10 devices. In the past few days and weeks, Microsoft now announced that you can now download and install SUSE Enterprise Server, openSUSE Leap and Ubuntu (my guess there will be more to come) from the Windows Store. All you need today is the latest Windows Insider Build 16237 (it also works with a couple of older insider builds), and you will be able to install these versions. For the mainstream, this will be available in the Windows 10 Fall Creators Update arriving in the Fall of 2017. The Windows Subsystem for Linux will also be part in the next Windows Server RS3 release.

Ubuntu Windows 10 Store

If you want to know more about how it works check out Scott Hanselman blog about Ubuntu now in the Windows Store: Updates to Linux on Windows 10 and Important Tips

One great thing, Scott describes in his blog if you want to configure the different Windows Subsystems for Linux and for example, set the default one, you can use the command line with the wslconfig utility.

WSLConfig on Windows 10

wslconfig #Set default distribution to Ubuntu wslconfig /s Ubuntu

At the Microsoft Build conference 2019, Microsoft also showed the latest Windows Subsystem for Linux 2 (WSL 2). If you have any questions, let me know in the comments.



Azure Cloud Shell

Microsoft Azure Cloud Shell

Today at the Microsoft Build Conference, Microsoft announced the Azure Cloud Shell. The Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.

Azure Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Today it gives you a variety of different tools directly from your web browser in the Azure Portal.

This gives Azure Administrators an easy admin environment to manage resources as well as third-party applications. In the background Microsoft runs thousands of isolated containers, ready for you to use. Microsoft takes care of keeping this container up to date, so you can focus on your administrator tasks. The usage is free, the only thing you will need to pay, are the storage cost for your container and the things you store on the Azure File Share.

Linux shell interpreter

  • Bash
  • sh

Azure tools

  • Azure CLI 2.0 and 1.0

Text editors

  • vim
  • nano
  • emacs

Source control

  • git

Build tools

  • make
  • maven
  • npm
  • pip

Containers

  • Docker
  • Kubectl
  • DC/OS CLI

Databases

  • MySQL client
  • PostgreSql client
  • sqlcmd Utility

Other

  • iPython Client

It also looks like PowerShell will be available later, hopefully it will arrive soon. Microsoft also announced Azure PowerShell 3.0. If you want to learn, check out my blog post: Mastering Azure with Cloud Shell



Bash on Windows 10

How to Install Linux Bash on Windows 10

With the Windows 10 Anniversary Update, which was released by Microsoft in Summer 2016, Microsoft included a Windows Subsystem for Linux in Windows 10. This allows you to enable Linux Bash on Windows 10. In this blog post I quickly want to show how you can enable the Windows Subsystem for Linux on Windows 10. This is great if you want to use some Linux tools on your Windows 10 machine. I use it for example to use SSH to connect to Linux Virtual Machines on Azure.

First you have the following requirements:

  • Windows 10 Anniversary Update – Windows 10 Build 14393 and higher
  • 64-bit versions of Windows 10
  • Internet Connection to download the Windows Subsystem for Linux in Windows
  • Active Developer Mode in Windows 10

First enable Developer Mode There are two option you can do this

Open the Settings App, go to Update & Security, go to For developers and enable Developer mode:

Windows 10 - Developer Mode

You can also use the following PowerShell command to enable Developer Mode:

 
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

After this you can enable the Windows Subsystem for Linux as a Windows Feature in the Control Panel or PowerShell

Windows 10 - Windows Subsystem for Linux

Run the following PowerShell command to enable the Windows Subsystem for Linux:

Enable Windows Subsystem for Linux using PowerShell

 
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

After that you will need to restart your computer.

Now you can open up PowerShell or the command prompt and start using bash. (You can also start Bash directly from the Start Menu)

Bash on Windows 10

Hope this helps you to get started.