Talk: Failing in the Cloud – A How To Guide – Boston Code Camp 22

Earlier today I had the privilege of speaking at the 22nd Boston Code Camp. My talk was Failing in the Cloud: A How To Guide. Thanks to those who attended (and persevered through the A/V system from hell!).

I’m on twitter at @codingoutloud. My book is at http://bit.ly/billbook.

The slide deck is here:

About these ads

Add-AzureAccount – The Data is Invalid

I am a heavy user of PowerShell and recently I ran across an annoying problem that I didn’t find anywhere mentioned in the google. I was running the Add-AzureAccount cmdlet from the Azure PowerShell module. (Want it too? Start here. Or simply install it from the mighty Web Platform Installer.)
The Add-AzureAccount command usually pops up a login dialog so I can authenticate against my Azure account. But the behavior I was seeing never made it to that pop-up dialog – rather it quickly dumped out the following error at the command line:
Add-AzureAccount : The data is invalid.
At line:1 char:1
+ Add-AzureAccount + ~~~~~~~~~~~~~~~~   + CategoryInfo : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount
As mentioned above, I could not find useful references to Add-AzureAccount “data is invalid” via search engine, so I tried a few things. I first updated to the latest module. Didn’t help me – but you can check which version you have installed as follows:
PS>    (Get-Module Azure).Version

Major  Minor  Build  Revision
-----  -----  -----  --------
0      8      11     -1
Then I tried both the -Debug and -Verbose command line options, which are often useful. But no difference in the output. So this was failing pretty early!
Since this might be related to some cached credentials, I tried deleting TokenCache.dat in case there was something funky there. Nope. Here is command to view – and then delete – TokenCache.dat:
gci "$env:APPDATA\Windows Azure Powershell\TokenCache.dat"
ri "$env:APPDATA\Windows Azure Powershell\TokenCache.dat"
Finally, a kind sole suggested I simply try hosing out cookies from IE. That worked! Since I was in a PowerShell kind of mood, here’s how I emptied the cookie jar:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
(I learned of this technique on many web sites by searching for ‘clear IE browser cache command line’.)
My problem was solved, and I am back to productively using Add-AzureAccount.
Hope this helps someone!

Talk: Guest Lecture Harvard Cloud Computing Class

Last night I was pleased to speak at Zoran B. Djordjević‘s Cloud Computing class at Harvard Extension (my 4th year). After dazzling the class with my prowess at plugging in my laptop to the projector, we jumped into the public cloud, with lots of Azure specifics – and how designing applications for the public cloud is different than what they might be used to (whether Azure, Amazon, or Google) – along with really good questions and discussion…

If you are interested in such things, I’m on twitter (@codingoutloud), have been running the Boston Azure cloud user group for five years, and wrote a book on Cloud Architecture Patterns.

SLIDE DECK: 2014-11-14 – Microsoft Azure Cloud Platform Overview — Zoran Djordjevic-Harvard-CSCI E-90 — 14-Nov-2014 — Bill Wilder (blog.codingoutloud.com)

Talk: Pragmatic Azure at Boston Code Camp 21

Today I was delighted to speak at Boston Code Camp 21… Yes, that’s 21 code camps over the past 10+ years put on by the Boston dev community. There is a long list of volunteers , speakers, and sponsors.

My talk was: “Pragmatic Azure – What can the Azure Cloud do for me?” and the abstract is included below and the deck is here:

ABSTRACT

Pragmatic Azure – What can the Azure Cloud do for me?

Session Details – Boston Code Camp 21 – June 2014

Submitted by: Bill Wilder
Time: 10:20 AM – 11:30 AM, Saturday, June 21, 2014
Location: One Mem Drive, Commons (enter on 11)
Tags: Azure

A whirlwind introduction to the Microsoft Azure public cloud platform followed by a bunch of pragmatic ways to use it. From simple Web Sites to web-scale Cloud Services, from on-the-cheap dev-test environments to auto-scaling production services, Windows Azure covers the spectrum. What’s the story with designing for failure? What happens if I need to scale? How do I manage costs? These and more questions will be addressed.

Presented by Azure MVP Bill Wilder, it is based on real-world insights from an Azure-focused consultant who’s been working with the platform since the day it was announced in 2008. Some of the topics will be drawn from Bill’s Cloud Architecture Patterns book (O’Reilly Media, 2012).

Talk: Top Azure Features Every ASP.NET Developer Should Know About at Groupe Azure Montréal

Last week I was delighted to speak to the très agréable folks at the Groupe Azure Montréal.

My talk was: “Top Azure Features Every ASP.NET Developer Should Know About” and the abstract (in both French and English) is included below. Had a great time hanging out in advance of the event with both Alexandre Brisebois and Guy Barrette who were superb hosts and helped me and Maura get the most of our short trip to their fine city.

Here is a link to the slide deck (in PowerPoint): 2014-04-28 – April 28 – Groupe Azure Montréal – Top Azure Features Every ASP.NET Developer Should Know About.pptx

The sample code I spent the most time on can be found here: 

ABSTRACT

Lundi le 28 Avril 2014, nous sommes heureux d’accueillir Bill Wilder, auteur du livre « Cloud Architecture Patterns: Using Microsoft Azure », pour une présentation qui nous fera découvrir les meilleures facettes de la plateforme Microsoft Azure tout en mettent l’emphase sur le développement ASP.NET.

