Skip to content

Commit

Permalink
Add breaking chang warnings for file track2 sdk migration (Azure#25879)
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanz7 authored Aug 20, 2024
1 parent 1670918 commit a6adc8e
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@
- `Set-AzStorageAccount`
* Updated list share output display format
- `Get-AzStorageShare`
* Added warnings for upcoming breaking changes in File cmdlets for removing references to "Microsoft.Azure.Storage.File"
- `Close-AzStorageFileHandle`
- `Get-AzStorageFile`
- `Get-AzStorageFileContent`
- `Get-AzStorageFileCopyState`
- `Get-AzStorageFileHandle`
- `Get-AzStorageShare`
- `New-AzStorageDirectory`
- `New-AzStorageFileSASToken`
- `New-AzStorageShare`
- `New-AzStorageShareSASToken`
- `Remove-AzStorageDirectory`
- `Remove-AzStorageFile`
- `Remove-AzStorageShare`
- `Set-AzStorageFileContent`
- `Set-AzStorageShareQuota`
- `Start-AzStorageFileCopy`
- `Stop-AzStorageFileCopy`

## Version 7.2.0
* Upgraded Microsoft.Azure.Storage.DataMovement to 2.0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using global::Azure.Storage.Files.Shares.Models;
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Storage.File;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel;
Expand Down Expand Up @@ -83,6 +84,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down Expand Up @@ -116,6 +118,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -136,6 +139,7 @@ public class CloseAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareDirectoryClient ShareDirectoryClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
5 changes: 5 additions & 0 deletions src/Storage/Storage/File/Cmdlet/GetAzureStorageFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using global::Azure.Storage.Files.Shares;
using global::Azure.Storage.Files.Shares.Models;
using Microsoft.Azure.Storage.File;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using System.Collections.Generic;
using System.Globalization;
using System.Management.Automation;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed. Use child property ShareFileClient instead.")]
[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileDirectory), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed. Use child property ShareDirectoryClient instead.")]
[Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFile", DefaultParameterSetName = Constants.ShareNameParameterSetName)]
[OutputType(typeof(AzureStorageFile))]
public class GetAzureStorageFile : AzureStorageFileCmdletBase
Expand All @@ -36,6 +39,7 @@ public class GetAzureStorageFile : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -56,6 +60,7 @@ public class GetAzureStorageFile : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
5 changes: 5 additions & 0 deletions src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using Microsoft.Azure.Documents.Partitioning;
using Microsoft.Azure.Storage.DataMovement;
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
Expand All @@ -34,6 +35,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using LocalDirectory = System.IO.Directory;
using LocalPath = System.IO.Path;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareFileClient instead.")]
[Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFileContent", SupportsShouldProcess = true, DefaultParameterSetName = LocalConstants.ShareNameParameterSetName)]
[OutputType(typeof(AzureStorageFile))]
public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, IDynamicParameters
Expand All @@ -46,6 +48,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -65,6 +68,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -85,6 +89,7 @@ public class GetAzureStorageFileContent : StorageFileDataManagementCmdletBase, I
[ValidateNotNull]
public ShareDirectoryClient ShareDirectoryClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class GetAzureStorageFileCopyStateCommand : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string FilePath { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")]
[Parameter(
Position = 0,
HelpMessage = "Target file instance", Mandatory = true,
Expand Down
4 changes: 4 additions & 0 deletions src/Storage/Storage/File/Cmdlet/GetAzureStorageFileHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using global::Azure.Storage.Files.Shares;
using global::Azure.Storage.Files.Shares.Models;
using Microsoft.Azure.Storage.File;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel;
Expand All @@ -37,6 +38,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -57,6 +59,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -77,6 +80,7 @@ public class GetAzureStorageFileHandle : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareDirectoryClient ShareDirectoryClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
6 changes: 4 additions & 2 deletions src/Storage/Storage/File/Cmdlet/GetAzureStorageShare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using global::Azure.Storage.Files.Shares.Models;
using global::Azure.Storage.Files.Shares;
using global::Azure;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed. Use child property ShareClient instead.")]
[Cmdlet("Get", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare", DefaultParameterSetName = Constants.MatchingPrefixParameterSetName)]
[OutputType(typeof(AzureStorageFileShare))]
public class GetAzureStorageShare : AzureStorageFileCmdletBase
Expand All @@ -50,8 +52,8 @@ public class GetAzureStorageShare : AzureStorageFileCmdletBase
Mandatory = false,
ParameterSetName = Constants.SpecificParameterSetName,
HelpMessage = "SnapshotTime of the file share snapshot to be received.")]
[ValidateNotNullOrEmpty]
public DateTimeOffset? SnapshotTime { get; set; }
[ValidateNotNullOrEmpty]
public DateTimeOffset? SnapshotTime { get; set; }

[Parameter(Mandatory = false,
HelpMessage = "Include deleted shares, by default get share won't include deleted shares",
Expand Down
4 changes: 4 additions & 0 deletions src/Storage/Storage/File/Cmdlet/NewAzureStorageDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
{
using global::Azure.Storage.Files.Shares;
using Microsoft.Azure.Storage.File;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using System.Globalization;
using System.Management.Automation;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed. Use child property ShareDirectoryClient instead.")]
[Cmdlet("New", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageDirectory", DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileDirectory))]
public class NewAzureStorageDirectory : AzureStorageFileCmdletBase
{
Expand All @@ -32,6 +34,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -52,6 +55,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class NewAzureStorageFileSasToken : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string Path { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and a new mandatory parameter ShareFileClient will be added.")]
[Parameter(Mandatory = true,
HelpMessage = "CloudFile instance to represent the file to get SAS token against.",
ValueFromPipeline = true,
Expand Down Expand Up @@ -113,6 +114,7 @@ public string Policy
[ValidateNotNullOrEmpty]
public string Permission { get; set; }

[CmdletParameterBreakingChangeWithVersion("Protocol", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter Protocol will be changed from SharedAccessProtocol to string.")]
[Parameter(Mandatory = false, HelpMessage = "Protocol can be used in the request with this SAS token.")]
[ValidateNotNull]
public SharedAccessProtocol? Protocol { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Storage/Storage/File/Cmdlet/NewAzureStorageShare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed. Use child property ShareClient instead.")]
[Cmdlet("New", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare", DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileShare))]
public class NewAzureStorageShare : AzureStorageFileCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public string Policy
[ValidateNotNullOrEmpty]
public string Permission { get; set; }

[CmdletParameterBreakingChangeWithVersion("Protocol", "13.0.0", "8.0.0", ChangeDescription = "The type of parameter Protocol will be changed from SharedAccessProtocol to string.")]
[Parameter(Mandatory = false, HelpMessage = "Protocol can be used in the request with this SAS token.")]
[ValidateNotNull]
public SharedAccessProtocol? Protocol { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
{
using global::Azure.Storage.Files.Shares;
using Microsoft.Azure.Storage.File;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel;
using Microsoft.WindowsAzure.Commands.Storage.Common;
using System.Globalization;
using System.Management.Automation;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileDirectory from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareDirectoryClient instead.")]
[Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageDirectory",SupportsShouldProcess = true,DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFileDirectory))]
public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase
{
Expand All @@ -32,6 +34,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -52,6 +55,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
4 changes: 4 additions & 0 deletions src/Storage/Storage/File/Cmdlet/RemoveAzureStorageFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using System.Globalization;
using System.Management.Automation;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFile), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFile from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareFileClient instead.")]
[Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageFile",SupportsShouldProcess = true,DefaultParameterSetName = Constants.ShareNameParameterSetName), OutputType(typeof(AzureStorageFile))]
public class RemoveAzureStorageFile : AzureStorageFileCmdletBase
{
Expand All @@ -33,6 +34,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -53,6 +55,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareClient ShareClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("Directory", "13.0.0", "8.0.0", ChangeDescription = "The parameter Directory will be deprecated, and ShareDirectoryClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand All @@ -73,6 +76,7 @@ public class RemoveAzureStorageFile : AzureStorageFileCmdletBase
[ValidateNotNull]
public ShareDirectoryClient ShareDirectoryClient { get; set; }

[CmdletParameterBreakingChangeWithVersion("File", "13.0.0", "8.0.0", ChangeDescription = "The parameter File will be deprecated, and ShareFileClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
2 changes: 2 additions & 0 deletions src/Storage/Storage/File/Cmdlet/RemoveAzureStorageShare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
using global::Azure.Storage.Files.Shares.Models;
using System;

[CmdletOutputBreakingChangeWithVersion(typeof(AzureStorageFileShare), "13.0.0", "8.0.0", ChangeDescription = "The child property CloudFileShare from deprecated v11 SDK will be removed when -PassThru is specified. Use child property ShareClient instead.")]
[Cmdlet("Remove", Azure.Commands.ResourceManager.Common.AzureRMConstants.AzurePrefix + "StorageShare",DefaultParameterSetName = Constants.ShareNameParameterSetName,SupportsShouldProcess = true), OutputType(typeof(AzureStorageFileShare))]
public class RemoveAzureStorageShare : AzureStorageFileCmdletBase
{
Expand All @@ -38,6 +39,7 @@ public class RemoveAzureStorageShare : AzureStorageFileCmdletBase
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[CmdletParameterBreakingChangeWithVersion("Share", "13.0.0", "8.0.0", ChangeDescription = "The parameter Share will be deprecated, and ShareClient will be mandatory.")]
[Parameter(
Position = 0,
Mandatory = true,
Expand Down
Loading

0 comments on commit a6adc8e

Please sign in to comment.