How to serve static files for your website using Azure

Killer features and a beautiful design are important things when developing a website. However, none of that matters if your site doesn’t perform well or is not able to scale when necessary. Serving static files such as CSS and images from your web server is not ideal.

These are some of the disadvantages of serving static files directly from your web server:

  • Unnecessary deployment of files that do not change often, potentially slowing the deployment process.
  • Increase the load of your web server, making it less responsive.
  • Increase of hosting costs
  • Etc…

Here are some of the advantages of not serving static content from your web server:

  • Distribute web server load.
  • Save bandwidth.
  • Boost performance and reduce your existing hosting costs.
  • Ability to update static files by replacing them in CDN without having to deploy entire website.
  • Etc…

In this blog post I will show you how to take advantage of Microsoft’s Azure CDN and Blob storage to make your website serve all of its static content from the Azure CDN. If you don’t have an Azure account and you are a web developer you are missing out. Azure supports a wide range of frameworks and technologies including but not limited to Python, MySQL, Oracle, Java, Linux, PHP, Ruby and of course all of Microsoft products such as .NET, MS SQL, etc… Also, they offer a program for startups called BizSpark where you get Azure services for free, you can sign up here if you like.

Create a Blob storage account and a container

First of all you need to create a blob storage account and then a container which you’ll use to store all of the static content. To do this open your Azure portal and then click on the + NEW button located at the bottom left corner of the portal and select Data Services > Storage > Quick Create > as shown below, then just type a URL to identify this new blob storage account. In this example I used the name “mystaticfiles”.

Create Blob Storage Account Image

It takes approximately 1 minute for the blob storage account to be created. Think about it, it takes a minute (or less) to deploy a blob storage account/instance capable of logging, monitoring and redundancy.

After that you’ll see your newly created storage account, click on the name of it, then on the Containers link and then on Create Container as shown below:

Create Storage Container Image

After the Create Container window opens, type the name of the new container and its access type. For this example we are going to select Public Blob which allow us to have a container where all files are available to the public. The other two options are Private which makes the container available to you only and Public Container which allows anyone to have access to the files, metadata and pretty much everything else in this container.

create container in Azure

Manage the blob storage account and container

Now that you have your new storage account and container, you can start transferring static files from your website to the container(s) you’ve created. To do this, you can either write a service that does this for you or use one of the programs available that help you manage your containers and files in an Azure storage account.

I found an open source application to help me manage my storage accounts and containers and so far it has worked out very well for me. If you are interested, you can download it here and even get the source code for it too:

Azure Storage Explorer

You can use this application to browse your files as well. Once you have all your static files in your Azure blob storage containers you can then update your static file’s path to point to the Azure containers. For example, here is a link to one of my images stored in Azure blob storage:

https://foreverbitapp.blob.core.windows.net/images/journal9_medium.jpg

Are you using Azure blob storage? please share any tips or feedback in the comments below.

Error 0x80131902: Failed to create the managed bootstrapper application.

This error message has been giving me headaches for a while, I have seen it happen in different Windows computers when trying to install a Visual Studio update or a new version of Visual Studio. If you Google for the string “Error 0x80131902: Failed to create the managed bootstrapper application.” you’ll find some sites and forums where the following advice and tips are given:

The error in the log, 0x80131902, means that the .NET Framework could not be loaded (more specifically, an AppDomain could not be created).

Do you have at least .NET 3.5 installed/enabled on your machines? You might also connect to Windows Update and make sure you have all required updates installed. There may be some bugs that have been fixed in the .NET Framework.

Another possibility – though not for this specific error but in general – is that your graphics drivers our out of date or not appropriate for your card (mentioned to @TobiasUlm below in another thread). Setup uses WPF and sometimes bad graphics drivers can cause issues (happened with VS itself for some users).

Visit your graphics card’s manufacturer web site and make sure you have the newest driver available for your card and, on Windows 7, that you have the latest DirectX runtime installed. See http://support.microsoft.com/kb/179113 for more information.

– Heath @ http://blogs.msdn.com/heaths; Visual Studio Professional Deployment

Also…

As you can install VS11 with the same ISO successfully on other machines, I think your VS11 ISO should be fine. And please follow the steps below to see if it helps you:

