Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<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" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- Additional information about change #1
-->
## Upcoming Release
* Added a warning message for an upcoming breaking change when getting a single blob
- `Get-AzStorageBlob`
* Fixed the issue of listing blobs with leading slashes
- `Get-AzStorageBlob`
* Added warning messages for an upcoming cmdlet breaking change
- `New-AzStorageAccount`
- `Set-AzStorageAccount`
Expand Down
4 changes: 3 additions & 1 deletion src/Storage/Storage/Blob/Cmdlet/GetAzureStorageBlob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class GetAzureStorageBlobCommand : StorageCloudBlobCmdletBase
/// </summary>
private const string SingleBlobVersionIDParameterSet = "SingleBlobVersionID";

[CmdletParameterBreakingChange("Blob", ChangeDescription = "Leading and trailing slashes will not be trimmed in a future release.")]
[Parameter(Position = 0, HelpMessage = "Blob name", ParameterSetName = NameParameterSet)]
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Blob name", ParameterSetName = SingleBlobSnapshotTimeParameterSet)]
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Blob name", ParameterSetName = SingleBlobVersionIDParameterSet)]
Expand Down Expand Up @@ -329,6 +330,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 +389,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.GetTrack2BlobClient(track2container, blobItem.Name, context, blobItem.VersionId, blobItem.IsLatestVersion, blobItem.Snapshot, options, blobItem.Properties.BlobType, shouldTrimSlash: false);
AzureStorageBlob outputblob = new AzureStorageBlob(blobClient, context, options, blobItem);
if (!string.IsNullOrEmpty(continuationToken))
{
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Storage/Common/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,10 @@ public static Hashtable GetHashtableFromDictionary(IDictionary<string, string> d
}
}

public static BlobBaseClient GetTrack2BlobClient(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)
public static BlobBaseClient GetTrack2BlobClient(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, bool shouldTrimSlash = true)
{
//Get Track2 Blob Client Uri
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(track2container.Uri)
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(track2container.Uri, trimBlobNameSlashes: shouldTrimSlash)
{
BlobName = blobName
};
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