編輯

共用方式為


Update-AzRmStorageContainer

Modifies a Storage blob container

Syntax

Update-AzRmStorageContainer
      [-ResourceGroupName] <String>
      [-StorageAccountName] <String>
      -Name <String>
      [-PublicAccess <PSPublicAccess>]
      [-Metadata <Hashtable>]
      [-RootSquash <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRmStorageContainer
      -Name <String>
      -StorageAccount <PSStorageAccount>
      [-PublicAccess <PSPublicAccess>]
      [-Metadata <Hashtable>]
      [-RootSquash <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
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

Example 1: Modifies a Storage blob container's metadata and public access with Storage account name and container name

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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Storage container object

Type:PSContainer
Aliases:Container
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Metadata

Container Metadata

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Container Name

Type:String
Aliases:N, ContainerName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PublicAccess

Container PublicAccess

Type:PSPublicAccess
Accepted values:Container, Blob, None
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RootSquash

Sets reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'

Type:String
Accepted values:NoRootSquash, RootSquash, AllSquash
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageAccount

Storage account object

Type:PSStorageAccount
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccountName

Storage Account Name.

Type:String
Aliases:AccountName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSStorageAccount

PSContainer

Outputs

PSContainer