DevSecOps or SecDevOps with Wabbi's Brittany Greenfield (Hanselminutes with Scott Hanselman) - DevSecOps vs. SecDevOps vs. DevOpsSec... A lovely episode, I read or hear those buzzwords often very happy to better understand what they mean.
SPI 500: Session 500! A Mystery Host Flips the Script! (The Smart Passive Income Online Business and Blogging Podcast) - I have been listening to this podcast for a while and I really liked learning more about Pat and how all this started.
Every Monday, I share my "reading notes". Those are a curated list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week and that I found interesting. It's a mix of the actuality and what I consumed.
You think you may have interesting content, share it!
Cloud
How to Display the Current Azure Subscription in your CLI (Sam Cogan) - This is a game-changer for me. Every time I work in the terminal I was checking what was my current subscription (you don't want to deploy things in the wrong one right?) But know it will always be visible. Wonderfull!
Every Monday, I share my "reading notes". This is a curated list of all the articles, blog posts, and books that catch my interest during the week and that I found interesting. It's a mix of the actuality and what I consumed.
Épisode 11 - La famine en Ukraine (Les Pires Moments de l'Histoire) - OMG! I have nothing else to say. I knew that part of the history was dark and complex... but I knew nothing. Great episode.
Containers on Azure with Tom Kerkhove (.NET Rocks!) - What a great episode! And it's so true there is so many ways "to do your containers" ( like in a recipe )
Épisode 87 - La sécurité des coureuses (Grand écart) - Sometimes I feel so ashamed to be a man... I know I'm doing it right, but I need to do more... for the others that forgot that we are all equal.
633 - How to Use Rejection to Your Advantage (Modern Mentor) - In our lives, we will encounter many nos or rejection. This episode talks about how you could use those detours to learn more, and transform them in opportunities.
101: Windows Virtual Desktop with Travis Roberts (CloudSkills.fm) - I remember when "infra" people couldn't see anything positive about the cloud... Times as changed a lot. There are so many opportunities.
The myth of turning your hobby into a job with writer Aley Arion (Hanselminutes with Scott Hanselman) - Is it a myth or a reality? I totally think it's possible. But yeah in all the amazing love (or adventure) movies there are always some challenges. But happy 95% of the time.. I take that!
Moving your ASP.NET applications to the Microsoft Cloud (Premier Developer) - If you are thinking to migrate to the cloud, it's important to plan your migration. This post is the perfect point to get started, it contains references to deeper books and documents.
The Rise of Microsoft Visual Studio Code (Lyn Levenick) - Cool statistics about editor usage. Not sure of the real correlation with the editor used and the skill level, but it's still an interesting coincidence.
Stream Deck Tricks for Streamers… and Muggles too! (Jeff) - Fantastic post that explains so much why that little thing can save you so much pain. As THE day when I'm starting to stream get closer and closer... This is gold.
Migrating to the New Azure Service Bus SDK (Mark Heath) - This is a nice post to avoid losing t much time trying to migrate. Also if you are not sure, this post explains some benefices in addition to showing some gotchas.
Chocolatey on Windows (Daniel Franciscus) - One thing that I like about Chocolatey, I mean other than the fact that it's awesome, is that it never stops to impress me!
AWS Step Function Serverless Applications (Gerald Bauer) - What a great tutorial! Very interesting all the plumbing and toolings is explained in this Hello word AWS Lambda.
PowerApps Newbie – getting started (Jen Kuntz) - Nice first post of a promising series ;) To all the #powerusers of planet earth... you want to use PowerApps... so this is your chance to get started!
I don't know for you, but I don't like losing time. This is why a few years ago I started using scripts to install all the software I need on my computer. Got a new laptop? N You just need to execute this script, go grab a coffee and when I'm back all my favorite (and required) softwares are all installed. On Linux, you could use apt-get, and on Windows, my current favorite is Chocolatey. Recently I needed to use more virtual machine (VM) in the cloud and I deceided that I should try using a Chocolatey script during the deployment. This way once the VM is created the softwares, I need is already installed! This post is all about my journey to get there, all scripts, issues and workarounds will be explained.
The Goal
Creating a new VM on premises applying the OS update and installing all the tools you need (like Visual Stutio IDE) will takes hours... This solution should be done under 10 minutes (~7min in my case).
Once the VM is available, it should have Visual Studio 2017 Enterprise, VSCode, Git and Node.Js installed. In fact, I would like to use the same Chocolatey script I use regularly.
In this post I will use Azure CLI, because it will works on any environment. However, PowerShell can also be use only a few command will be different. The VM will be deploy with an Azure resource Manager (ARM) template. To create and edit the ARM template I like to use VSCode, you don't need it but it's so much easier with it! I use two extension.
The first one Azure Resource Manager Snippets will help by generating the schema for our needs. In a JSON file you just need to type arm en voila! You ahave a long list of ARM template!
The second is Azure Resource Manager Tools. This extension provides language support for ARM and some validate. Very useful...
Creating the ARM Template
To Get started create a new JSon file. Then type arm and select the first option; to get an empty skeleton. Then add an extra line in resources and type again arm. This time scroll until you see arm-vm-windows.
A multi-cursor will allow you to edit the name of your VM everywhere in the file in one shot. Hit Tab to navigate automatically to the userName, and Tab again to go to the password.
Now we have a functional ARM template that we could deploy. However, let's add a few things first.
Searching the Image SKUs by Code
One of my favorite VM images for a DevBox is the one that includes Visual Studio pre-installed. One thing to know is those images are only deployable in an MSDN subscription. To specify wich image you want to use you need to pass a publisher, offer, and sku.
Here how to do it with Azure CLI commands
# List all the Publishers that contain VisualStudio (It's case sensitive)
az vm image list-publishers --location eastus --output table --query "[?contains(name,'VisualStudio')]"
# List all offers for the Publisher MicrosoftVisualStudio
az vm image list-offers --location eastus --publisher MicrosoftVisualStudio --output table
# List all availables SKUs for the Publisher MicrosoftVisualStudio with the Offer VisualStudio
az vm image list-skus --location eastus --publisher MicrosoftVisualStudio --offer VisualStudio --output table
Now that all the information is found, search in the ARM template and replace the current values by the one found. In my case, here are the new values.
Great now we have a VM with Visual Studio but our applications are still not installed. That will be done by adding the Custom Script Extension for Windows to our template. documentation page, a sample schema is there ready to be use.
The last node of your template is currently another extension. For the purpose of this blog post let's remove it. You should have something like this.
We will copy/ paste the snippet from the documentation page a change a few little things. Change the type (thank to our VSCode Extension for that catch). Update the dependencies to reflet our demo.
To use the extension your script needs to be available online. It could be in a blob storage (with some security) or just publicly available. In this case, the script is publicly available from my gist.github page. I created a variable in the variables section that contains the RAW URL of my script, and a reference to that varaibale is used in the fileUris.
The extension will download the script and then execute a function locally. Change the commandToExecute to call our script with unrestricted execution policy.
You have a timed window of ~30 minutes to execute your script. If it takes longer then that, your deployment will fail.
# First, we need a Resource Group
az group create --name frankDemo --location eastus
# ALWAYS, always validate first... you will save a lot of time
az group deployment validate --resource-group frankDemo --template-file /home/frank/Dev/DevBox/FrankDevBox.json
#Finally deploy. This script should take between 5 to 10 minutes
az group deployment create --name FrankDevBoxDemo --resource-group frankDemo --template-file /home/frank/Dev/DevBox/FrankDevBox.json --verbose
What's Next?!
We created one template; you could make it better.
Deploy from anywhere
By moving the computerName, adminUsername, adminPassword, and the script url in the parameters section, you could then put the template in a public place like GitHub. Then with use the one click deploy!
Directly from the Github page or from anywhere you just need to build a URL from those two parts: https://portal.azure.com/#create/Microsoft.Template/uri/ and the HTML Encoded URL to your template.
If my template is available at https://raw.githubusercontent.com/FBoucher/SimpleDevBox/master/azure-deploy.json then the full url become:
It's very easy to forget to turn off those VM. And whatever you are paying for them or your using the limited MSDN credit it's a really good practice to turn them down. Why not do that automatically!
That can be very simply done by adding a new resource in the template.
Do you have to know English to be a Programmer? (Scott Hanselman) - Interesting post... At the end, English may not be a blocker...but you need some base. Otherwise, how could you even read this post!
Today, I was running around with my laptop trying to find someone to show him what I did. My problem was that since I'm working from home, I found no one except my dog... Toby, did you see what I just did! He was looking at me and didn't really care about that I was doing some C# in Atom, a regular text editor. So, here I am now, sharing my discovery with you.
The "What"
While reading some article on the Internet, I fall on a video talking about OmniSharp.
A family of Open Source projects, each with one goal - To enable great .NET development in YOUR editor of choice.
SO I decide to give it a try in one of my favorite text editors this time called Atom.
Less than two minutes after, I was running across my house....
The "How"
What I like about Atom that it is so easy to install and to customize. The easiest way to install it is via Chocolatey.
Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built with Windows in mind.
Assuming that you don't have Chocolatey installed, let's start by that. Open a command prompt (cmd.exe) as Administrator, and execute this command:
In a new command prompt again with the administrator permission, let's Install the text editor Atom:
cinst Atom
and Git:
cinst Git
Now to install the OmniSharp in Atom you have two options. You could do it through the Settings or using a console. For this post, I will use the second option. Let's open a new command prompt, always as Administrator.
The reason why I use a new prompt every time is to be sure that environment variable gets refreshed.
using System;
namespace ConsoleAppDemo
{
class Program
{
static void Main(string[] args)
{
var myBook = new Book{Title="Get Started with OmniSharp"};
Console.WriteLine(String.Format("Here is my review of: {0}", myBook.Title));
}
}
public class Book
{
private string _review;
public string Title{get;set;}
public string Review{
get{
if(String.IsNullOrEmpty(_review))
{
_review = "This book is nice";
}
return _review;
}
set{
_review = value;
}
}
}
}
Nothing special until you start the OmniSharp server with Ctrl-Alt-o.
Boom!
As you can see now the intelisense, completion, code navigation and so more! If you click on the little green flame on the bottom left you see details about notification and error message.
The end
OmniSharp is a frontend compiler, not a complete compiler so it doesn't generate CLI code. But It's already a lot. Today, you can use OmniSharp with Sublime Text 3, Atom, Emacs, Brackets, Vim and with command line only. So whether on your old laptop or your new PC, whether you run Linux, Mac or Windows let's do some C#!
Is the Windows user ready for apt-get? - I'm a big fan of Chocolatey since long time, and I found it extremely useful. Give it a try, and see by yourself!
12 Non-caffeinated Ways to Wake Up at Work - I know, by definition a developer is someone who transforms coffee into code... but having an alternative is good ... and healthier.
Continuing the Windows 8 vision with Windows 8.1 - Wow! A huge number of really great improvement. It looks like little things but all together, it transforms the experience. Stay tune for more details...
Intermediate RubyGem Development - Nice tutorial covering tests and naming convention when developing our Ruby Gem. Different libraries a referred as examples.
Performance Considerations - Quick post about thinks to take into consideration about EF 5.0. The post also introduce many alternatives ORMs.
Dojo for jQuery Developers - Incredibly clear tutorial here that compares Dojo with jQuery to explain how things are done with Dojo. The perfect post to get started.
Miscellaneous
Cool Tools – How to Be Invisible - The book looks interesting and this post, invent if it goes in the completely opposite direction is really interesting too.
Delayed Gratification: Make It a Better Pill to Swallow - This post is a review/ summary of what looks like a very promising book about self-control. In this world of instant trophies and game achievements, learning how to control your needs is a great strength.