Scott Hanselman

Exploring the preconfigured browser-based Linux Cloud Shell built into the Azure Portal

May 22, '17 Comments [3] Posted in Azure
Sponsored By

At BUILD a few weeks ago I did a demo of the Azure Cloud Shell, now in preview. It's pretty fab and it's built into the Azure Portal and lives in your browser. You don't have to do anything, it's just there whenever you need it. I'm trying to convince them to enable "Quake Mode" so it would pop-up when you click ~ but they never listen to me. ;)

Animated Gif of the Azure Cloud Shell

Click the >_ shell icon in the top toolbar at http://portal.azure.com. The very first time you launch the Azure Cloud Shell it will ask you where it wants your $home directory files to be persisted. They will live in your own Storage Account. Don't worry about cost, remember that Azure Storage is like pennies a gig, so assuming you're storing script files, figure it's thousandths of pennies - a non-issue.

Where do you want your account files persisted to?

It's pretty genius how it works, actually. Since you can setup an Azure Storage Account as a regular File Share (sharing to Mac, Linux, or Windows) it will just make a file share and mount it. The data you save in the ~/clouddrive is persistent between sessions, the sessions themselves disappear if you don't use them.

Now my Azure Cloud Shell Files are available anywhere

Today it's got bash inside a real container. Here's what lsb_release -a says:

scott@Azure:~/clouddrive$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial

Looks like Ubuntu xenial inside a container, all managed by an orchestrator within Azure Container Services. The shell is using xterm.js to make it all possible inside the browser. That means you can run vim, top, whatever makes you happy. Cloud shells include vim, emacs, npm, make, maven, pip, as well as docker, kubectl, sqlcmd, postgres, mysql, iPython, and even .NET Core's command line SDK.

NOTE: Ctrl-v and Ctrl-c do not function as copy/paste on Windows machines [in the Portal using xterm.js], please us Ctrl-insert and Shift-insert to copy/paste. Right-click copy paste options are also available, however this is subject to browser-specific clipboard access

When you're in there, of course the best part is that you can ssh into your Linux VMs. They say PowerShell is coming soon to the Cloud Shell so you'll be able to remote Powershell in to Windows boxes, I assume.

The Cloud Shell has the Azure CLI (command line interface) built in and pre-configured and logged in. So I can hit the shell then (for example) get a list of my web apps, and restart one. Here I'm getting the names of my sites and their resource groups, then restarting my son's hamster blog.

scott@Azure:~/clouddrive$ az webapp list -o table
ResourceGroup               Location          State    DefaultHostName                             AppServicePlan     Name
--------------------------  ----------------  -------  ------------------------------------------  -----------------  ------------------------
Default-Web-WestUS          West US           Running  thisdeveloperslife.azurewebsites.net        DefaultServerFarm  thisdeveloperslife
Default-Web-WestUS          West US           Running  hanselmanlyncrelay.azurewebsites.net        DefaultServerFarm  hanselmanlyncrelay
Default-Web-WestUS          West US           Running  myhamsterblog.azurewebsites.net             DefaultServerFarm  myhamsterblog

scott@Azure:~/clouddrive$ az webapp restart -n myhamsterblog -g "Default-Web-WestUS"

Pretty cool. I'm going to keep exploring, but I like the way the Azure Portal is going from a GUI and DevOps dashboard perspective, but it's also nice to have a CLI preconfigured whenever I need it.


Sponsor: Did you know VSTS can integrate closely with Octopus Deploy? Watch Damian Brady and Brian A. Randell as they show you how to automate deployments from VSTS to Octopus Deploy, and demo the new VSTS Octopus Deploy dashboard widget. Watch now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Suggestions and Tips for attending your first tech conference

May 17, '17 Comments [14] Posted in Musings | Open Source
Sponsored By
WoC Tech Chat used under CC

