A risk-scoring agent runs on Azure Container Apps in three environments: development, test, and production. It calls two partner services: a credit-bureau API and a fraud-check API. Neither partner supports Microsoft Entra ID or OAuth. Both accept only API keys, and both require keys to be rotated manually through the partner's portal.
Your authentication design must meet these requirements:
- No key may appear in environment variables, container images, configuration files, or source code.
- If one key is compromised, the exposure must be limited to one environment and one partner service.
- The rotation schedule must meet the minimum frequency recommended for manually rotated keys.
Which authentication design should you use?
Because neither partner supports Entra ID or OAuth, key-based fallback is the only usable flow. It is acceptable only with three disciplines together: keys kept only in Key Vault and read at startup through managed identity, a separate key per environment and per downstream service, and manual rotation at least quarterly. Each wrong option meets most of these but fails one: a shared key, environment-variable storage, an annual schedule, or a flow the partners don't support.
- Not correct: Remove the keys and authenticate to both partner APIs by using a token for the agent's managed identity. Managed identity relies on Entra ID tokens. Key-based fallback is the only option for partner APIs that don't support Entra ID.
- Not correct: Store a separate key per environment and per partner in Azure Key Vault, read it at startup by using managed identity, and rotate it every 12 months. Storage and isolation are correct, but manually rotated keys need rotation at least quarterly. An annual schedule falls short of that minimum.
- Not correct: Store a separate key per environment and per partner as Container Apps environment variables, and rotate it every 90 days. Keys for key-based fallback must be stored only in Azure Key Vault, never in environment variables, even when they are isolated per environment and rotated quarterly.
- Not correct: Store one key per partner in Azure Key Vault, share it across all three environments, read it by using managed identity, and rotate it every 90 days. Keys should be separate per environment and per downstream service so that a breach affects only one of each. A key shared across environments exposes all three if it is compromised.
- Correct: Store a separate key per environment and per partner in Azure Key Vault, read it at startup by using managed identity, and rotate it every 90 days. This meets every requirement. Keys are held only in Key Vault and read through managed identity, each key covers one environment and one service, and a 90-day rotation meets the quarterly minimum for manually rotated keys.