A financial services company deploys an internal application that calls a Foundry-hosted model from an Azure Function running in the same tenant. Their security team is concerned about API keys being accidentally committed to source control or leaked in logs. What authentication approach should they use for the Azure Function to call the Foundry endpoint?
Select an answer to reveal the explanation.
Short Explanation
The real fix here is to stop having a secret to leak in the first place. Give the Azure Function its own identity in Microsoft Entra ID and let the Foundry endpoint trust that identity directly — there is no key sitting in code or a config file waiting to be accidentally checked into source control or printed into a log. Hardcoding the key into the app is precisely the habit causing the worry, just formalized. Rotating the key every day shrinks the window a leaked key stays useful, but you are still juggling a secret that has to live somewhere and can still leak the moment it is generated. And turning off content filtering does nothing for authentication at all — it just removes a safety check on responses while the actual credential problem sits untouched.
Full Explanation
The correct answer is B. Assigning the Azure Function a managed identity lets it authenticate to the Foundry endpoint through Microsoft Entra ID without any secret ever being stored in code, configuration, or logs, directly removing the leak risk the security team raised. Option A is incorrect because hardcoding the API key in the application source is the exact practice that creates the risk of the key being committed to source control or exposed in logs. Option C is incorrect because rotating the key daily reduces how long a leaked key stays valid, but the key still exists as a secret that must be stored and transmitted somewhere, so it does not remove the underlying leak risk the way eliminating the key does. Option D is incorrect because disabling content filtering has nothing to do with authentication; it would only remove a safety control on the model's output while leaving the original credential-management problem completely unaddressed.