Closed digiofficerobin closed 2 months ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
Addition. I've tried creating an Azure File Share with the ShareServiceClient as well, but I get the same exception.
var client = new ShareServiceClient(new Uri(url), new ClientSecretCredential(tenantid, clientid, clientsecret);
var options = new ShareCreateOptions();
options.AccessTier = ShareAccessTier.Hot;
client.CreateShare(name, options);
Error:
Azure.RequestFailedException: This API does not support bearer tokens. For OAuth, use the Storage Resource Provider APIs instead. Learn more: https://aka.ms/azurefiles/restapi.
RequestId:1d541d0c-801a-006f-15ac-bc4bea000000
Time:2024-06-12T09:43:22.7103886Z
Status: 409 (This API does not support bearer tokens. For OAuth, use the Storage Resource Provider APIs instead. Learn more: https://aka.ms/azurefiles/restapi.)
ErrorCode: FileOAuthManagementApiRestrictedToSrp
Hi, do you guys had time to look into this issue?
This is by-design, today the Files service does not support OAuth for all operations - https://learn.microsoft.com/en-us/rest/api/storageservices/authorize-with-azure-active-directory#permissions-for-file-service-operations
Assuming the feature does not get pulled at the last minute, we should be adding support for OAuth for all File operations in the next beta release of the SDK.
@seanmcc-msft Thanks, could you give the ID of the Pull Request so I can follow up this feature?
Library name and version
Azure.Storage.Files.Shares 12.18.0
Describe the bug
I am trying to create an Azure File Share in a backend application, but I get an exception about unsupported bearer tokens. This seems incorrect, because I can do other things, such as adding files and directories, or add Blob containers with the same kind of credentials.
Expected behavior
Azure File Share created, as described in the documentation: https://learn.microsoft.com/en-us/dotnet/api/azure.storage.files.shares.shareclient.createifnotexists?view=azure-dotnet
Actual behavior
I get the following message:
Azure.RequestFailedException: This API does not support bearer tokens. For OAuth, use the Storage Resource Provider APIs instead. Learn more: https://aka.ms/azurefiles/restapi.
Reproduction Steps
Environment
.NET Framework 4.8 / C#