TemporarilyTurn off your anti-virus/antispyware software during installation;
Install the latest Windows updates from the Windows Update site: http://update.DataZX.CN;
Complete or dismiss Windows Update before installation. (And don’t forget to turn it on
later);
Clean your %temp% folder (Start Menu >>Run >> Type “%temp% >> OK);
Then run the setup with Administrator privilege: right-click the installer -> Run as administrator.
Thanks.

Vicky Song [MSFT]
MSDN Community Support

And…

Do you also install VS11 Developer Preview on that Windows7 machine? If so, I am afraid you need to first uninstall the VS11 DP and then install the VS11 Beta again.

In addition, please try to uninstall VS11 Beta completely from your machine and then try re-install it to see if you get the same result. And for the .NET application related issues, I think can consider reinstall .NET Framework 4.5 again. You can find it here:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27541

If you still get the same result, please offer me the complete installation log files you get.

Of course I tried all of those suggestions but none of them worked for me. Every time I tried to install a VS update or a new version of VS – this is the entire log showing me the errors, the error messages were exactly the same for both updating or trying to install a new version of VS:

…..

[0898:1304][2014-04-11T09:08:22]: Loading managed bootstrapper application.
[0898:1304][2014-04-11T09:08:22]: Error 0x80131902: Failed to create the managed bootstrapper application.
[0898:1304][2014-04-11T09:08:22]: Error 0x80131902: Failed to create UX.
[0898:1304][2014-04-11T09:08:22]: Error 0x80131902: Failed to load UX.
[0898:1304][2014-04-11T09:08:22]: Error 0x80131902: Failed while running

…..

[0898:1304][2014-04-11T09:08:22]: Error 0x80131902: Failed to run per-user mode.
[0898:1304][2014-04-11T09:08:22]: Exit code: 0x80131902, restarting: No

As you can see the advice is very similar and while this might have helped some people, it did not help me. After looking around extensively and trying different approaches, I did the opposite of what most people suggested and actually turned off the Microsoft .NET Framework 3.5.1 Windows feature located under Programs and Features – Turn Windows features on or off – see screen shot below:


disable 3.5 .NET framework photo

After turning off Microsoft .NET Framework 3.5.1 I tried installing the updates for VS2012 and installing VS2013 and everything worked flawlessly. After the installations completed successfully, I opened back the Windows features on or off menu and enabled the Microsoft .NET Framework 3.5.1 once again.

This is what I got after my simple fix/change and I hope you can get to the following screen too!

VS install successful photo

Programming languages and work opportunities

What is the best programming language to learn these days? this is a question that I hear all the time and this question usually generates all sorts of responses, both good and bad. The reality is that when people ask that question they do it for different reasons and so there is no right answer. Programming languages are like people, they are all alike but yet unique. For someone new to programming I recommend learning about programming without picking a programming language, at least not from the start.

Programming in a hackathon

Learn about programming before picking a programming language

Learning about programming is much more than just learning a programming language. Programming is about finding solutions to a problem and you do this by performing tasks such as understanding and analyzing these problems to find the right solution for these problems. There are many things to be learned about programming that do not require the commitment to a programming language, start with that, learn about logic, computing, and start by playing with some programming languages once you understand the concept of programming.

When you are ready to learn your first programming language or are already a software developer and perhaps are looking to learn a new programming language just for fun, then I recommend you just start playing with a dynamic language and a static one.

Static or dynamic Languages

If you are new to programming, let me explain the difference between static and dynamically typed languages. In short, a statically typed language is where the type of a variable is known at compile time, this means that you as a programmer must specify the type of each of your variables as it is the case in static languages such as C, C++, C#, Java, etc… In dynamic languages the majority of its type checking occurs during runtime as opposed to compile-time. As a programmer, a dynamic language allows you to move a bit faster as you don’t have to specify the type of your variables, etc.

Marketability of programming languages

If instead you are looking to increase your marketability, then here is some data to help you decide. The numbers below are changing constantly, however the general position for all programming languages listed below is very consistent. All of the data from the chart below came from digging in the number of current job openings in the Unites States for the specified programming languages in the following job listing sites: Indeed, Dice, LinkedIn, StackOverflow Careers.

Number of Job openings by programming language in the U.S.

One programming language that has become popular in recent years is JavaScript. In the past, JavaScript was mostly used as a utility language and most programmers used it to compliment (and hack) their user interfaces. With the increase of HTML5 apps and the many JavaScript based frameworks, this programming language has become more relevant and the number of companies (and startups) looking for experienced JavaScript developers has increased, a lot.

Currently, JavaScript is the second most popular requested skill in programming jobs posted in the largest job search engines out there in the United States.

Conclusion

If you are looking to learn a programming language to increase your chances of being hired, look at the chart above, keep monitoring the demand as it might change in the future AND learn at least one static programming language such as C# or Java and one dynamic language such as JavaScript, Python or Ruby.

A good programmer is the type of person who is always learning, and enjoys doing it. Most programmers I know are highly skilled with one programming language but familiar with most. Knowing a bit about multiple programming languages gives you the flexibility to learn and become more experienced with certain languages when you have the need. For example, for many years I was a Visual Basic developer until the day came when most job openings from companies working with .NET technologies where looking for C# developers, I started looking at the language, tried to create a few simple programs and eventually got a job as a C# developer.
After getting into C# I started to learn PHP and JavaScript as I ran across a few projects that needed that expertise. Learning these programming languages wasn’t hard, it was mostly teaching myself to do things differently, discovering and taking advantage of each of these languages’ capabilities and features instead of complaining or getting stuck on its differences.

Today, I try to keep myself current with some of the newer programming languages and frameworks, it is our duty as professionals to stay current and as challenging as this is, learning is always enjoyable. If you have any thoughts or questions about the chart above please leave a comment below.

Phone Screen Interview

When you are hiring a developer and start looking at resumes or LinkedIn profiles it is very common to find people with a great resume or professional profile – but be careful because having a great looking resume or awesome LinkedIn profile doesn’t always translates into greatness – this guy must be great, it has tons of LinkedIn recommendations and many connections!

A phone screen interview is a very common filter used when hiring for a tech position. As a software developer myself I’ve participated in a fair amount of phone screen interviews both as the candidate and as the interviewer. The phone screen interview is what the name implies, it is a relatively quick way to screen candidates and filter out the best candidates from the group of people who look good on paper (or LinkedIn). A phone screen interview can be very useful to determine if a candidate is truly a great candidate that you want to invite to a face-to-face interview with your team or just someone with a good resume.

When done right, the phone screen can save you and your team from spending hours interviewing the wrong person for the job.

The first rule of thumb is to try to talk as little as possible, just ask a few key questions and let the candidate do the talking. Listen carefully and notice how they respond to questions they know and pay special attention to how they answer and elaborate on things they are not too familiar with. This will tell you a lot about their personality and how they behave when they are under a bit of pressure. The phone screen interview should not take more than 30 minutes and ideally, it should be split into two basic sections: personality and technical skills. Remember that the goal is to decide if you want to invite this person to a face-to-face interview and not making a hiring decision over the phone.

Here are some tips that can help you get started.

The agenda

  • The phone screen interview should be kept at about 30 minutes.
  • Ask questions, listen and thank the candidate for their time.

The personality part

  • Communication skills and story telling. Ask about their decision to be in the technical field. This usually helps to tell how good are they at story telling and it also helps to know how much they love (or not) what they do.
  • Ask about their opinion about a certain framework. Most technical people, specifically developers are very opinionated and passionate about their craft and the tools and frameworks they use.
  • Ask about the reasons they want to join your company, and if they are open to it ask them if they want to share the reason they are leaving their current employer.

The technical part

  • Ask about what technology stack they have more experience with and let them go into details.
  • Once they tell you what technology stack they prefer ask a few more in-depth questions about it, this will help you figure out how much experience they really have about it.
  • Ask if they can explain how the architecture of a website or application like yours work (if applicable).
  • Ask a plain technical question such as how to reverse items in a list or characters in a string. You can also ask something more generic, for example how to handle errors in a web application.

The above has worked very well for me, I have used it more than a few times in the past with really good results. If you are the one being interviewed, my suggestion is to offer to answer some of these questions even if the interviewer does not ask you this; unfortunately many times the one person doing the phone screen interview is someone from an HR department and it might be beneficial to you if you drive the interview by offering to talk about the things mentioned above. If you are hiring for a technical position other than a web developer then you might want to change the technical questions around, just keep in mind that the goal here is to get the best candidates for a face-to-face interview that will and should contain more in-depth technical and personality questions.

Cheers.