Migrate from sample code in term of patterns & practices Microsoft Azure Guidance - Developing Multi-tenant with Microsoft Azure. From Azure SDK version 1.7 to Version 3.4.
I kept the licensing of the code belonged to Microsoft.
Have fun with the code, feel free for vote me a star :-)