Bill adore partager et apprendre sur une multitude de sujets. Profitez-en pour lui poser vos questions à propos des patterns, des meilleur pratiques et des technologies qui en tour le cloud.

Inscrivez-vous sur notre page Meetup http://www.meetup.com/dotnetmontreal/events/135071842/

NOTE: Cette présentation sera en anglais

Sujet: Top Azure Features Every ASP.NET Developer Should Know About

Let’s face it: as technologists, “the cloud” is in the future for all of us, and resistance is futile. For many of us who predominantly develop on Microsoft technologies, adopting the Microsoft Azure cloud platform will be a natural progression.

How to get started? In this talk we will cover some easy ways to get started with the cloud, progressing from simple ideas to more ambitious ones as we go. Similar to how learning a new programming paradigm tends to stretch the mind (e.g., a C# developer learning functional programming with F#), you will also see that learning how to develop for the cloud will inform and shape how you go about developing day to day – even if not (yet) for the cloud.

Some of the topics we will cover (in varying depths) include devops, dev-test, non-.NET tool stacks, federated identity, semantic logging, and cloud-friendly architecture patterns – all while touching on a variety of Azure features and services on the way.

Conférencier: Bill Wilder, MVP Azure, Boston USA

Bill Wilder (Principal Cloud Architect for Development Partners Software Corporation) is a hands-on developer, architect, consultant, trainer, speaker, writer, and community leader focused on helping companies and individuals succeed with the cloud using the Microsoft Azure Platform. Bill began working with Microsoft Azure when it was unveiled at the Microsoft PDC in 2008 and subsequently founded Boston Azure, the first/oldest Microsoft Azure user group in the world in October 2009. Bill is recognized by Microsoft as a Microsoft Azure MVP and an Azure Insider, and is the author of the book Cloud Architecture Patterns, published by O’Reilly in September 2012. Bill can be found blogging at blog.codingoutloud.com and on Twitter at @codingoutloud. You can also check out the Boston Azure cloud user group at www.bostonazure.org and @bostonazure.

Talk: Guest Lecture at BU Cloud Computing Class

A couple of nights ago, I gave a guest lecture at Dino Konstantopoulos’ BU MET CS755 Cloud Computing class to a small group whose ability to stay awake and alert until 9:00 PM was impressive. My deck is attached.

For any of that class (or anyone else reading this), if interested in more Azure goodness, check out Boston Azure - www.bostonazure.org - a local user group that has now been meeting regularly (mostly at NERD) for around 4 1/2 years to learn about Azure, the cloud, architecting applications for the cloud, and more.

My book is available on Amazon: Cloud Architecture Patterns.

Slides from the talk: 2014-04-17 – April 17 – Building Cloud-Native Applications – Bill Wilder (blog.codingoutloud.com) – BU MET CS755

Stupid Azure Trick #10 – Use SSL on MSDN Visual Studio Azure VMs

If you are trying to Embrace SSL During Development when authenticating with Azure Active Directory, you may run into a little glitch if you do so on one of those handy MSDN Dev/Test VMs in Azure.

The glitch is that when running SSL on the MSDN VM the digital certificate for the SSL cert isn’t quite right. Here is a description of what you might see, followed by a workaround (until fixed at the source in the VM image).

The Problem

Visual Studio 2013 uses IIS Express by default and offers a very simple experience for HTTPS locally:

  • Create a web application
  • Look at the properties for ‘WebApplication1′ and you’ll see an option SSL Enabled – by default it is false, but change it to true
  • By setting SSL Enabled to true, you will now have a value forSSL URL which is something like https://localhost:44300 or above (ports 44300-44399 are reserved for this I think, and next new project gets next available – check out C:\Users\YOURACCOUNT\Documents\IISExpress\config\applicationhost.config to see the bindings that were set up)
  • Hit F5 to run, and if you can navigate to the HTTPS URL and you get the “hey, this cert isn’t trusted!” warning, but otherwise works fine – at least on the desktop. The behavior is different in the MSDN Visual Studio Azure VMs (NOTE: these are very specific VMs, described here - for those of you interested in taking advantage of those specially licensed VM resources associated with MSDN accounts).

Using MSDN Visual Studio Azure VMs, this developer experience does not quite work out of the box. SSL Enabled is true automatically when creating an ASP.NET app that uses Azure Active Directory for org authentication. If you create a new web app, then simply click Change Authentication and select Organizational Accounts, set one up, and then proceed as normal, then hit F5. When your app runs, it will try to authenticate over HTTPS, and it fails as in the scenario above if running on one of these MSDN Visual Studio Azure VMs.

The Solution

Follow these steps:

  1. RDP into your MSDN Visual Studio Azure VM
  2. Paste the following into a PowerShell Window and run them:
  3. $thumb = (dir Cert:\LocalMachine\my | Where-Object Subject -eq ‘CN=localhost’ | Select-Object Thumbprint –First 1).Thumbprint
  4. if ($thumb –ne $null) { del Cert:\LocalMachine\my\${thumb} }
    control /name Microsoft.ProgramsAndFeatures

    The above code will work in the default state of these VMs at this time which assumes only a single certificate with Subject of ‘CN=localhost’ is present in the certificate store.

  5. Right-click on IIS Express and select Repair.
  6. Celebrate your now functioning local F5-ready SSL experience.

 

[This is part of a series of posts on #StupidAzureTricks, explained here.]