Skip to content

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

@blueww

Description

@blueww

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions