Skip to content

Commit 428a008

Browse files
authored
[Storage] Support NFS file share (#27366)
1 parent b941cd4 commit 428a008

25 files changed

+1291
-386
lines changed

src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,16 +1539,16 @@ function Test-NewSetAzureStorageAccountTLSveresionBlobPublicAccess
15391539
Assert-AreEqual $tlsVersion $sto.MinimumTlsVersion
15401540
Assert-AreEqual $false $sto.AllowBlobPublicAccess
15411541

1542-
$tlsVersion = "TLS1_1"
1543-
Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -SkuName $stotype -MinimumTlsVersion $tlsVersion -AllowBlobPublicAccess $true ;
1542+
$tlsVersion = "TLS1_2"
1543+
Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -SkuName $stotype -MinimumTlsVersion $tlsVersion -AllowBlobPublicAccess $false ;
15441544

15451545
Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
15461546
Assert-AreEqual $stoname $sto.StorageAccountName;
15471547
Assert-AreEqual $stotype $sto.Sku.Name;
15481548
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
15491549
Assert-AreEqual $kind $sto.Kind;
15501550
Assert-AreEqual $tlsVersion $sto.MinimumTlsVersion
1551-
Assert-AreEqual $true $sto.AllowBlobPublicAccess
1551+
Assert-AreEqual $false $sto.AllowBlobPublicAccess
15521552

15531553
Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
15541554
}

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestNewSetAzureStorageAccountTLSveresionBlobPublicAccess.json

Lines changed: 310 additions & 316 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/Storage.Management.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
15-
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
16-
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.21.0" />
17-
<PackageReference Include="Azure.Storage.Queues" Version="12.21.0" />
14+
<PackageReference Include="Azure.Storage.Blobs" Version="12.24.0" />
15+
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.22.0" />
16+
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.22.0" />
17+
<PackageReference Include="Azure.Storage.Queues" Version="12.22.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Storage/Storage.Management/Az.Storage.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ CmdletsToExport = 'Add-AzRmStorageContainerLegalHold',
205205
'Update-AzStorageBlobServiceProperty',
206206
'Update-AzStorageEncryptionScope',
207207
'Update-AzStorageFileServiceProperty',
208-
'Update-AzStorageServiceProperty'
208+
'Update-AzStorageServiceProperty',
209+
'New-AzStorageFileHardLink'
209210

210211
# Variables to export from this module
211212
# VariablesToExport = @()

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Supported NFS File Share and NFS file and directory properties
22+
- `Get-AzStorageFile`
23+
- `Get-AzStorageFileContent`
24+
- `New-AzStorageDirectory`
25+
- `Remove-AzStorageFile`
26+
- `Set-AzStorageFileContent`
27+
- `Start-AzStorageFileCopy`
28+
* Supported File share properties: Protocol, EnableSnapshotVirtualDirectoryAccess.
29+
- `New-AzStorageShare`
30+
- `Get-AzStorageShare`
31+
* Supported create hard link in NFS File Share
32+
- `New-AzStorageFileHardLink`
2133
* Added warning message for upcoming breaking change on upload Azure file
2234
- `Set-AzStorageFileContent`
2335
* Added warning messages for an upcoming breaking change when converting the account's redundancy configuration

src/Storage/Storage.Management/help/Az.Storage.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ Creates a directory.
269269
### [New-AzStorageEncryptionScope](New-AzStorageEncryptionScope.md)
270270
Creates an encryption scope for a Storage account.
271271

272+
### [New-AzStorageFileHardLink](New-AzStorageFileHardLink.md)
273+
Creates a hard link to a file in same share. Only works in NFS file share.
274+
272275
### [New-AzStorageFileSASToken](New-AzStorageFileSASToken.md)
273276
Generates a shared access signature token for a Storage file.
274277

src/Storage/Storage.Management/help/Get-AzStorageFile.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ Get-AzStorageFile -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" | Get
6161
This command lists the files and folders in the directory ContosoWorkingFolder under the share ContosoShare06.
6262
It first gets the directory instance, and then pipelines it to the **Get-AzStorageFile** cmdlet to list the directory.
6363

