Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Storage/Storage/Blob/Cmdlet/GetAzureStorageBlob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ internal async Task ListBlobsByPrefix(long taskId, IStorageBlobManagement localC
{
if (blobFilter == null || blobFilter(item.Name))
{
ClientOptions.TrimBlobNameSlashes = false;
Comment thread
yifanz0 marked this conversation as resolved.
OutputStream.WriteObject(taskId, GetAzureStorageBlob(item, track2container, localChannel.StorageContext, page.ContinuationToken, ClientOptions));
}
realListCount++;
Expand Down Expand Up @@ -387,7 +388,7 @@ internal async Task ListBlobsByPrefix(long taskId, IStorageBlobManagement localC

public static AzureStorageBlob GetAzureStorageBlob(BlobItem blobItem, BlobContainerClient track2container, AzureStorageContext context, string continuationToken = null, BlobClientOptions options = null)
{
BlobBaseClient blobClient = Util.GetTrack2BlobClient(track2container, blobItem.Name, context, blobItem.VersionId, blobItem.IsLatestVersion, blobItem.Snapshot, options, blobItem.Properties.BlobType);
BlobBaseClient blobClient = Util.GetTrack2BlobClientNoSlashTrim(track2container, blobItem.Name, context, blobItem.VersionId, blobItem.IsLatestVersion, blobItem.Snapshot, options, blobItem.Properties.BlobType);
AzureStorageBlob outputblob = new AzureStorageBlob(blobClient, context, options, blobItem);
if (!string.IsNullOrEmpty(continuationToken))
{
Expand Down
19 changes: 19 additions & 0 deletions src/Storage/Storage/Common/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,25 @@ public static BlobBaseClient GetTrack2BlobClient(BlobContainerClient track2conta
return GetTrack2BlobClient(blobUriBuilder.ToUri(), context, options, blobType);
}

public static BlobBaseClient GetTrack2BlobClientNoSlashTrim(BlobContainerClient track2container, string blobName, AzureStorageContext context, string versionId = null, bool? IsCurrentVersion = null, string snapshot = null, BlobClientOptions options = null, global::Azure.Storage.Blobs.Models.BlobType? blobType = null)
{
//Get Track2 Blob Client Uri
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(track2container.Uri, false)
Comment thread
yifanz0 marked this conversation as resolved.
Outdated
{
BlobName = blobName
};
if (versionId != null && (IsCurrentVersion == null || !IsCurrentVersion.Value)) // only none current version blob need versionId in Uri
{
blobUriBuilder.VersionId = versionId;
}
if (snapshot != null)
{
blobUriBuilder.Snapshot = snapshot;
}

return GetTrack2BlobClient(blobUriBuilder.ToUri(), context, options, blobType);
}

public static BlobBaseClient GetTrack2BlobClient(Uri blobUri, AzureStorageContext context, BlobClientOptions options = null, global::Azure.Storage.Blobs.Models.BlobType? blobType = null)
{
BlobBaseClient blobClient;
Expand Down
8 changes: 4 additions & 4 deletions src/Storage/Storage/Storage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.2.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.14.0" />
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.12.0" />
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.12.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.12.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.15.0" />
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.13.0" />
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.13.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.13.0" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.2.2" />
Expand Down