Moving function up to top of script.
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-tools-samples.git