Originally published on KBY Technologies .
If you ship code to Azure virtual machines that fetch tokens from the Instance Metadata Service, this is a trap that hits you the day someone else attaches a second user-assigned managed identity to the same VM. We cover which of your apps and scripts are exposed, the read-only commands that show it, and how to fix it without adding a system-assigned identity or a client secret.
Symptom
An application on an Azure virtual machine that has read from Key Vault or Storage for months stops getting tokens. The change that day was routine: someone attached a second user-assigned managed identity to the VM so another workload could use it. The first identity and its role assignments are untouched. The application never said which identity it wanted, and with one user-assigned identity it didn’t have to. With two, the Instance Metadata Service (IMDS) has to be told which one to use, so the token request fails.…