The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Active Directory!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

Azure - Web Application with MultiTenant SaaS model RRS feed

  • Question

  • Hi,

    We have created C# web application (not used MVC) and hosted in Azure environment. This is working fine.

    Now we have tried to achieve the below in Azure:

    1) We will host the c# web application (not MVC application) in Azure.

    2) Provision to access the web application for multiple AD users (i.e. Multitenant model)

    3) Each tenant will have the separate database, File storage in Azure.

    We are trying to achieve the above Multitenant concept in SaaS. When we google the Multitenant concepts, we have got MVC application samples. But we need to achieve this for normal C# web application. We need to know how we can separate the tenants, how we can manage the separate databases for each tenant, how to achieve the above solution?.

    Kindly provide sample applications ( C# applications) to achieve the Multitenant SaaS model. (We expect non-MVC sample applications).

    Kindly help us on this.

    Nandhakumar R

    Thursday, December 21, 2017 9:23 AM

All replies

  • You could try the following links:

    1. Build a multi-tenant SaaS web application using Azure AD & OpenID Connect
    2. Build Multi-tenant SaaS Apps with Azure Active Directory

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, December 21, 2017 8:11 PM
  • Hi Neelesh Ray,

    Thank you for the details.

    Now we know how to access the single application by using the multiple tenants in azure AD.

    But we need to know,

    1) How to create the database for each tenants (i.e. database per tenant). is it created manually or programmatically?

    2) For example, if one tenant can access the application, how to identify the tenant DB and how to configure the connection string in the application to access the tenant database.

    Kindly provide any other sample source code and details to achieve the above.

    Thank you. 

    Friday, December 22, 2017 12:34 PM
  • In Azure Active Directory (Azure AD), a tenant is representative of an organization. It is a dedicated instance of the Azure AD service that an organization receives and owns when it signs up for a Microsoft cloud service.

    Refer: How to get an Azure Active Directory tenant

    The data is stored in the Tenant itself and not in a Database.

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, December 28, 2017 8:40 PM
  • 1) You could start with creating the db-per-tenant databases manually but in the end, you should probably do it either programmatically or with Powershell scripts as in the Microsoft Wingtip SaaS example here:

    2) You can identify the tenant db by looking it from your catalog db using either the tenantId claim or the issuer Id from the token.

    Friday, August 31, 2018 11:05 AM
  • Just checking in if you have had a chance to see our previous response. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.
    Sunday, September 2, 2018 5:44 PM