You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the upcoming release in November, references of v11 SDK "Microsoft.Azure.Storage.File" will be removed from File cmdlets. v12 SDK Azure.Storage.Files.Shares will be used instead. This will bring some breaking changes to the File cmdlets as a result and customers will need to update to use v12 SDK APIs instead.
Currently we have released a preview Az.Storage module (Az.Storage 7.4.1-preview) that contains all the upcoming changes that customers can download and give it a try.
Upcoming Breaking Changes
v11 SDK objects will be removed from outputs of File cmdlets. Customers will need to use v12 objects in the outputs instead in order to access .NET SDK methods. Using .NET SDK APIs with v11 objects will result in the exception of You cannot call a method on a null-valued expression.
CloudFileShare will be removed from outputs of the following cmdlets: Get-AzStorageFile, New-AzStorageShare, Get-AzStorageShare, Remove-AzStorageShare, New-AzStorageDirectory, Remove-AzStorageDirectory. Customers should use child property ShareClient instead. Some samples of the original and updated usages:
Original usages with v11 SDK:
# Retrieve a specific share $share=Get-AzStorageShare-Name $shareName-Context $ctx# Create a snapshot of the share $share.CloudFileShare.Snapshot()
Updated usages with v12 SDK:
# Retrieve a specific share $share=Get-AzStorageShare-Name $shareName-Context $ctx# Create a snapshot of the share $share.ShareClient.CreateSnapshot()
CloudFileDirectory will be removed from outputs of the following cmdlets: Get-AzStorageFile, New-AzStorageDirectory, Remove-AzStorageDirectory. Customers should use child property ShareDirectoryClient instead. Some samples of the original and updated usages:
Original usages with v11 SDK:
$dir=New-AzStorageDirectory-ShareName testshare1 -Path -Context
# Check if the directory exists $dir.CloudDirectory.Exists()
Updated usages with v12 SDK:
$dir=New-AzStorageDirectory-ShareName testshare1 -Path -Context
# Check if the directory exists $dir.ShareDirectoryClient.Exists()
CloudFile will be removed from outputs of the following cmdlets: Get-AzStorageFile. Customers should use child property ShareFileClient instead. Some samples of the original and updated usages:
Original usages with v11 SDK:
$file=Get-AzStorageFile-Share $sharename-Path $filepath-Context $ctx# Set metadata of a file $file.CloudFile.SetMetadata(...)
Updated usages with v12 SDK:
$file=Get-AzStorageFile-Share $sharename-Path $filepath-Context $ctx# Set metadata of a file $file.ShareFileClient.SetMetadata(...)
v11 SDK objects will be removed from inputs of File cmdlets. For cmdlets that accept objects as input parameters, v12 SDK should be used and will be mandatory. If customers pipe in the objects, the usages will not change. However, for those who input the v11 objects directly in the cmdlets, v12 objects should be used instead.
The parameter Share (alias CloudFileShare) will be deprecated in the following cmdlets: Close-AzStorageFileHandle, Get-AzStorageFile, Get-AzStorageFileContent, Get-AzStorageFileHandle, Get-AzStorageShareStoredAccessPolicy, New-AzStorageDirectory, New-AzStorageFileSASToken, New-AzStorageShareStoredAccessPolicy, Remove-AzStorageDirectory, Remove-AzStorageFile, Remove-AzStorageShare, Set-AzStorageFileContent, Set-AzStorageShareQuota, Set-AzStorageShareStoredAccessPolicy, Start-AzStorageFileCopy. Parameter ShareClient should be used instead. Inputting Share parameter with v11 SDK object CloudFileShare will result in the exception of Parameter cannot be processed because the parameter name 'Share' is ambiguous. Some samples of the original and updated usages:
Original usages with v11 SDK:
$share=Get-AzStorageShare-Name $shareName-Context $ctx# Close file handle Close-AzStorageFileHandle-Share $share.CloudFileShare-Path $path-CloseAll
# Get a specific file with a share client Get-AzStorageFile-Share $share.CloudFileShare-Path $filepath-Context $ctx# List files under a directory client
Updated usages with v12 SDK:
$share=Get-AzStorageShare-Name $shareName-Context $ctx# Close file handleClose-AzStorageFileHandle-ShareClient $share.ShareClient-Path $path-CloseAll
# Get a specific file with a share client Get-AzStorageFile-ShareClient $share.ShareClient-Path $filepath-Context $ctx
The parameter Directory (alias CloudFileDirectory) will be deprecated in the following cmdlets: Close-AzStorageFileHandle, Get-AzStorageFile, Get-AzStorageFileContent, Get-AzStorageFileHandle, New-AzStorageDirectory, Remove-AzStorageDirectory, Remove-AzStorageFile, Set-AzStorageFileContent. Parameter ShareDirectory should be used and will be required. Some samples of the original and updated usages:
Original usages with v11 SDK:
# List files under a directory client $dir=Get-AzStorageFile-ShareName $sharename-Path $dirname-Context $ctxGet-AzStorageFile-Directory $dir.CloudFileDirectory-Context $ctx
Updated usages with v12 SDK:
# List files under a directory client $dir=Get-AzStorageFile-ShareName $sharename-Path $dirname-Context $ctxGet-AzStorageFile-ShareDirectoryClient $dir.ShareDirectoryClient-Context $ctx
The parameter File (alias CloudFile) will be deprecated in the following cmdlets: Get-AzStorageFileContent, Get-AzStorageFileHandle, New-AzStorageFileSASToken, Stop-AzStorageFileCopy. Parameter ShareFileClient shuold be used and will be required. Some sample of the original and updated usages:
Original usages with v11 SDK:
Updated usages with v12 SDK:
For cmdlet Start-AzStorageFileCopy, there will be two major changes:
The type of SrcFile and DestFile will be changed from CloudFile to ShareFileClient. Inputting an object of type CloudFile will result in the exception of Cannot bind parameter 'SrcFile'. Cannot convert the "Microsoft.Azure.Storage.File.CloudFile" value of type "Microsoft.Azure.Storage.File.CloudFile" to type "Azure.Storage.Files.Shares.ShareFileClient".
For paremeter SrcFile, parameter CloudFile will be deprecated. Using the deprecated parameter will result in the exception of A parameter cannot be found that matches parameter name 'CloudFile'.
the parameter DestContext will be required when copying from file object or blob object to a destination file object. Copying without specifying the destination context will result in the exception of Start-AzStorageFileCopy : Could not get the destination storage context. Please pass in a storage context with /"-DestContext/" parameter (can be created with New-AzStorageContext cmdlet).
For the changes mentioned above, here are some samples of the original and updates usages:
Original usages with v11 SDK:
# Copy from a source file to a destination file $file=Get-AzStorageFile-ShareName $sharename-Path $srcfilepath-Context $ctx1$destFile=Get-AzStorageFile-ShareName $sharename-Path $destfilepath-Context $ctx2Start-AzStorageFileCopy-SrcFile $file.CloudFile-DestFile $destFile.CloudFile# Copy from a source blob to a destination file $blob=Get-AzStorageBlob-Blob $blobname-Container $containername-Context $ctx1$destFile=Get-AzStorageFile-ShareName $sharename-Path $destfilepath-Context $ctx2Start-AzStorageFileCopy-SrcBlob $blob.ICloudBlob-DestFile $destFile.CloudFile
Updated usages with v12 SDK:
# Copy from a source file to a destination file $file=Get-AzStorageFile-ShareName $sharename1-Path $srcfilepath-Context $ctx1$destFile=Get-AzStorageFile-ShareName $sharename2-Path $destfilepath-Context $ctx2Start-AzStorageFileCopy-SrcFile $file.ShareFileClient-DestFile $destFile.ShareFileClient-DestContext $ctx2# Copy from a source blob to a destination file $blob=Get-AzStorageBlob-Blob $blobname-Container $containername-Context $ctx1$destFile=Get-AzStorageFile-ShareName $sharename-Path $destfilepath-Context $ctx2Start-AzStorageFileCopy-SrcBlob $blob.ICloudBlob-DestFile $destFile.ShareFileClient-DestContext $ctx2
The text was updated successfully, but these errors were encountered:
@yifanz7 there is no special instruction to generate the breaking change file. All we need is a markdown file with all the necessary breaking change migration guide info for Storage module.
@yifanz7 there is no special instruction to generate the breaking change file. All we need is a markdown file with all the necessary breaking change migration guide info for Storage module.
@vidai-msft Are we able to edit the migration guide by ourselves then?
Description
Overview
In the upcoming release in November, references of v11 SDK "Microsoft.Azure.Storage.File" will be removed from File cmdlets. v12 SDK Azure.Storage.Files.Shares will be used instead. This will bring some breaking changes to the File cmdlets as a result and customers will need to update to use v12 SDK APIs instead.
Currently we have released a preview Az.Storage module (Az.Storage 7.4.1-preview) that contains all the upcoming changes that customers can download and give it a try.
Upcoming Breaking Changes
v11 SDK objects will be removed from outputs of File cmdlets. Customers will need to use v12 objects in the outputs instead in order to access .NET SDK methods. Using .NET SDK APIs with v11 objects will result in the exception of
You cannot call a method on a null-valued expression
.CloudFileShare
will be removed from outputs of the following cmdlets:Get-AzStorageFile
,New-AzStorageShare
,Get-AzStorageShare
,Remove-AzStorageShare
,New-AzStorageDirectory
,Remove-AzStorageDirectory
. Customers should use child propertyShareClient
instead. Some samples of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
For all the .NET SDK methods available for
ShareClient
, please refer to https://learn.microsoft.com/en-us/dotnet/api/azure.storage.files.shares.shareclient?view=azure-dotnetCloudFileDirectory
will be removed from outputs of the following cmdlets:Get-AzStorageFile
,New-AzStorageDirectory
,Remove-AzStorageDirectory
. Customers should use child propertyShareDirectoryClient
instead. Some samples of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
For all the .NET SDK methods available for
ShareDirectoryClient
, please refer to https://learn.microsoft.com/en-us/dotnet/api/azure.storage.files.shares.sharedirectoryclient?view=azure-dotnetCloudFile
will be removed from outputs of the following cmdlets:Get-AzStorageFile
. Customers should use child propertyShareFileClient
instead. Some samples of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
For all the .NET SDK methods available for
ShareFileClient
. please refer to https://learn.microsoft.com/en-us/dotnet/api/azure.storage.files.shares.sharefileclient?view=azure-dotnetv11 SDK objects will be removed from inputs of File cmdlets. For cmdlets that accept objects as input parameters, v12 SDK should be used and will be mandatory. If customers pipe in the objects, the usages will not change. However, for those who input the v11 objects directly in the cmdlets, v12 objects should be used instead.
The parameter
Share
(aliasCloudFileShare
) will be deprecated in the following cmdlets:Close-AzStorageFileHandle
,Get-AzStorageFile
,Get-AzStorageFileContent
,Get-AzStorageFileHandle
,Get-AzStorageShareStoredAccessPolicy
,New-AzStorageDirectory
,New-AzStorageFileSASToken
,New-AzStorageShareStoredAccessPolicy
,Remove-AzStorageDirectory
,Remove-AzStorageFile
,Remove-AzStorageShare
,Set-AzStorageFileContent
,Set-AzStorageShareQuota
,Set-AzStorageShareStoredAccessPolicy
,Start-AzStorageFileCopy
. ParameterShareClient
should be used instead. InputtingShare
parameter with v11 SDK objectCloudFileShare
will result in the exception ofParameter cannot be processed because the parameter name 'Share' is ambiguous.
Some samples of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
The parameter
Directory
(aliasCloudFileDirectory
) will be deprecated in the following cmdlets:Close-AzStorageFileHandle
,Get-AzStorageFile
,Get-AzStorageFileContent
,Get-AzStorageFileHandle
,New-AzStorageDirectory
,Remove-AzStorageDirectory
,Remove-AzStorageFile
,Set-AzStorageFileContent
. ParameterShareDirectory
should be used and will be required. Some samples of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
The parameter
File
(aliasCloudFile
) will be deprecated in the following cmdlets:Get-AzStorageFileContent
,Get-AzStorageFileHandle
,New-AzStorageFileSASToken
,Stop-AzStorageFileCopy
. ParameterShareFileClient
shuold be used and will be required. Some sample of the original and updated usages:Original usages with v11 SDK:
Updated usages with v12 SDK:
For cmdlet
Start-AzStorageFileCopy
, there will be two major changes:SrcFile
andDestFile
will be changed fromCloudFile
toShareFileClient
. Inputting an object of typeCloudFile
will result in the exception ofCannot bind parameter 'SrcFile'. Cannot convert the "Microsoft.Azure.Storage.File.CloudFile" value of type "Microsoft.Azure.Storage.File.CloudFile" to type "Azure.Storage.Files.Shares.ShareFileClient"
.For paremeter
SrcFile
, parameterCloudFile
will be deprecated. Using the deprecated parameter will result in the exception ofA parameter cannot be found that matches parameter name 'CloudFile'
.DestContext
will be required when copying from file object or blob object to a destination file object. Copying without specifying the destination context will result in the exception ofStart-AzStorageFileCopy : Could not get the destination storage context. Please pass in a storage context with /"-DestContext/" parameter (can be created with New-AzStorageContext cmdlet)
.For the changes mentioned above, here are some samples of the original and updates usages:
Original usages with v11 SDK:
Updated usages with v12 SDK:
The text was updated successfully, but these errors were encountered: