Mimetis / ProjectY

Project Y is a straightforward Landing Zones automated deployment tool dedicated to data processing.
MIT License
7 stars 5 forks source link

Azure Multi Subscriptions targeting #4

Open Mimetis opened 3 years ago

Mimetis commented 3 years ago

Idea

Able to deploy engines in several subscriptions from one single endpoint: Since everything is handle by the Ygdra.Host Web Api, we can imaging having on single Web UI that could eventually reach several Web Api endpoints.

Today

Today, the project has been created to target only one subscription:

image

What we want

image

Today Config file

The appsettings file from Ygdra.Web.UI looks like:

{
  "AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
    "Domain": "XXXX.onmicrosoft.com",
    "TenantId": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
    "ClientId": "CCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCC",
    "CallbackPath": "/signin-oidc",
    "SubscriptionId": "SSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSS",
    "ClientSecret": "ooooooooooooooooooooooooooooo"
  },
  "Graph": {
    "BaseAddress": "https://graph.microsoft.com/beta",
    "Scopes": "User.Read User.ReadBasic.All"
  },
  "YgdraServices": {
    "BaseAddress": "https://localhost:44339",
    "Scopes": "user_impersonation"
  },
  "SignalR": {
    "ConnectionString": "Endpoint=..."
  }
}

Can we imagine to have a multi subscriptions settings ?

{
  "Targets":[
    {
    "Instance": "https://login.microsoftonline.com/",
    "Domain": "XXXX.onmicrosoft.com",
    "TenantId": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
    "ClientId": "CCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCC",
    "CallbackPath": "/signin-oidc",
    "SubscriptionId": "SSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSS",
    "ClientSecret": "ooooooooooooooooooooooooooooo"
  },
  {
    "Instance": "https://login.microsoftonline.com/",
    "Domain": "XXXX.onmicrosoft.com",
    "TenantId": "ZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZ",
    "ClientId": "DDDDD-DDDD-DDDD-DDDD-DDDDDDDD",
    "CallbackPath": "/signin-oidc",
    "SubscriptionId": "UUUUUUU-UUUU-UUUU-UUUU-UUUUUUUUUU",
    "ClientSecret": "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"
  }],
  "Graph": {
    "BaseAddress": "https://graph.microsoft.com/beta",
    "Scopes": "User.Read User.ReadBasic.All"
  },
  "YgdraServices": {
    "BaseAddress": "https://localhost:44339",
    "Scopes": "user_impersonation"
  },
  "SignalR": {
    "ConnectionString": "Endpoint=..."
  }
}

The subscription selection, when deploying an engine, could be done from the deploy web page

image