Category
No response
Description
Our customer has an Application Gateway setup in front of the dashboard, in order to have it:
- Accessible from public internet (or at least, they have control over it).
- Formatted URLs (no weird containerApp Suffixes).
In order to support this, the AppGW is configured for 2 containers:
- Dashboard-v2
- Dashboard-gateway
Each with their own prefix (e.g. Dashboard & dashboard-api).
In order to support this from our end, 2 appSettings need to be overridden on the dashboard-v2 container:
BASE_API_ROOT_URL --> Change to Dashboard-gateway AppGW URL
NEXTAUTH_URL --> Change to Dashboard-v2 AppGW URL (for callback URL) (!! Also requires this URL to be set in the Entra ID callback URL !!)
API_URL can remain unchanged, as this is a M2M call between 2 containers within the environment.
Additional context
I have no additional context on the AppGW setup itself, but there are several things that need changing on the containers:
In azuredeploy-main.bicep I added 2 new optional parameters:
param DashboardGatewayAppGatewayUrl string?
param DashboardAppGatewayUrl string?
In the dashboard container app, change the following settings to be optionally overridden:
{
name: 'API_URL'
value: 'https://${InvictusDashboardGatewayACA.outputs.fqdn}/DashboardGatewayFunction'}
{
name: 'BASE_API_ROOT_URL'
value: DashboardGatewayAppGatewayUrl != null ? 'https://${DashboardGatewayAppGatewayUrl}/DashboardGatewayFunction' : 'https://${InvictusDashboardGatewayACA.outputs.fqdn}/DashboardGatewayFunction'
}
{
name: 'NEXTAUTH_URL'
value: DashboardAppGatewayUrl != null ? 'https://${DashboardAppGatewayUrl}' : 'https://${invictusDashboardWebAppName}.${ContainerAppsEnviroment.outputs.defaultDomain}'
}
In the dashboard gateway container app, optionally change CORS policy:
corsPolicy:{
allowCredentials: true
allowedOrigins: [
DashboardAppGatewayUrl != null ? 'https://${DashboardAppGatewayUrl}' : 'https://${invictusDashboardWebAppName}.${ContainerAppsEnviroment.outputs.defaultDomain}'
]
allowedHeaders: [
''
]
allowedMethods: [
''
]
Category
No response
Description
Our customer has an Application Gateway setup in front of the dashboard, in order to have it:
In order to support this, the AppGW is configured for 2 containers:
Each with their own prefix (e.g. Dashboard & dashboard-api).
In order to support this from our end, 2 appSettings need to be overridden on the dashboard-v2 container:
BASE_API_ROOT_URL --> Change to Dashboard-gateway AppGW URL
NEXTAUTH_URL --> Change to Dashboard-v2 AppGW URL (for callback URL) (!! Also requires this URL to be set in the Entra ID callback URL !!)
API_URL can remain unchanged, as this is a M2M call between 2 containers within the environment.
Additional context
I have no additional context on the AppGW setup itself, but there are several things that need changing on the containers:
In azuredeploy-main.bicep I added 2 new optional parameters:
param DashboardGatewayAppGatewayUrl string?
param DashboardAppGatewayUrl string?
In the dashboard container app, change the following settings to be optionally overridden:
{
name: 'API_URL'
value: 'https://${InvictusDashboardGatewayACA.outputs.fqdn}/DashboardGatewayFunction'}
{
name: 'BASE_API_ROOT_URL'
value: DashboardGatewayAppGatewayUrl != null ? 'https://${DashboardGatewayAppGatewayUrl}/DashboardGatewayFunction' : 'https://${InvictusDashboardGatewayACA.outputs.fqdn}/DashboardGatewayFunction'
}
{
name: 'NEXTAUTH_URL'
value: DashboardAppGatewayUrl != null ? 'https://${DashboardAppGatewayUrl}' : 'https://${invictusDashboardWebAppName}.${ContainerAppsEnviroment.outputs.defaultDomain}'
}
In the dashboard gateway container app, optionally change CORS policy:
corsPolicy:{
allowCredentials: true
allowedOrigins: [
DashboardAppGatewayUrl != null ? 'https://${DashboardAppGatewayUrl}' : 'https://${invictusDashboardWebAppName}.${ContainerAppsEnviroment.outputs.defaultDomain}'
]
allowedHeaders: [
''
]
allowedMethods: [
''
]