APIM Platform Provisioning
The platform baseline is implemented under
rome-ion/infrastructure/spoke/apim. It creates one Rome APIM service in each
environment and installs the controls inherited by service-owned APIs. The V3
baseline is the V2 baseline; this page records the current deployed values.
Resource convention
| Concern | Deployed convention |
|---|---|
| Environment short codes | apa, bta, gma, prd |
| Resource group | rg-rome-{env}-chn-01 |
| APIM service | apim-rome-{env}-chn-02 |
| Primary APIM UAMI | id-apim-{env}-chn-01 |
| Internal API UAMI | id-apim-{env}-chn-inapi (Internal API) |
| AI API UAMI | id-apim-{env}-chn-aiapi (purpose Inferred) |
Identifiers, audiences, tenant values, and secrets remain controlled environment configuration.
Deployed tier and capacity
Verified in rome-ion/infrastructure/spoke/apim/environments and
apim_scale_rule.tf:
| Environment | SKU | Autoscale range |
|---|---|---|
| Alpha, Beta | Standard_1 | 1–2 units |
| Gamma, Production | Standard_2 | 2–3 units |
Autoscale uses the APIM Capacity metric: above 70% for 10 minutes adds one
unit, below 30% removes one unit, with a 5-minute cooldown. Availability zones
are not configured (commented out in the module call). Frontend and backend TLS
1.0/1.1 and weak ciphers are disabled.
Provisioning sequence
Provision APIM and attach its identities
Owner: Platform team
Create the environment APIM service from the local
tf-modules/azure/api-management-public module and attach the primary, internal
API, and AI API user-assigned managed identities. Capacity and SKU are
environment settings; the resource name and ownership model remain consistent.
module "rome_apim" {
source = "<approved-api-management-module>"
resource_group_name = "rg-rome-${var.environment_short}-chn-01"
application_short = "rome"
instance_count = "02"
sku_name = var.apim_sku_name
user_assigned_msi_ids = [
azurerm_user_assigned_identity.apim.id,
azurerm_user_assigned_identity.internal_api.id,
azurerm_user_assigned_identity.ai_api.id,
]
}Do not use client secrets or certificates for APIM-to-Azure authentication.
Grant Key Vault and backend permissions
Owner: Platform and backend owners
Grant the primary APIM identity access to the Key Vault values required by APIM. Grant each APIM identity only the backend application roles and Azure permissions needed for its trust boundary. A backend owner must approve the principal and audience accepted by that backend.
Validate that removing the grant causes token acquisition or backend access to fail closed.
Create controlled named values
Owner: Platform team
The deployed named values (Verified in apim_named_values.tf) are:
| Named value | Purpose |
|---|---|
APIM-AZURE-AD-APPLICATION-ID | Backend audience for APIM UAMI tokens (Platform API) |
APIM-AZURE-AD-ISSUER-URL | Issuer base URL |
APIM-MSI-CLIENT-ID | Primary APIM UAMI selector |
APIM-ONTINUE-TENANT-ID | Ontinue tenant, which skips customer-tenant activation |
APIM-FRONT-DOOR-ID | ION’s Front Door ID, for X-Azure-FDID checks |
APIM-TENANT-VALIDATION-URL | Fixed base URL of the tenant-validation API |
APIM-TENANT-CACHE-DURATION | Tenant-status cache duration (1,800 seconds) |
APIM-INAPI-MSI-CLIENT-ID | Internal API UAMI selector |
APIM-AIAPI-MSI-CLIENT-ID | AI API UAMI selector |
Use Key Vault references for secret values:
resource "azurerm_api_management_named_value" "backend_audience" {
name = "APIM-BACKEND-AUDIENCE"
display_name = "APIM-BACKEND-AUDIENCE"
resource_group_name = var.resource_group_name
api_management_name = var.apim_name
secret = true
value_from_key_vault {
secret_id = azurerm_key_vault_secret.backend_audience.id
identity_client_id = azurerm_user_assigned_identity.apim.client_id
}
}Policy XML references a named value as {{APIM-FRONT-DOOR-ID}}; it does not
contain the environment value.
Install shared policy fragments
Owner: Platform team
Install request, response, and error fragments before the global policy that references them.
apim_policy_fragment = {
fragment-request-trace = "apim_policies/apim_policy_fragment_request_trace.xml"
fragment-response-trace = "apim_policies/apim_policy_fragment_response_trace.xml"
fragment-error-trace = "apim_policies/apim_policy_fragment_error_trace.xml"
}Fragments must follow the telemetry requirements in the APIM guidelines. The deployed request fragment logs full bodies and identity claims (gap APIM-03).
Install the environment global policy
Owner: Platform team
Apply the global policy only after APIM, identities, named values, and fragments exist. The policy must provide the same control behavior in every environment, while audiences and tenant settings remain environment-specific.
module "rome_apim_global_policy" {
depends_on = [module.rome_apim, module.policy_fragments]
source = "<approved-api-management-policy-module>"
api_management_id = module.rome_apim.apim_id
apim_policy = {
apim = "apim_policies/apim_global_policy_${var.environment_short}.xml"
}
}Validate XML compilation and denied requests before onboarding service APIs. The global policy implementation documents the execution order, environment differences, and open gaps.
Deploy public and authenticated health operations
Owner: Platform team
Import the platform health OpenAPI contract into product
apim-product-health-probes-internal-{env}-chn-01 (path health-probes-ext) and
bind each operationId to its policy:
get_healthcheckandhead_healthcheckreturn only synthetic gateway health and bypass global inbound policy;get_auth_healthcheckinherits the global policy and requires the approved health-read role.
A public health operation must not be reused as proof of backend readiness. When
the global X-Azure-FDID check (APIM-02) is introduced, only these two public
operations are exempt.
Configure capacity, diagnostics, and portal posture
Owner: Platform team
Configure autoscaling and operational alerts for the APIM tier. Basic portal authentication and delegation are disabled (Verified). ION does not depend on the developer portal for API publication or on subscription keys for caller security.
Declare diagnostic destinations, access, sampling, redaction, and retention as reproducible platform configuration. Notification destinations MUST be owned team channels. The deployed autoscale notification targets a personal mailbox (gap APIM-04).
Platform validation
For every environment, prove:
- missing and invalid caller tokens are denied;
- inactive customer tenants are denied;
- a valid caller and operation role reaches the intended API policy;
- a client-supplied
X-Authorizationdoes not reach the backend (fails until APIM-01 is fixed); - a request without a matching
X-Azure-FDIDis denied (fails until APIM-02 is fixed); - APIM can obtain the expected backend token;
- the backend rejects anonymous and unapproved direct calls;
- public and authenticated health operations have distinct behavior;
- policy fragments do not emit credentials or prohibited payloads; and
- scale and alert configuration target an owned operational channel.