Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cedricve opened this issue Mar 4, 2025 · 1 comment
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@cedricve
Copy link

cedricve commented Mar 4, 2025

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?

@andyzhangx
Copy link
Member

andyzhangx commented Mar 6, 2025

one of the 3 parameters is used together with AzureStorageAuthType: MSI parameter, like this:

kind: StorageClass
metadata:
  name: blob-fuse
provisioner: blob.csi.azure.com
parameters:
  skuName: Premium_LRS 
  protocol: fuse
  resourceGroup: EXISTING_RESOURCE_GROUP_NAME   # optional, node resource group by default if it's not provided
  storageAccount: EXISTING_STORAGE_ACCOUNT_NAME # optional, a new account will be created if it's not provided
  containerName: EXISTING_CONTAINER_NAME  # optional, a new container will be created if it's not provided
  AzureStorageAuthType: MSI
  AzureStorageIdentityClientID: "xxxxx-xxxx-xxx-xxx-xxxxxxx"

@andyzhangx andyzhangx added the kind/support Categorizes issue or PR as a support question. label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

2 participants