Service URLs¶
Every service that Forge deploys through Azure Front Door has one canonical URL per environment. The URL is the environment's base URL plus a service-specific path, and each service type exposes it as a Terraform output so pipelines and other tools can read it instead of rebuilding it by hand.
🌐 Environment base URLs¶
The saif-resources environment module computes two base URLs and publishes them as context.naming.internal_base_url and context.naming.external_base_url. They contain the scheme and host with no trailing slash.
| Audience | Production | Non-production |
|---|---|---|
| Internal | https://app-int.saif.com |
https://app-int-<env>.saif.com |
| External | https://app.saif.com |
https://app-<env>.saif.com |
<env> is the lowercase environment short name, for example test. The choice of subdomain follows ADR 0005.
🔗 Service URLs¶
| Service type | Terraform output | URL | Internal or external |
|---|---|---|---|
Web app (saif-web-service) |
app_url |
<base>/<application_name> |
External when is_external_app is true, otherwise internal |
API (saif-api-service) |
api_url |
<base>/api/<type>/<name> |
External when is_external_app is true, otherwise internal |
Event service (saif-event-service) |
event_url |
<internal base>/api/event/<name> |
Always internal |
<type>for an API is the short API type:exp(Experience),proc(Process), orsys(System). Event services always useevent.<name>differs by service type. For an API it is theapi.nameinput, lowercased. For an event service it is the project ID with the firstapi-removed, lowercased, so it can differ fromapi.name.event_urlisnullwhen the service's OpenAPI file declares no operations, because no API is created in that case. Terraform does not store null outputs, so reading it then reports "output not found".
For example:
https://app-test.saif.com/policyportal
https://app-int-test.saif.com/api/event/events-gwcceventservice
The first is an external web app in the test environment. The second is an event service in the test environment.
Custom subdomains are not included
These outputs return the shared Front Door URL. A custom subdomain is an additional hostname for the same service and does not change app_url.
📤 Reading the URLs¶
From Terraform¶
Each project's infra root declares the output in its outputs.tf. From that directory, after a deploy:
Use app_url or api_url for the other service types.
From a pipeline¶
The tf_outputs step in the Terraform deploy job publishes each scalar output as a TF_OUTPUT_<name> pipeline variable, so later jobs read TF_OUTPUT_event_url, TF_OUTPUT_api_url, or TF_OUTPUT_app_url. An output that the project does not declare evaluates to an empty string.
From another Terraform module¶
Modules that receive the environment context can read context.naming.internal_base_url and context.naming.external_base_url directly and append their own path. The api module uses this to build its base_url, and the webapp and event-service modules use it for app_url and event_url.
📚 Related¶
- Terraform output event_url, api_url, or app_url not found: projects generated before these outputs existed
- Custom Subdomains
- Subdomain Names of Applications and APIs
- Service ↔ Azure Resource Model
- Service Discovery