This last week Joseph Phillips tweeted that he was going to his first big tech conference and wanted some tips and suggestions. I have a TON of tips, but I know YOU have more, so I retweeted his request and prompted folks to reply. This was well timed as I had just gotten back from OSCON and BUILD, two great conferences.

The resulting thread was fantastic, so I've pulled some of the best recommendations out. As per usual, the Community has some great ideas and you should check them out!

  • @saraford - Whenever you get a biz card write down why you met them or what convo was about. It might seem obvious at time but you wont remember at home
  • @arcdigg - Meet people and speakers. Tech is part of your success, but growing your network matters too. Conf can give you both or not. Up to you!
  • @marypcbuk - if approaching people is hard for you, just ask 'what do you work on?'
  • @ohhoe - don't be afraid to introduce yrself to people! let them know its yr first conference, often people will introduce you to other people too :)
  • @IrishSQL - connect with a few attendees/speakers online prior to event, and bring plenty of business cards. When u get one, write details on back
  • @arcdigg - Backpack and sneakers beat cute laptop bag and heels (ed: dress comfortably)
  • @scribblingon - You might feel left out & think everyone knows everyone else. Don't be afraid to approach people & talk even if seems random sometimes :) If you liked someone's talk, strike a convo & tell them that!!
  • @arcdigg - Plan session attendance in advance, have a backup in case the session is full.
  • @jesslynnrose - Reach out to some other folks who are using the hashtag before you get there, events can be cliquey, say hi and make friends before you go!
  • @thelarkinn - Never feel afraid to say hi to maintainers, and speakers!!!! Especially if you want to help!
  • @everettharper - Pick 3 ppl you want to meet. Prep 1 Q for each. Go early, find person #1 in the 1st hr before crowds. 1/3 done = momentum for rest of day!
  • @jorriss - Meet people. Skip sessions. You'll get more from meeting and talking with people then sitting in the sessions. #hallwaytrack
  • @stabbycutyou - Leave room in your schedule, Meet people, Eavesdrop on hallway convos, Take notes, Present on them at your job
  • @patrickfoley - Don't forget to sleep. Evidence that long-term memories get "written" then
  • @david_t_macknet - Drinking will not help you remember it better or have a better time mingling. Most of us are just as introverted & the awkwardness fades.
  • @carlowahlstedt - Don't feel like you have to go to EVERY session.
  • @davidpine7 - Try your best to NOT be an introvert -- in our industry that can be challenging, but if you put yourself out there...you will not regret it!
  • @frontvu - Don't rely on the conference wifi
  • @shepherddad - Put snacks in your bag or pocket.
  • @sod1102 - Find out if there will be slides (and even better!) video available post conference, then don't worry about missing stuff and relax & enjoy
  • @rnelson0 - Take notes. Live tweet, carry a notebook, jot it all down at 1am before sleeping, whatever method helps you remember what you did.
  • @hoyto - Sit [at] meal tables with random people and introduce yourself.
  • @_s_hari - Ask speaker when *not* to use product/methodology that they're speaking on. If they cannot explain that, then it's just a marketing session
  • @EricFishor - Don't be afraid to discreetly leave or enter an on going session. It's up to you to seek out sessions that interest you.
  • @texmandie - If you get to meet and talk to your heroes, don't freak out - they're normal people who happen to do cool stuff
  • @wilbers_ke - Greatest connections happen in the hallways, coffee queue and places with animated humans. Minimize seated conference halls
  • @CJohnsonO365 - CLEAR YOUR SCHEDULE. Don’t try to get “regular” work done during the conference— you’ll end up missing something important!
  • @g33konaut - Tweet with the conf hashtag to ask if people wanna meet and talk or hangout after the conference, also follow the hashtag tweets to find ppl. Don't sweat missing a talk, meeting people and talking to them is always better than than seeing a talk. Also the talks are often recorded
  • @foxdeploy - Who cares about swag, it's all about connections. Meet the people who've helped you over the years and say thanks.
  • @jfletch - Ask people which after parties they are attending. Great way to find out about smaller/more interesting events and get yourself invited!
  • @marxculture - The Law of Two Feet - if you aren't enjoying a session then leave. Go to at least one thing outside your normal sphere.
  • @joshkodroff - Bring work business cards if you're not looking for a job, personal business cards if you are.
  • @benjimawoo - Go to sessions that cover tehnologies you wouldn't otherwise encounter day to day. Techs you don't use in your day job.

