Key Vault returns 401 with access token (MSI PowerShell Function App) Key Vault returns 401 with access token (MSI PowerShell Function App) powershell powershell

Key Vault returns 401 with access token (MSI PowerShell Function App)


Try changing the resource URI to https://vault.azure.net (with no trailing slash). The token validation on the server expects the exact same string as it returns in the 401 response's WWW-Authenticate header. In general, Key Vault returns 401 for cases where the token is missing or fails validation (three common cases are the token is expired, has an incorrect resource URI, or was issued by a different tenant than the vault is associated with).