Environment Config
Portal configuration or portal environment variables are defined in the "portal.config.json" file located within the "./src" folder under "portal-client." The schema for this JSON file can be accessed here.
The "Project Portal" configuration encompasses various aspects of the application, such as authentication settings, service discovery, and logging configuration.
The following is being injected by the webServer, if new variables are to be added
var portalConfig = {
"title": "@clientBundle.Title",
"description": "@clientBundle.Description",
"portalId": "@clientBundle.PortalId",
"serviceDiscovery": {
"client": {
"baseUri": "@fusionPortalApi.BaseAddress",
"defaultScopes": [
"@fusionPortalApi.Scope"
]
}
},
"portalClient": {
"client": {
"baseUri": "@fusionProjectPortalApi.BaseAddress",
"defaultScopes": [
"@fusionProjectPortalApi.Scope"
]
}
},
"bookmarks": {
"name": "@fusionBookmarks.Name",
"identifier": "@fusionBookmarks.Identifier",
"subsystem": "@fusionBookmarks.Subsystem"
},
"msal": {
"client": {
"tenantId": "@clientBundle.Msal!.TenantId",
"clientId": "@clientBundle.Msal!.ClientId",
"redirectUri": "@clientBundle.Msal!.RedirectUri"
},
"options": {
"requiresAuth": true
}
},
"logger": {
"level": 0,
"defaultClientLogger": {
"active": false,
"level": 0
}
},
"applicationInsights": {
"connectionString": "@applicationInsights.ConnectionString"
},
"agGrid": {
"licenseKey": "@clientBundle.AgGrid!.LicenseKey"
},
"fusionLegacyEnvIdentifier": "@clientBundle.FusionLegacyEnvIdentifier"
};
window["_config_"] = portalConfig;
example of development client config:
{
"$schema": "../schema/portal.config.schema.json",
"title": "Project Portal",
"description": "Welcome to the project portal powered by Fusion",
"portalId": "0177ef5f-c49e-4d2a-7907-08db31e4e851",
"serviceDiscovery": {
"client": {
"baseUri": "https://fusion-s-portal-ci.azurewebsites.net",
"defaultScopes": [
"5a842df8-3238-415d-b168-9f16a6a6031b/.default"
]
}
},
"portalClient": {
"client": {
"baseUri": "https://backend-fusion-project-portal-test.radix.equinor.com",
"defaultScopes": [
"api://02f3484c-cad0-4d1d-853d-3a9e604b38f3/access_as_user"
]
}
},
"msal": {
"client": {
"tenantId": "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
"clientId": "0713378c-3499-4d7b-a3a5-82fa8d221086",
"redirectUri": "/authentication/login-callback"
},
"options": {
"requiresAuth": true
}
},
"bookmarks": {
"subSystem": "Project Portal",
"identifier": "project-portal",
"name": "Project Portal"
},
"logger": {
"level": 0,
"defaultClientLogger": {
"active": false,
"level": 0
}
},
"fusionLegacyEnvIdentifier": "ci"
}
info
We're using subsystems and identifiers to sort Project Portal-related bookmarks. However, we're still in the early stages of refining the portal identifier and portal service. You can find more information in this GitHub issue.