Fantastic stuff. You'll get more out of a conference if you say hello, include the "hallway track" in your planning, stay off your phone and laptop, and check out sessions and tech you don't usually work on.

What are YOUR suggestions? Sound off in the comments.


Sponsor: Did you know VSTS can integrate closely with Octopus Deploy? Watch Damian Brady and Brian A. Randell as they show you how to automate deployments from VSTS to Octopus Deploy, and demo the new VSTS Octopus Deploy dashboard widget. Watch now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

BUILD 2017 Conference Rollup for .NET Developers

May 15, '17 Comments [13] Posted in DotNetCore
Sponsored By

The BUILD Conference was lovely this last week, as was OSCON. I was fortunate to be at both. You can watch all the interviews and training sessions from BUILD 2017 on Channel 9.

Here's a few sessions that you might be interested in.

Scott Hunter, Kasey Uhlenhuth, and I had a session on .NET Standard 2.0 and how it fit into a world of .NET Core, .NET (Full) Framework, and Mono/Xamarin.

One of the best demos, IMHO, in this talk, was taking an older .NET 4.x WinForms app, updating it to .NET 4.7 and automatically getting HiDPI support. Then we moved it's DataSet-driven XML Database layer into a shared class library that targeted .NET Standard. Then we made a new ASP.NET Core 2.0 application that shared that new .NET Standard 2.0 library with the existing WinForms app. It's a very clear example of the goal of .NET Standard.

.NET Core 2.0 Video

Then, Daniel Roth and I talked about ASP.NET Core 2.0

ASP.NET Core 2.0 Video

Maria Naggaga talked about Support for ASP.NET Core. What's "LTS?" How do you balance purchased software that's supported and open source software that's supported?

Support for ASP.NET and .NET - What's an LTS?

Mads Torgersen and Dustin Campbell teamed up to talk about the Future of C#!

The Future of C#

David Fowler and Damian Edwards introduced ASP.NET Core SignalR!

SignalR for .NET Core

There's also a TON of great 10-15 min short BUILD videos like:

As for announcements, check these out:

And best of all...All .NET Core 2.0 and .NET Standard 2.0 APIs are now on http://docs.microsoft.com at https://docs.microsoft.com/en-us/dotnet

Enjoy!


Sponsor: Test your application against full-sized database copies. SQL Clone allows you to create database copies in seconds using MB of storage. Create clones instantly and test your application as you develop.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Managing dotnet Core 2.0 and dotnet Core 1.x versioned SDKs on the same machine

May 12, '17 Comments [7] Posted in DotNetCore
Sponsored By

Tons of great announcements this week at the BUILD conference. I'll slowly blog my take on some of the cooler features, but for now here's a rollup of the major blog posts for developers:

You can download and get started with .NET Core 2.0 Preview 1 right now, on Windows, Linux and macOS:

If you already have .NET Core on your machine, you'll already be able to type "dotnet --version" at the terminal or command line. Go ahead and try it now. Mine says:

C:\Users\scott> dotnet --version
2.0.0-preview1-005977

Remember on Windows you can check out c:\program files\dotnet\sdk and see all the SDK versions you have installed:

Lots of .NET Core versions

Typing dotnet will pick the most recent one...but it's smarter than that. Remember that you can set the current SDK version with a global.json file. Global.json's presence will override from the folder its in, all the way down.

If I make a folder on my desktop and put this global.json in it:

{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.3"
}
}

It will force my dotnet runner to use the .NET Core SDK version I asked for. That "projects" line isn't needed for the versioning, but it's nice to be able to select what folders have projects inside.

C:\Users\scott\Desktop\test> dir
Directory of C:\Users\scott\Desktop\test
05/11/2017 09:22 PM <DIR> .
05/11/2017 09:22 PM <DIR> ..
05/11/2017 09:23 PM 45 global.json
1 File(s) 45 bytes
2 Dir(s) 85,222,268,928 bytes free

C:\Users\scott\Desktop\test> dotnet --version
1.0.3

At this point - with a valid global.json - making a new project with dotnet new will make an app with a netcoreapp1.x version. If I move elsewhere and dotnet new I'll get a netcoreapp2.0. In this example, it's the pretense of that global.json that "pins" my SDK version.

Alternatively, I could keep the dotnet.exe 2.0 SDK and install 1.x templates. This would mean I could create whatever I want AND pass in the version.

First I'll add the 1.x templates into my 2.0 SDK. This just needs to happen once.

dotnet new -i Microsoft.DotNet.Common.ProjectTemplates.1.x::1.0.0-*

Now, even though I'm "driving" things with a .NET Core 2.0 SDK, I can pass in --framework to control the project that gets created!

C:\Users\scott\Desktop\test> dotnet new console -o oneone --framework netcoreapp1.1
The template "Console Application" was created successfully.

C:\Users\scott\Desktop\test> dotnet new console -o twooh --framework netcoreapp2.0
The template "Console Application" was created successfully.

I can make libraries that target .NET Standard like this, passing in 2.0 or 1.6, or whatever netstandard I need.

C:\Users\scott\Desktop\lib> dotnet new classlib --framework netstandard2.0
The template "Class library" was created successfully.

There's two options that are not exactly opposites, but they'll give you different levels of control, depending on your needs.

  • You can control your SDK versioning folder by folder with global.json. That means your project's directories are "pinned" and know what SDK they want.
    • When you type dotnet new using a pinned SDK, you'll get the new project results for that pinned SDK. Typing dotnet run will do the right thing.
  • You can pass in --framework for templates that support it and dotnet new will create a template with the right runtime version. Typing dotnet run will do the right thing.

This is .NET Core 2.0 Preview 1, but you should be able to install it side by side with your existing apps and have no issues. If you know these few internal details, you should be able to manage multiple apps with multiple versions without much trouble.


Sponsor: Test your application against full-sized database copies. SQL Clone allows you to create database copies in seconds using MB of storage. Create clones instantly and test your application as you develop.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Audit and Optimize your Windows 10 Search Indexing Options

May 2, '17 Comments [34] Posted in Win10
Sponsored By

I was getting frustrated with the speed (or lack of) of Windows Search within Windows 10 lately. I went over to my Indexing Options - just hit Start and type Indexing Options - and was surprised to see that there was over 1.5 MILLLION items indexed! That seems like a big number. Why so large?

I checked my "index these locations" list and didn't see anything weird, but I did note that Indexing does include c:\users\YOURNAME by default. That seems reasonable, because it is reasonable.

However, I also noted that I had a LOT of ".folders" (dot folders) under my C:\users\YOURNAME folder adding up to a few gigs of config text files, caches and general crap.

I was able to significantly lower the number of items indexed from over a million to a reasonable 215k items just by excluding (un-checking) folders that I knew didn't matter to me as much.

Go to Indexing Options and click Modify:

Indexing Options

Go to your C drive (or wherever ~\YOURNAME is) and go to your top level User folder. I unchecked a bunch of the stuff that didn't matter to me.

Indexing Location

For average users this won't matter, but for developers who install a bunch of utilities, have their Dropbox or OneDrive in the c:\users folder, a 5 min audit of your indexed files can give your Indexed Files a nice refresh.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.