Update-AzRmStorageContainer
Modifies a Storage blob container
Syntax
AccountName (Default)
Update-AzRmStorageContainer
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
-Name <String>
[-PublicAccess <PSPublicAccess>]
[-Metadata <Hashtable>]
[-RootSquash <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AccountObject
Update-AzRmStorageContainer
-Name <String>
-StorageAccount <PSStorageAccount>
[-PublicAccess <PSPublicAccess>]
[-Metadata <Hashtable>]
[-RootSquash <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ContainerObject
Update-AzRmStorageContainer
-InputObject <PSContainer>
[-PublicAccess <PSPublicAccess>]
[-Metadata <Hashtable>]
[-RootSquash <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzRmStorageContainer cmdlet modifies a Storage blob container
Examples
Update-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -PublicAccess Container -Metadata @{tag0="value0";tag1="value1"}
This command modifies a Storage blob container's metadata and public access with Storage account name and container name.
Example 2: Disable public access on a Storage blob container with Storage account object and container name
$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
Update-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" -PublicAccess None
This command disables public access on a Storage blob container with Storage account object and container name.
Example 3: Set public access as Blob for all Storage blob containers in a Storage account with pipeline
Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Update-AzRmStorageContainer -PublicAccess Blob
This command set public access as Blob for all Storage blob containers in a Storage account with pipeline.
Example 4: Update an Azure storage container with RootSquash
$container = Update-AzRmStorageContainer -ResourceGroupName "myersourcegroup" -AccountName "mystorageaccount" -Name "mycontainer" -RootSquash NoRootSquash
$container.EnableNfsV3AllSquash
False
$container.EnableNfsV3RootSquash
False
This command updates a storage container, with RootSquash property set as NoRootSquash. RootSquash only works on a storage account that enabled NfsV3.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Storage container object
Type: PSContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Container
ContainerObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
Container Metadata
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Container Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: N, ContainerName
Parameter sets
AccountName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
AccountObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-PublicAccess
Container PublicAccess
Parameter properties
Type: PSPublicAccess
Default value: None
Accepted values: Container, Blob, None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Resource Group Name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
AccountName
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RootSquash
Sets reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'
Parameter properties
Type: String
Default value: None
Accepted values: NoRootSquash, RootSquash, AllSquash
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageAccount
Storage account object
Parameter properties
Type: PSStorageAccount
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
AccountObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-StorageAccountName
Storage Account Name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AccountName
Parameter sets
AccountName
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs