From d574b21eeff3354f22dc4444c53264a9eff4edc6 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Thu, 28 Oct 2021 15:39:03 +0800 Subject: [PATCH] [Storage] Add example for move datalakegen2 item with Sas --- .../help/Move-AzDataLakeGen2Item.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md index 5fb08851b465..a3df6cd91b49 100644 --- a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md @@ -58,6 +58,24 @@ dir2/file2 False 1024 2020-03-23 09:57:33Z rwxrw-rw- This command move file 'dir1/file1' in 'filesystem1' to file 'dir2/file2' in 'filesystem2' in the same Storage account without prompt. +### Example 3: Move an item with Sas token +``` +PS C:\> $sas = New-AzStorageContainerSASToken -Name $filesystemName -Permission rdw -Context $ctx + +PS C:\> $sasctx = New-AzStorageContext -StorageAccountName $ctx.StorageAccountName -SasToken $sas + +PS C:\> Move-AzDataLakeGen2Item -FileSystem $filesystemName -Path $itempath1 -DestFileSystem $filesystemName -DestPath "$($itempath2)$($sas)" -Context $sasctx + + FileSystem Name: filesystem1 + +Path IsDirectory Length LastModified Permissions Owner Group +---- ----------- ------ ------------ ----------- ----- ----- +dir2/file1 False 1024 2021-03-23 09:57:33Z rwxrw-rw- $superuser $superuser +``` + +This first command creates a Sas token with rdw permission, the second command creates a Storage context from the Sas token, the 3rd command moves an item with the Sas token. +This example use same Sastoken with rdw permission on both source and destication, if use 2 SAS token for source and destication, source need permission rd, destication need permission w. + ## PARAMETERS ### -Context