I have a MVC5 webapp that I protect using ACS (Access Control Service). One of the identity providers is the Windows Azure Active directory.
I want the user to be able to create their own AD tenant and create a user themselves using my webapp.
How can I create a Azure Active Directory tenant and create an accompanied user by code?
I don't believe you can programmatically create a new AD tenant. One is tied to the subscription when its created, and assigning it to a domain requires several manual steps.
However, with regards to creating/managing users in that tenant, I'd suggest you start looking here: http://msdn.microsoft.com/library/azure/dn646737.aspx#BKMK_Graph and here: http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx