Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k stars 4.82k forks source link

[BUG] For ShareFileClient point to an Azure File which need allow trailing dot, ShareFileClient.Rename() and ShareFileClient.StartCopy() use different ShareClientOptions #37650

Open blueww opened 1 year ago

blueww commented 1 year ago

Library name and version

Azure.Storage.Files.Shares 12.14.0

Describe the bug

For ShareFileClient point to an Azure File which need allow trailing dot, when call different API, need use different client options. Like : ShareFileClient.Rename(): need set AllowSourceTrailingDot to true. ShareFileClient.GetProperties(): need set AllowTrailingDot to true. ShareFileClient.StartCopy(): need set AllowTrailingDot to true.

However, since Client option is set when create the ShareFileClient object, and it looks can't change the Client option on an existing ShareFileClient, this makes the user very difficult to use same ShareFileClient to handle different API on same Azure file object.

Expected behavior

User should can use same ShareFileClient to handle different API on same Azure file object, when the Azure file object need allow trailing dot. (But the rename dest, or copy source doesn't need allow trailing dot.)

We should either allow update the Client option on an existing ShareFileClient, or allow user to input AllowSourceTrailingDot /AllowTrailingDot in ShareFileClient.Rename() API parameter to overwrite the setting in Client Option.

Actual behavior

User can't use same ShareFileClient to handle different API on same Azure file object, when the Azure file object need allow trailing dot. (But the rename dest, or copy source doesn't need allow trailing dot.)

Reproduction Steps

See above.

Environment

dotnet --info .NET SDK: Version: 7.0.306 Commit: f500069cb7

Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.306\

Host: Version: 7.0.9 Architecture: x64 Commit: 8e9a17b221

.NET SDKs installed: 3.1.426 [C:\Program Files\dotnet\sdk] 6.0.120 [C:\Program Files\dotnet\sdk] 6.0.315 [C:\Program Files\dotnet\sdk] 7.0.203 [C:\Program Files\dotnet\sdk] 7.0.306 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

github-actions[bot] commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

navba-MSFT commented 1 year ago

Adding Service team to look into this

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.