Coming up, we'll show you Cloud Shell,
a new way for managing resources in the cloud.
We'll show you how within the browser you can use Bash or PowerShell
to troubleshoot and automate your most common management tasks.
And manage on-the-go by keeping your favorite scripts in the cloud
so you can trigger them with Cloud Shell
From any modern browser or the Azure mobile app.
Microsoft Mechanics
I'm joined by Corey Sanders from the Azure compute team
a regular here on Microsoft Mechanics, Welcome back.
You know Rick, it's really really good to be here with you!
Most folks know and are familiar with the Azure portal.
It works for most management tasks that you're going to be going through with common scenarios.
But in the past whenever you've been on the show you've always been demoing from the command line?
That's right.
If you wanted to have a level of flexibility,
you'd have to go in and configure your workstation, load all the tools, load all the dependencies.
But Cloud Shell improves things significantly.
Can you explain to me what it is and how it all works?
Yeah, absolutely Rick.
I can try to explain it to you.
And let's see whether you can follow.
And so what we've done here with the Cloud Shell is it truly is a browser-based experience
for running in the cloud.
And so you can use Bash, you can use PowerShell.
And right here in the portal experience,
you can go manage, you can deploy you can troubleshoot all kinds of problems
you may have without ever leaving the portal experience.
And so the benefit of the Cloud Shell is it truly is a shell in the cloud.
Hence the name.
And so if I go up here and you see this this button up here, it says Cloud Shell.
And so right here in the experience I can click this up and I've got
a prompt ready for me to execute whatever command I may want.
And so here you can see I can click in here and say list
and it'll show me all the things running.
It'll show me a set of tools that I may want to run.
It's actually already connected a cloud drive
that is an Azure file location
that I have set up for this and uploaded a bunch of tools.
And so now right here in this file shell,
using the portal to upload I can now execute a bunch of commands
right here in the Bash prompt.
Now so for all the folks that are watching how does actually all this work.
So in Azure there are literally thousands of containers
configureed with environments waiting for you to just connect.
They're just sitting there waiting saying Rick please,
connect with me, do some fun things in the show.
They are geo diversified,
so you end up getting deployed to whatever the closest container is to you.
And so that will be the one that's made available
and launched and when you hit request
it launches them up, it connects to it,
and then it will attach your Azure file storage
so you can put whatever tools and whatever capabilities that you wanted available.
Now what's nice is that it is just a browser experience
and so it runs of course on your laptop, but it will also run on a phone or a tablet.
Any browser that you want
Now do you have to be in the Azure portal to use the Cloud Shell?
No actually this is one of the best parts about it.
So certainly it's available right here in the Azure portal.
But you can also, if you're in the documentation page let's say,
and you're scanning through it and you're saying
"Look, I want to create a virtual machine on Linux and I want to use the Azure CLI",
and you're walking through it and you're trying to learn how this works
and you're like, ok there's a command here and you see this little button, try it.
So I hit this in the documentation page
and it creates an Azure Cloud Shell
right here in the documentation page and it's so cool.
Now I can go in and say okay great,
now I'm going to go try this out.
This is my account it's pre created.
And I can go in and I can actually go run a command right here in the documentation page.
So it's available for me, all the tools are ready, I'm authenticated and I'm ready to go.
So the magic of all this is that you completely have this extracted from you.
It's always up-to-date and your stuff is inside the cloud and following you around?
Absolutely, so you can go do this and any sort of operation you want to go run.
You can go ahead and use the Cloud Shell for it.
Why don't you actually show me what you can do inside the Cloud Shell?
I will, absolutely Rick.
You're antsy about this, let me actually go and show you something.
In this case, let's assume I have a virtual machine that's gone bad.
Ok and so I've got a virtual machine that's gone bad and I've written a script
that is going to allow me to troubleshoot this bad machine.
Ok and so I've got all my tools here I'm ready to go and so give you a little example
of sort of what this looks like,
I can right here in the portal experience,
take a look at what the scripts going to do.
And so let me actually maximize this.
I'm going to spend my time in the shell and so I'm going to make it bigger.
So right here with Vim and right here with Bash I can now see the script.
I can see what it's going to do and I can see what it's going to attach to.
And it's very very easy for me to go edit it if I want to.
In this case I'm actually okay with it and so let me actually get out of here.
Okay and now I want to run it.
And so I'm going to attach this it's going to create a VM for me
that is going to run this and attach this broken VM to this new VM that I'm creating.
So I'm going to run in the background and a way that goes.
And so as part of that let me now assume that that is going and running.
And instead what I want to do is I actually want to go look at that VM that's has now attached
that broken VM to it.
Okay and so to do that I can actually call out a command here.
And now that we've run the script
to attach the broken VM to a new healthy VM.
Now all I need to do is connect to it.
So I've got to find it first.
So let me go in and through this same experience, I'm going to
list out the IP addresses.
So that I can find out what the IP address that I need to connect to.
So here you can see I've got the clean VM here up and running, okay?
And what I'll end up doing is I'm going to SSH it.
What's great about this is that because I created it right here in the shell,
and it's got the Cloud Drive behind it.
All of my credentials are here.
So I don't need to do any credentials, I don't need to do anything special I just hit SSH
and get the IP address here and copy that.
Paste it there.
And then just like that, I'm now connected.
And so from here, I've now mounted this.
So let me actually go to the mount point for this.
See here, remounted OS disk.
And you can see here now I've got this broken VM
ready for me to go debug a little bit further and understand what happened.
All of that happening via scripts.
VM creation in a fully automated way right here in
the Bash experience right here in the portal.
Now this looks great on a browser.
But what if I don't have access to my laptop or to a browser even?
What's the experience like on a phone?
Yeah Rick you know as I explained before,
maybe you missed it when I explained it.
You can also run this on a phone in addition to laptop and tablet.
So here I'm logged into the Azure portal experience on the phone.
You can see all the VMs that I've already showed.
the clean VM and so on that I connected to.
And so right here I can go in and actually say, Cloud Shell.
And so here you can see I've got the Cloud Shell here up and running.
I could do all sorts of things.
I can go ahead and list things,
I can go in just like I did on there and I can hit list,
I can actually do VEM editing if really want to
right here in this experience.
And so you see just absolutely powerful
to be able to go in here just using the same thing.
And so actually let me go into my cloud drive.
Maybe I wanted to actually run the exact same command that I just ran.
I can do VEM here and do troubledisk.SH.
I can go in and of course it brings up VEM just like it does on that experience.
It's been absolutely fantastic.
Now you've shown us this experience using Bash.
But I know a lot of people that watch Mechanics Shell
are interested in PowerShell.
So what does Cloud Shell do for them?
Yeah, so the PowerShell support is in private preview.
But, it's almost an identical experience, right?
If you go into that portal experience
and you click up here and you do again similar sort of Cloud Shell command,
it pulls up just like the Bash experience only of course PowerShell blue.
Right and so here we are in the PowerShell experience.
So I can go here and do some of the normal commands that you'd expect, hit dir
and be able to take a look and investigate what I want to run with PowerShell.
But now what's super cool about PowerShell that's actually quite powerful,
it is not just a PowerShell experience.
it's actually a namespace mapping to your full account.
So you can see here I hit dir and it actually shows me
all of my subscriptions.
So I can go into these subscriptions I can say Cory application.
And maybe I want to do CD and I'm just walking this like it's a file system.
But it's actually my Azure account.
It's absolutely fantastic.
And so here you can see now I've got all of my resource groups in here.
And so let me just see here, test VM.
Let me go into that and then see what see what it's got.
So let me go into compute, here.
You can see I can just walk this tree.
Now I can see see what's in here and it looks like there's virtual machines deployed here in test VM.
And so if I pull this up now you can see it's a Window server and it's running server 2012 R2
data center and it's called working VM.
Okay and so right here in PowerShell in this experience now,
I've got this fantastic ability to walk the namespace.
But that's not all Rick.
I can also go in and actually run just your standard PowerShell commands.
And so right here I can go in if I want to stop a VM let's say.
So let's see Azure RMVM.
Let's hit name. working VM.
resource, group, name, and TestVM.
And that all looks right, I got to always double check that I type things right.
And right there of course validate to make sure that's what I want to do.
And away I go, VM is stopped and ready to go.
Now what about if you want to run Command lits that aren't part of your default experience?
Yeah absolutely,
So just like I would do with PowerShell running let's say on my local box,
just like PowerShell running anywhere else I can go in and actually customize
and install modules as I see fit.
So if I were deploying here and let's say I said,
hey you know I want to do something with Azure Active Directory.
So now I may need to go in and actually customize that.
To find the module, you can run just a standard commands.
So find module, say Azure AD
and so this is now searching to determine
about this module like how do I install it and how do I go configure it.
And so it's searching for the Azure AD module.
And there I see it's found it.
Now what I want to go do is install this module.
Now just like you'd expect, I can pipe this
right in into install module.
And so it will find it and then it will install it and run that.
And of course because this is running on Cloud Drive,
it will install it in such a way that I can then use it from now on.
So anytime I come back this will be installed because it will basically
save aside all of that state for me.
And so here you go it's downloading its unzipping.
And this should be ready here in just a moment.
Awesome stuff.
This is going to make it way easier to go ahead manage your resources in Azure.
And as you show, you can literally do this from anywhere.
How can you get started with Cloud Shell today?
Well as I showed earlier in my demo
and maybe you missed it or we're busy,
you can go right into the portal experience and you can hit the little button in the upper right,
and you've got the Cloud Shell and you're ready to use it.
Straight away today, it's amazing and you should go try it out for yourself.
And of course give us feedback as you try it.
Thanks again Corey for joining us again and for everyone else watching
stay tuned to Microsoft Mechanics for the latest an updates.
See you soon.
Microsoft Mechanics
www.microsoft.com/mechanics