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

Azure File Share not supported with TokenCredential - still not working in latest version #42121

Open
ihudedi opened this issue Sep 29, 2024 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@ihudedi
Copy link

ihudedi commented Sep 29, 2024

@ibrahimrabab @ibrandes @kyleknap @seanmcc-msft
I am using latest version (beta) 12.24.0-beta.1 and still can't access with tokenCredentials and the error is
com.azure.storage.file.share.models.ShareStorageException: If you are using a StorageSharedKeyCredential, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate method call.
If you are using a SAS token, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.
Please remember to disable 'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.
Status code 403, "?AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.
RequestId:68054700-301a-0073-7523-081394000000
Time:2024-09-16T10:28:15.6744835Z"
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source) ~[?:?]
at com.azure.core.implementation.MethodHandleReflectiveInvoker.invokeStatic(MethodHandleReflectiveInvoker.java:26) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:53) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:407) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.SyncRestProxy.ensureExpectedStatus(SyncRestProxy.java:133) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.SyncRestProxy.handleRestReturnType(SyncRestProxy.java:211) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.SyncRestProxy.invoke(SyncRestProxy.java:86) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.implementation.http.rest.RestProxyBase.invoke(RestProxyBase.java:124) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.http.rest.RestProxy.invoke(RestProxy.java:95) ~[azure-core-1.51.0.jar!/:1.51.0]
at jdk.proxy2/jdk.proxy2.$Proxy68.listSharesSegmentNoCustomHeadersSync(Unknown Source) ~[?:?]
at com.azure.storage.file.share.implementation.ServicesImpl.listSharesSegmentNoCustomHeadersSinglePage(ServicesImpl.java:1078) ~[azure-storage-file-share-12.24.0-beta.1.jar!/:12.24.0-beta.1]
at com.azure.storage.file.share.ShareServiceClient.lambda$listShares$0(ShareServiceClient.java:226) ~[azure-storage-file-share-12.24.0-beta.1.jar!/:12.24.0-beta.1]
at com.azure.storage.file.share.ShareServiceClient.lambda$listShares$1(ShareServiceClient.java:232) ~[azure-storage-file-share-12.24.0-beta.1.jar!/:12.24.0-beta.1]
at com.azure.storage.file.share.ShareServiceClient.lambda$listShares$2(ShareServiceClient.java:245) ~[azure-storage-file-share-12.24.0-beta.1.jar!/:12.24.0-beta.1]
at com.azure.core.http.rest.PagedIterable.lambda$new$5(PagedIterable.java:193) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.util.paging.ContinuablePagedByIteratorBase.requestPage(ContinuablePagedByIteratorBase.java:104) ~[azure-core-1.51.0.jar!/:1.51.0]
at com.azure.core.util.paging.ContinuablePagedByItemIterable$ContinuablePagedByItemIterator.(ContinuablePagedByItemIterable.java:83) ~[azure-core-1.51.0.jar!/:1.51.0]

I added all permission of fileshare and still same issue.
Storage File Data Privileged Contributor
Storage File Data Privileged Reader
Storage File Data SMB Share Contributor
Storage File Data SMB Share Elevated Contributor
Storage File Data SMB Share Reader

Could you please let me know what is missing.
Thanks,
Itay

Originally posted by @ihudedi in #41633 (comment)

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files) labels Sep 29, 2024
Copy link

Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@ibrahimrabab
Copy link
Contributor

Hi @ihudedi
Thanks for reaching out! If you're adding all the necessary permissions needed, then the listShares() API should work just fine. Is it just the listShares() API that is giving the 403 error for you or all service calls?

@ihudedi
Copy link
Author

ihudedi commented Oct 6, 2024

Hi @ibrahimrabab
Any service return permission issue
Thanks,
Itay

@paul-gardiner
Copy link

Any update on this? I am getting the same error when using ClientSecretCredential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants