Skip to content

Cannot mount with AzureStorageIdentityClientID, but does work with clientID #1857

@cedricve

Description

@cedricve

Thanks for your great work here @andyzhangx. We have been using Workload Identity in our AKS cluster. The mounting using the clientID does work properly.

csi:
  driver: blob.csi.azure.com
  volumeHandle: pv-xxx
  volumeAttributes:
    resourceGroup: rsg-xxx
    storageAccount: xxxx
    containerName: nokey
    protocol: fuse
    clientID: "xxx-xxx-xxx-xxx-xxx"

However when using the AzureStorageIdentity and more in particular following CSI parameters:

  • AzureStorageIdentityClientID
  • AzureStorageIdentityObjectID
  • AzureStorageIdentityResourceID

Using following config:

csi:
  driver: blob.csi.azure.com
  volumeHandle: pv-xxx-xxx
  volumeAttributes:
    resourceGroup: rsg-xxx-xxx-d-xxx
    storageAccount: xxx
    containerName: nokey
    protocol: fuse
    AzureStorageIdentityResourceID : "/subscriptions/xxx-xxx-xxx-xxx-xxxx/resourceGroups/rsg-xxx-xxx-d-xxxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mid-xxx-xxx-d-xxx-xxx"

We get following error:

88s         Warning   FailedMount         pod/xxx-xxx-xxx    MountVolume.MountDevice failed for volume "pv-xxx" : rpc error: code = Internal desc = no key for storage account(xxx) under resource group(rsg-xxx-xxx-d-xxx), err Retriable: false, RetryAfter: 0s, HTTPStatusCode: 403, RawError: {"error":{"code":"AuthorizationFailed","message":"The client 'xxx-xxx-xxx-xxx-xxx' with object id 'xxx-xxx-xxx-xxx-xxx' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/xxx-xxx-xxx-xxx-xxx/resourceGroups/rsg-xxx-xxx-d-xxx/providers/Microsoft.Storage/storageAccounts/xxx' or the scope is invalid. If access was recently granted, please refresh your credentials."}}

It looks like it's ignoring the AzureStorageIdentityResourceID, and skilling the workload identity when not using the client_id directly. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as a support question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions