>> Hey friends, you know that Cloud Shell is one of
my favorite features in Azure and now it got even better.
Justin Luk is here to show me
the new Cloud Shell editor,
which is based on Monaco,
the open source text editor.
We're learning all about it,
today, on Azure Friday.
>> Hey friends! I'm Scott Hanselman and it's
another episode of Azure Friday.
I'm here with my buddy, Justin Luk,
going to talk me about one of
my favorite things in the world,
which is Shell.Azure.com,
the Azure Cloud Shell. How are you sir?
>> I'm doing fantastic. How are you Scott?
>> I'm living the dream my friend.
>> Every day.
>> Living the dream every day here at the Microsoft.
I am finding myself typing Shell.
Azure.com more often.
>> That's fantastic.
>> Then Portal. Azure.com. Now, it's not a competition.
>> No, it's not.
>> But it's pretty cool.
Now, I can get the Shell in
the Portal by just clicking
that button up at the top and I get a split screen.
We have the Portal on top on the Shell's bottom.
But for the command line amongst us, it's kind of nice,
if you will pick Bash or Powershell and you're
making it even cooler now with a new preview feature.
>> Yes, exactly. So, just like you said,
for those who want to go straight into a command line and
their power users with Azure CLI 2.0 or Powershell,
it's a great place to go if you're not looking for UI.
But now with the integration of the new editor feature,
we're able to streamline some of that text editing that
you normally need to do for complicated configuration.
So, maybe you need to deploy
an arm template and edit some Jaison,
maybe you use Terraform or some of
these other open source tools
integrated into Cloud Shell.
So, we want to make sure that
anyone who's not a VM pro, like you,
can come in here and easily and seamlessly transition in
and out of file editing into
deployment through an authenticated terminal.
>> Yeah,
I've had some problems where I've had to shut down
the entire Azure cloud just because I couldn't exit VM.
>> I don't blame you. Yeah
>> It's a huge problem.
>> It's difficult.
>> But seriously though, you have to edit
like your YAML files,
if you're doing some things with Kubernetes and AKS.
>> Exactly.
>> Even simple stuff like doing a dot bash profile,
again if you're not a VM or YMAX person,
you going to go into Peko or Nano.
Maybe I could do something else.
>> Yeah. Yeah exactly.
So, just like you said,
there's a lot of different file formats.
So, I actually have a couple of
YAML formats for deployment to Azure container instances.
Just like for Kubernetes that you referenced.
So, if we head into here,
you'll see if I cat this "Liveness.
yaml file". It's a decent sized file.
>> Yeah.
>> It's pretty small, but it's hard if I
don't know how to use VM very easily.
So, now instead,I can just simply
type "Code" and then if I add in this
"Dot" that's going to open up this
"Embedded editor" that is
going to default to the directory that is in my terminal.
So, here you see if I LS in here one more time,
you will see these three files and
those are the ones that you see here.
So, I have this File explorer that's on the side.
This is custom integration that we've
done on top of embedding this Monaco project.
>> Now, Monaco is the open
source editor of the text edotor of
the JavaScript's CSS and HTML that does this here.
It's not Visual Studio code,
but it's like it powers
the text editing part of Visual Studio code.
>> Exactly. So, Monaco is an open source project,
so you can head over to GitHub and check it out.
There's a great FAQ in here that kind of
explains what Monaco is,
what its origins were and its
some of the really great goodness that
powers VS code like you just
said and has some shims wrapped around it,
so that it can render itself within a browser.
So, this is simply what we've ported into
Cloud Shell with some help from
our friends within Microsoft.
>> I see. Then when I type "Code" and then "Dot",
where Dot equals the current directory or
code and the name of the file itself.
>> Exactly.
>> I'm not really running VS code,
but I'm used to typing code dot.
So, it's an intuitive experience
even though it's a limited one inside of the Cloud Shell.
>> Exactly. So, that's an important note
and that we're not looking to
provide this end-to-end four feature rich editor
that you're able to get through VS code,
but we do want to provide a strong utility just
like Cloud Shell and the terminal,
we're not looking to replace
your local terminal or command line.
We want to just enable
a strong simple utility that
can be accessed from any browser.
So, this is the next step for us to
make sure that your file editing is super easy from
any browser but not a full fledged
area where you might do your day to day coding.
>> I see. So, I'm not going to go in here and write
a full application from
scratch on a chrome book or on an iPad.
>> Right.
>> This is just for doing configuration,
but I can still do real work.
>> Yes, you could definitely still do real work and
then the great part there is that we still
have the Cloud Shell extension
through the Azure account extension and VS code.
So, that is actually something you can install within
local VS code if you want to port
files back and forth to your backing Cloud Drive.
Then that can seamlessly transition
in and out from local to your browser.
>> That's a really good point.
Being able to log in to Shell dot Azure.
com and see a lightweight text editor as one thing,
but I could also just download and run VS code and
then open an Azure Cloud Shell
which is still powered by you and your team.
>> Exactly.
>> It will appear at the bottom,
sorting out Powershell, Command,
Bash or Azure Cloud Shell,
all in my VS code.
So, I can invert this.
>> Exactly. Yes. So, part of
this vicinity here is its modular.
So, this Monaco application that you see in here
is actually just rendered as an HTML element.
>> Okay.
>> Within this iframe right next to the terminal which is
also built on the open source project, Xterm JS.
>> Nice
>> Which also powers the terminal of a VS code.
>> This is good. It's a lot of open source.
>> Yeah, it's awesome. Overall across Azure,
we're seeing more and more of
the ease and simplicity around
managing cloud infrastructure and that really comes
through some of these open source tools like Terraform,
Ansible, Scheft, Xterm, Monaco and
these are all things that we want to make
sure are easily at your fingertips.
>> So, you mentioned Terraform and Scheft,
can you do something with
them in the remaining few minutes?
>> Yeah. So, I do have
a Terraform file that we can mess around with.
So, let's actually hop out of the
editor's so that I can find where I put this.
>> I appreciate your large fonts as well.
Thank you for that.
>> Of course anytime.
So, if I go into my Terraform, here's one,
so I can do a quick Terraform in it
just to check that I have
the right version of the Azure provider.
>> Was Terraform already installed in the Cloud Shell?
>> Yes sir. Terraform is already
here and it is actually able
to look at the authentication
that we provide automatically.
So, you actually don't have
to do an additional log in through a service principle.
>> So, I didn't have tell it about Azure. I mean Azure.
>> Exactly.
>> Very cool.
>> So, if I do a code.
in here, we can check out this main.tf file.
In here is
a quick configuration where I'm going to deploy
a container that is actually just going to
draw ASCII art of Clippy within slack when I ask it to,
it's really cutting edge.
So, let's go ahead and do
a Terraform plan and I will hop out if you're real quick.
So, here we will see that
I actually have this container deployed.
So, that's going to save us a little bit of time.
So, I can actually come in here
and go ahead and thorough and slack.
So, that we can test this out.
So, here I have just a
"Private channel" so that I don't bother other people.
So, I want to say "Clippy draw, Hello Scott".
So, there's some great ASCII art
saying "Hello to my best friend Scott".
So, this is just simply running on
a container within Azure container instances
and I deployed that directly from
Cloud shell using Terraform and so,
now that I don't really need it anymore.
I can do a Terraform destroy if I need to.
This is simply going to look at what's in my state file,
acknowledge that it still exists and then it's going to
ask me if I actually want to destroy it, in which case,
I do and so we will go ahead and walk
through this and it's going to
delete those two resources.
>> If I were going to do this locally on
my own Bash Shell or my own term in Mac,
I'd need to do what kinds of setup ahead of time?
Because the convenience of being
already logged into the Azure CLI,
already being set up with a certain subscription,
cannot really be overstated I
have to do a non trivial amount of setup.
>> Yeah, exactly.
>> I have to set up Terraform, what else?
>> Yeah. So, you'd have to set up "Terraform",
you'd have to set up a service principle and basically
authenticate that service principle
to be called through Terraform.
Terraform, I don't believe
has a huge list of dependencies,
but you'd have to make sure that those are there as well.
If you needed to do
anything that was not supported by the Azure provider,
you'd probably want to use the CLI
two and so you need to install that.
That has a dependency on Python,
so you'd have to make sure Python
is in there appropriately.
As well as every time you
logged into the CLI you'd have to make sure
that you're authenticated for the session that
you're about to have and so
that's when you do the easy log in.
Going through the website and
copy paste the code but here,
you don't have to do that because
you are within the context of
Azure within your profile and some of the Azure portal.
>> All of this is done for us.
You have set it up and you roam it,
it's everywhere in any configuration that I would set up,
get roam into this "Folder" here.
So, till day is in my storage and roamed.
>> That is correct. So, if I do a quick LS in here,
you will see that I have a couple of
custom files that I carry around with me and
so everything within Tilda or home
is actually persisted within Bash because
we have a five gigabite user image that's stored
inside of your file share that you set up
whenever you launch Cloud Shell for the first time.
>> Nice.
>> Yeah. So this makes sure that
whatever scripts that I write,
I can actually have a draft come back later.
Throw up the editor, make some edits,
deploy it directly from the terminal
and then I will have access to that.
Anywhere the Sloud Shell's available,
so either through the Azure mobile app,
VS code's extension, the Browser,
Shout out Azure, Portal.
Azure.
It's a really great way to make sure that you're always
productive if you can squeeze out like
five or 10 minutes in between.
>> This might be a silly question or might
be a little bit more of an advanced question,
but can I install other developer
tools in Cloud Shell or is
Cloud Shell meant to be like my VM in the Cloud?
Because it isn't really it's a development place,
but I could always go and make,
spin up my own Ubuntu ACI instance.
Like when do I outgrow Cloud Shell and use it as
a jumping off point to associate into
a full VM or into a development container?
>> That's a great question. So, today
Cloud Shell does not support studio installs and so
>> There you go. There's my answer.
>> That's a pretty good line in the sand.
So, if you need something that has to have
these super user permissions or if you need to set
up things that exist on the VM layer.
So, since Cloud Shows hosted in the container,
there's certain things that are not supported today.
So, today you can't run
like interact at the dock or socket.
But you could on a VM that
you own totally from the ground up.
So, at least in the current limitation and scope,
that's a good line to delineate when you need
a full fledged Dev machine that you curated on your own,
versus just coming in and using a Cloud Shell.
But in the future,
I do foresee that those gaps
getting closed but that's a great question.
>> Yeah. So, there's no reason
I could not because I'm already logged
into AZ to say AZ VM create,
make it an Ubuntu machine or
whatever machine that makes me happy,
I set up the associates keys
and store them in my Cloud Shells.
So, I can Cloud Shell in associate into
Dev and I am off on running on
a machine that I run and I am build regularly.
>> Yeah, exactly. Whenever you
handle any type of secrets though within Cloud Shell,
it's definitely recommended that you
use the best practices there,
like storing things in key-val,
if they have application in
there and referencing through there.
>> Okay. That's a good point rather than putting
my associates keys in Cloud Shell storage directly.
>> Exactly.
>> Very cool. So this is in preview
and as of that time people are watching this video,
they can use this and play with it?
>> Yes. So it's super easy to try and kick it around.
It is a brand new feature,
and so you can come in to
any Azure Cloud Shell experience within the browser.
Simply type "Code" and
then you can reference the specific file if you want.
So, here we could do docker and that's going to
pull up the exact file that you want to edit.
>> Where would they give
feedback if they have thoughts about this?
>> Great question. So aka.ms/cloudshell/feedback
is a great place to let the engineering team
know about any missing features
or issues that you're having.
We look at it very often,
so we look forward to hearing from everyone.
>> Fantastic. I am learning all about
the Azure Cloud Shell editor,
now in preview, here on Azure Friday.