Month: May 2014

Explorations with Azure – knocking out a pilot website in about two hours.

So recently I was asked to put together a pilot website for a friend who’s not super tech-savvy. His business may or may not ever get off the ground; like most of us he’s wanting to float something out there and see if it goes somewhere. An internet storefront seemed like a great place to start.

OK, so after the requisite weeks of haggling over the name, I scaffolded out a site and posted it on Azure. I’m happy to announce that the site is awesome, very responsive – and best of all, free. It’s a VERY good use case for what Azure does very well – quick ramp-up sites that may or may not see full-size production traffic.

My first step was to create a Visual Studio Online project. This was simple – see below:

Following this I opened up the project in Visual Studio 2013. I had to map the workspace and pull down the code – in this case it was empty – before we could see our old friend Source Control Explorer.

Now, to work. I clicked, File, New Project, and selected ASP.NET Web Application. I selected Application Insights and synched it up with my new stonefly.visualstudio.com account.

 

I used the MVC option as my main option – but also added WebForms and WebAPI in case I want to tack them on in the future. Now, I’ve got a set of code available – that I can see is ready to be checked in. Right mouse click that baby and check in the code!

 

Back to your Azure account. Click on New Web Site and select the Custom Create option. I entered in my desired URL and a bare-bones SQL option – and, this is important, selected the Publish From Source Control option.

Selecting that option took me to the authorize connection screen in Azure, where I synched up my stonefly.visualstudio.com sourcecode with the new Azure website that was being spun up. Select the Authorize Now option here.

Once I did this, it took me back to Visual Studio 2013 – where a publish profile was ready to go for me. I skipped through the now-familiar Profile -> Connection -> Settings -> Preview steps – they were all set up nicely by the Azure publish profile – and clicked Publish.

 

… and, my site was published – lickity split. I could view it on stonefly. I also get all that cool less-is-more Azure dashboarding, showing requests/response time:

Best of all, I now have my site up and my code available in a repository that I can access anywhere. Feel free to check it out. No need to walk around with thumbdrives anymore. And, there’s something about building out a demo site quick and cheaply like this that appeals to me. Add to it that my TFSOnline account was free – yes, free (if MSFT ever changes that I could move over to GitHub) – and the case for handling this in Azure versus going all-out and spinning it up on discountasp.net or the like becomes pretty compelling. This is enough for my friend to evaluate and decide on next steps. Sprinkle in some HTML and CSS, and suddenly we’ve got ourselves a going concern:

Now, I could buy a DNS address (like, I don’t know, stoneflysoftware.azu or the like) and register it with Azure. But I probably won’t. As you can see from this site, it ain’t cheap – we’re talking $56/month for basic, which is a great deal if you have 6 or more sites you’d like to host, or you need true geodistributed 99.9% HA coverage on your site. Scott Hanselman has a whole series of articles on pennypinching with Azure that I’d recommend, including this nifty video on using Azure as a CDN.

 

 

Advertisements

EntityFramework – “The provider did not return a ProviderManifest instance”

Quick post for the day. I was trying to configure a data source in a listview – converting over to EntityFramework from a SQL data source – and I got this funky message:

Hmmm. Why is this? Well, I had to open up my data models project, and change the ProviderManifestToken=”2012″ attribute to “=2008”.

\

And voila. Changing that one key – and this is a known bug with EntityFramework 6 that the team has on their list to fix – got me where I needed to go. I had my lot tracking admin screen up and going in about 5 minutes.

Webforms Versus MVC – Honestly, Who Cares?

P.s. – Webforms, rightly, have a bad name – because of bloated codebehind. But what happens when you drag on a listview, and click on the little arrow in the Design pane – and point to an EF data source with a PK? Suddenly, you have a fully functioning page – with NO codebehind – and all your upd/ins/del statements are coming straight from EF. That seems pretty clean to me.

To me – and to many others – ASP.NET Webforms and MVC are equivalent forms. IF your webform has no bloated codebehind, and is running from either a EF-generated model or, better, knockoutJS data binding – don’t you have a clean and easy to maintain architecture?

Webforms are bad if you have bloated codebehind. They’re good and equivalent to MVC without that code smell. MVVM – well, that is a superior pattern to both – but that’s for a future post.

Science cannot move forward without heaps!

So today I was having an issue where the site would build perfectly locally, but would burp up garbage when I published it out to DEV. So, after messing around with the source code a little, I started back at the beginning, with a raw HTML page, then built a master page, and voila – the issue was in something I’d missed in migrating the CSS code over from an older site. Now I could build my monument to CSS3/HTML5 while ignoring the piles of dead code littered along the path behind. Reminds me of that classic Futurama quote:

Professor Farnsworth: “This time I’m sure I fixed the mind-switcher.”

