'Programmatically create Applications and Services

For our new project we have to support a multi-tenant scenario. It has been recommended that having an application per tenant is the safest model, so we have logically separated our Apps into SystemApps and TenantApps

Where the tenant services should be accessible (internally) via

fabric:/TenantApps_{tenantId}/SomeTenantSvc

We intend to have a System service that creates and removes client applications and checks their health. These applications will have a default service which in turn starts/stops other services within their application based upon their subscriptions.

All good in theory, but I can't for the life of me find where to create new applications and services from code. I Assume it's something to do with the FabricRuntime - but the finer details elude me.

If anyone is able to give an example or link to the correct documentation then I would be grateful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source