Azure Managed Identity token with cURL

To test Managed Identity is working fine, SSH inside the VM with Managed Identity enabled (or RDP, for that matter) and cURL an access token for some resource.

curl "" -H Metadata:true -s

resource query parameter, as per documentation:

“A query string parameter, indicating the App ID URI of the target resource. It also appears in the aud (audience) claim of the issued token. This example requests a token to access Azure Resource Manager, which has an App ID URI of"

E.g., to request a token for a storage account:

curl '' -H Metadata:true

Oficial documentation here