64+
### Example 3: List files and directories in a share, and exclude extended info
65+
```powershell
66+
Get-AzStorageFile -ShareName "ContosoShare06" -ExcludeExtendedInfo
67+
```
68+
69+
This command lists the files and folders in under the share ContosoShare06, and exclude extended file info like timestamps, ETag, attributes, permissionKey in list file and Directory.
70+
Currently, **-ExcludeExtendedInfo** will be needed to list files and directories from NFS file share or from a directory in NFS file share.
71+
6472
## PARAMETERS
6573

6674
### -ClientTimeoutPerRequest

src/Storage/Storage.Management/help/New-AzStorageDirectory.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ Creates a directory.
1515

1616
### ShareName (Default)
1717
```
18-
New-AzStorageDirectory [-ShareName] <String> [-Path] <String> [-DisAllowTrailingDot]
19-
[-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
20-
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
18+
New-AzStorageDirectory [-ShareName] <String> [-Path] <String> [-FileMode <String>] [-Owner <String>]
19+
[-Group <String>] [-DisAllowTrailingDot] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
20+
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
2121
[<CommonParameters>]
2222
```
2323

2424
### Share
2525
```
26-
New-AzStorageDirectory [-ShareClient] <ShareClient> [-Path] <String> [-Context <IStorageContext>]
27-
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
28-
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
26+
New-AzStorageDirectory [-ShareClient] <ShareClient> [-Path] <String> [-FileMode <String>] [-Owner <String>]
27+
[-Group <String>] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
28+
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
2929
[<CommonParameters>]
3030
```
3131

3232
### Directory
3333
```
34-
New-AzStorageDirectory [-ShareDirectoryClient] <ShareDirectoryClient> [-Path] <String>
35-
[-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
36-
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
34+
New-AzStorageDirectory [-ShareDirectoryClient] <ShareDirectoryClient> [-Path] <String> [-FileMode <String>]
35+
[-Owner <String>] [-Group <String>] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
36+
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
3737
[<CommonParameters>]
3838
```
3939

@@ -58,6 +58,14 @@ Get-AzStorageShare -Name "ContosoShare06" | New-AzStorageDirectory -Path "Contos
5858
This command uses the **Get-AzStorageShare** cmdlet to get the file share named ContosoShare06, and then passes it to the current cmdlet by using the pipeline operator.
5959
The current cmdlet creates the folder named ContosoWorkingFolder in ContosoShare06.
6060

61+
### Example 3: Create a folder with FileMode, Owner and Group in a NFS file share
62+
```powershell
63+
New-AzStorageDirectory -ShareName "contosochare06" -Path "ContosoWorkingFolder" -FileMode rwxrwSrwx -Owner 1 -Group 1
64+
```
65+
66+
This command creates a folder with FileMode rwxrwSrwx, Owner 1 and Group 1.
67+
FileMode, Owner, Group only works on NFS file share.
68+
6169
## PARAMETERS
6270

6371
### -ClientTimeoutPerRequest
@@ -142,6 +150,51 @@ Accept pipeline input: False
142150
Accept wildcard characters: False
143151
```
144152
153+
### -FileMode
154+
Only applicable to NFS Directory. The mode permissions to be set on the directory. Symbolic (rwxrw-rw-) is supported.
155+
156+
```yaml
157+
Type: System.String
158+
Parameter Sets: (All)
159+
Aliases:
160+
161+
Required: False
162+
Position: Named
163+
Default value: None
164+
Accept pipeline input: False
165+
Accept wildcard characters: False
166+
```
167+
168+
### -Group
169+
Only applicable to NFS Directory. The owner group identifier (GID) to be set on the directory. The default value is 0 (root group).
170+
171+
```yaml
172+
Type: System.String
173+
Parameter Sets: (All)
174+
Aliases:
175+
176+
Required: False
177+
Position: Named
178+
Default value: None
179+
Accept pipeline input: False
180+
Accept wildcard characters: False
181+
```
182+
183+
### -Owner
184+
Only applicable to NFS Directory. The owner user identifier (UID) to be set on the directory. The default value is 0 (root).
185+
186+
```yaml
187+
Type: System.String
188+
Parameter Sets: (All)
189+
Aliases:
190+
191+
Required: False
192+
Position: Named
193+
Default value: None
194+
Accept pipeline input: False
195+
Accept wildcard characters: False
196+
```
197+
145198
### -Path
146199
Specifies the path of a folder.
147200
This cmdlet creates a folder for the path that this cmdlet specifies.

0 commit comments

Comments
 (0)