Your deployed Python function reads DB_PASSWORD with os.getenv and receives the real password. On your laptop, func start hands the same code @Microsoft.KeyVault(...) instead. Nothing in the function changed, so the difference is in who resolves the reference: the Azure platform in production, and the local Functions host during development.
This guide explains how platform resolution works, how to configure identity and least-privilege access, why local resolution fails, and how to choose a local strategy that does not tempt you to paste production secrets into local.settings.json .
Table of Contents
How Azure resolves a Key Vault reference
Configure identity, access, and the reference
Why local resolution fails (and how to diagnose it)
Choose a local development strategy
A resolver that works in both environments
Rotate and verify without leaking secrets
Conclusion
How Azure resolves a Key Vault reference
A Key Vault reference is an app setting whose value is an instruction, not a secret.…