Entra ID OAuth2 Token signature failure when listing container
I am trying to use REST & Entra ID token for a user managed identity to list containers and read them for a blob. While I was able to get a token and list the storage account ok like this:
Invoke-WebRequest -Uri (-join ('https://management.azure.com/subscriptions/"subscription_id"/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01')) -Method GET -Headers @{ Authorization ="Bearer $Token"}
while using same method for container list and read will respond that the Bearer $Token is not supported and signature is incorrectly formed.
Invoke-WebRequest -Uri "https://"storage_account_name".blob.core.windows.net/"container_name"?restype=container&comp=list" -Headers @{ Authorization ="Bearer $Token"}
Invoke-WebRequest:
AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:1dafc7a3-301e-006f-6b25-82ece9000000
Time:2025-02-18T16:54:20.4625718ZAuthentication scheme Bearer is not supported in this version.
Can I use Entra ID Token to list the containers with REST API ? I did a lot of searching and can't find a functional example.
Azure CLI works for same user managed identity...
Thank you for your help.
C.