Amy: Good. I’m sick of cleaning up those heaps of dead rhesus monkeys!”

Professor Farnsworth: “Science cannot move forward without heaps!”

 

An interesting article on the ultimate dead end of ‘truthiness’ here – Language and the Cheshire Grin of Donald Rumsfeld: “…He was trying to articulate a philosophy, and in articulating the philosophy he was basically saying things that he believed but which made no sense. I think that’s probably the best way to describe it. He knew these expressions. He wrote this to the president of the United States: “The absence of evidence isn’t the evidence of absence.” … Then all of a sudden the ballistic missile commission picks it up, and Rumsfeld runs with it, and it’s trucked out during the run-up to the Iraq war.  UN weapons inspector goes to Iraq and can’t find any evidence of a WMD—that’s not absence of evidence, that’s direct evidence that the suspected WMDs are simply not there. The way I describe it is that it’s like someone tells you there’s an elephant in the room. You open the door and you look in the room, you open the closets, you look under the bed, you go through the bureau drawers, and you don’t find an elephant. Is that absence of evidence or evidence of absence? I would submit it’s the latter. But this gobbledygook use of nomenclature and terminology just creates endless confusion, vagueness, ambiguity—and I would submit that they kept doing this with respect to everything.” 

Getting started with app dashboarding using Application Insights.

Application Insights have been getting some buzz recently with TechEd and other events. Why is that?

Let’s start with an existing website. Once I installed the VISX file for Application Insights and restarted Visual Studio, I can right mouse click on my project and add Application Insights Telemetry to the project.

 

It looks like you MUST have your project hosted on Visual Studio Online for this to work. I dusted off my old account and…

Hmmm. What ARE these cool new dashboards that just appeared in my web project?

Let’s build it and deploy out to a website. We’re going to follow the step by step instructions here. (and… screeching halt – this won’t work for my app, since it’s an intranet app and not public-facing. Sigh.) Still, I’m going to leave this here since it shows – adding dashboarding to show availability and performance for your website is literally just a right-mouse click. You can check for:

availability

track usage

…including what pages/features are being used by your customers:

v

 

 

.. and even set up tiles with a custom dashboard. Think about deploying this along with your site. I was so impressed with the real-world metrics that came OOTB with Azure. Microsoft’s definitely upped the ante with Application Insights.

Other Tidbits

 

Some good advice from the redoubtable Julie Lerman this month in MSDN. Updating from EF4 to EF6 (and now EF7 I guess!) is relatively trivial – mainly some namespace changes. But breaking up a large data model into pieces, while HIGHLY desirable from a performance standpoint, is a little more substantial – and changing from ObjectContext to the newer DbContext API is fairly involved. She recommends doing it one piece at a time. Start with a separate model project, split out as you like – then change your app references one by one and see what functionality breaks. There’s some big performance gains you’ll see in going from EF4 to 5/6; it’s well worth it. Please check out her books and teaching videos on Pluralsight, they’re terrific.

Side note – I thought this Grantland article was terrific. Nintendo started with a small market, kept a laser focus on a specific niche (9-to 14-year olds) and grew with one dynamic product, Donkey Kong. They survived and counterpunched Universal when they tried to shake them down with a copyright claim extortion from the 1933 movie King Kong. And they deliberately created marketing buzz with a specific look and only fulfilling a fraction of vendor requests. This long term strategy over short term profits – combined with the Seal of Quality and a strict licensing program that weeded out all but serious development companies – fueled their rise from the wreckage of the American video game companies like Atari.

Theming It Up! I love you Bootstrap, never leave me alone again…

 

So, here’s my “second version” of my site. Using plain vanilla Bootstrap. Barf, urf, yuck.

How do I kinda beef this up look-wise without spending half a lifetime in CSS-land?

Well, I tried using some of the free Metro themes. And, it looked… better but still really plain.

 

So, cough up $10 or so and get a professional’s assistance. I went through probably about 20 designs and ended up setting – for the bargain-basement price of $8 – on the Atropos theme. (It just looked a little more professional than the 2nd place winner, Flanzo – if I wanted something a little more forward-looking I would have gone with Clean or – something I really like in terms of look – Smart.

Anyway I just took the embedded HTML assets – which are actually nicely organized – and dropped them into my root folder and built it. Stripped out some pieces piece by piece and – looky here!

 

I’m not a UX expert – that’s a legitimate and very-little understood specialty – and I don’t like pretending to be one. Paying an expert a few bucks to pop together a great looking site, where I can drop in some simple HTML – and have it work on any device, FAST, is a great plus.

Still looking for UX ideas? A friend put together a GREAT looking site – again using Bootstrap – here: http://www.crossfitreflexion.com – feel free to give that a look. That’s a clean user interface, and it looks GREAT on a mobile device.

 

Themes I looked through