App Service Authentication
Every ION Function App and App Service enables App Service authentication
(Easy Auth) against the ION Platform API app
(azsp-ontinue-rome-idm-ion-platform-{env}-01, “Platform API Application”).
Easy Auth is a confidential client of that app. Instead of a per-service client
secret, it presents a token from the shared rome auth identity UAMI as a
client assertion, using the
managed identity instead of a secret
App Service capability.
Why one shared identity
An Entra application accepts at most 20 Federated Identity Credentials. More than 20 services authenticate to the ION Platform API app, so one FIC per service UAMI is not possible. One shared rome auth identity, registered once as an FIC on the Platform API app, serves every service.
Prerequisites
- The service’s own UAMI is provisioned and attached (Managed identity).
- The rome auth identity exists in the environment and region:
id-auth-{env_short}-{reg_short}-01inrg-rome-{env_short}-{reg_short}-01. - The rome auth identity is registered as a Federated Identity Credential on the ION Platform API app for that environment and region.
- The Platform API app client ID, tenant, and allowed audiences are available as pipeline variables.
- APIM routes to the service authenticate with APIM’s own managed identity for the Platform API audience.
Request flow
Easy Auth validates the bearer token presented by APIM against the Platform API
audience. Whenever Easy Auth must authenticate as the Platform API app, it
uses the rome auth identity’s token as the client assertion instead of reading a
secret. The user or calling workload token arrives only as validated caller
context in X-Authorization. APIM must override that header; until gap
APIM-01
is fixed, validate any X-Authorization token before using it.
Configure a service
Register the rome auth identity on the Platform API app
Owner: Platform identity
Performed once per environment and region, not per service. Add a Federated Identity Credential to the ION Platform API app:
| Field | Value |
|---|---|
| Issuer | https://login.microsoftonline.com/{ontinueTenantId}/v2.0 |
| Subject | Principal (object) ID of id-auth-{env_short}-{reg_short}-01 |
| Audience | api://AzureADTokenExchange |
| Name | fic-rome-auth-{env_short}-{reg_short} |
Confirm the identity has no Azure role assignments and no application-role assignments. Record the FIC in the Platform API app’s FIC inventory.
Reference the rome auth identity
Owner: Service team
data "azurerm_user_assigned_identity" "RomeAuthIdentity" {
name = "id-auth-${var.env_short}-${var.reg_short}-01"
resource_group_name = "rg-rome-${var.env_short}-${var.reg_short}-01"
}Configure Easy Auth, the app setting, and the identities
Owner: Service team
Set client_secret_setting_name to OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID
(the default in the shared auth_settings variable), set the app setting of
that name to the rome auth identity’s client ID, and attach both the service’s
own UAMI and the rome auth identity. Apply the same configuration to every
deployment slot.
variable "auth_settings" {
type = object({
client_id = string # ION Platform API app (client) ID
tenant_id = string
client_secret_setting_name = optional(string, "OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID")
allowed_audiences = list(string)
token_store_enabled = optional(bool, true)
})
}
locals {
func_shared_appsettings = {
ManagedIdentityClientId = azurerm_user_assigned_identity.UserIdentity.client_id
# Use Federated Credentials
OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID = data.azurerm_user_assigned_identity.RomeAuthIdentity.client_id
}
}
resource "azurerm_windows_function_app" "FunctionApp" {
# ...
identity {
type = "UserAssigned"
identity_ids = [
azurerm_user_assigned_identity.UserIdentity.id, # the service's own UAMI
data.azurerm_user_assigned_identity.RomeAuthIdentity.id # Easy Auth client assertion only
]
}
key_vault_reference_identity_id = azurerm_user_assigned_identity.UserIdentity.id
app_settings = local.func_shared_appsettings
auth_settings_v2 {
auth_enabled = true
require_authentication = true
require_https = true
default_provider = "AzureActiveDirectory"
active_directory_v2 {
client_id = var.auth_settings.client_id
client_secret_setting_name = var.auth_settings.client_secret_setting_name
tenant_auth_endpoint = "https://sts.windows.net/${var.auth_settings.tenant_id}/v2.0"
allowed_audiences = var.auth_settings.allowed_audiences
}
login {
token_store_enabled = var.auth_settings.token_store_enabled
}
}
}Keep key_vault_reference_identity_id and every __clientId binding on the
service’s own UAMI. allowed_audiences contains only the ION Platform API
audience.
Deploy and verify
Owner: Service team
Deploy through Runway. Confirm in the deployed configuration that:
client_secret_setting_nameisOVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID;- the
OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTIDapp setting holds the rome auth identity’s client ID; identity_idscontains both the service’s own UAMI and the rome auth identity, on the app and every slot;- no
MICROSOFT_PROVIDER_AUTHENTICATION_SECRETorKEYVAULT_SECRET_AUTH_SECRET_NAMEsetting remains; and - the production slot and the deploy slot match.
Then run the validation below.
Positive validation
- A request through APIM reaches the function and returns the expected result.
- Easy Auth logs show the authenticated Platform API audience and no client-secret lookup.
- After a slot swap or restart, authentication still succeeds.
- The rome auth identity still has zero Azure role assignments and zero
Ion.*application-role assignments.
Negative validation
- A request sent directly to the function host without a token returns 401 or a redirect, never function output.
- A token for any audience other than the ION Platform API app is rejected.
- A token issued by a customer tenant is rejected.
- Application code that selects the rome auth identity cannot reach any Azure resource or ION API.
- With the app setting removed in a non-production slot, Easy Auth fails closed rather than falling back to a secret.
Migrate from the Key Vault Easy Auth secret
Some services still configure Easy Auth with a client secret on the ION Platform
API app, stored in Key Vault and surfaced through
MICROSOFT_PROVIDER_AUTHENTICATION_SECRET or a
KEYVAULT_SECRET_AUTH_SECRET_NAME setting. Migrate each one:
Confirm the prerequisites
Owner: Service team
Confirm the rome auth identity FIC exists for the environment and region, and
identify the service’s Platform API client secret (its Key Vault secret name and
the matching credential on the Platform API app). If the service already sets
OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID, check that identity_ids also
attaches the rome auth identity; if it does not, the migration is incomplete.
Switch the setting
Owner: Service team
Apply steps 2 and 3 above: attach the rome auth identity, set
client_secret_setting_name = "OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID", and add
the OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID app setting. In the same change
remove MICROSOFT_PROVIDER_AUTHENTICATION_SECRET,
KEYVAULT_SECRET_AUTH_SECRET_NAME, and any Key Vault reference to the secret,
on every slot. Deploy to a lower environment first.
Verify
Owner: Service team
Run the positive and negative validation in each environment. Watch authentication failures for one full token lifetime after the production deployment.
Remove the secret
Owner: Platform identity
After verification, delete the service’s secret from Key Vault and delete the corresponding client secret on the ION Platform API app. Confirm no other service referenced it, and remove the secret from SRE expiry monitoring.
If verification fails, redeploy the previous revision; the secret remains valid until step 4, so rollback needs no new credential.
Revocation
- One service: remove Easy Auth configuration or the route in APIM, or stop the host. Do not detach the rome auth identity from one service as a containment measure without also disabling its route, because Easy Auth then fails closed for that service only.
- Suspected misuse of the rome auth identity: remove its FIC from the ION Platform API app. This stops Easy Auth confidential-client operations for every service in that environment and region, so coordinate through incident response and restore with a new identity and FIC.
- Confirm the rome auth identity has no role assignments after any incident; any assignment found is itself an incident.