Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Add-AzRmStorageContainerLegalHold
- Module:
- Az.Storage Module
Adds legal hold tags to a Storage blob container
Syntax
AccountName (Default)
Add-AzRmStorageContainerLegalHold
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
-Name <String>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AccountObject
Add-AzRmStorageContainerLegalHold
-Name <String>
-StorageAccount <PSStorageAccount>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ContainerObject
Add-AzRmStorageContainerLegalHold
-Container <PSContainer>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-AzRmStorageContainerLegalHold cmdlet adds legal hold tags to a Storage blob container
Examples
Example 1: Add legal hold tags to a Storage blob container with Storage account name and container name
Add-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag tag1,tag2 -AllowProtectedAppendWriteAll $true
This command adds legal hold tags to a Storage blob container with Storage account name and container name, and set AllowProtectedAppendWriteAll as true to allow append new blocks to append or block blob.
Example 2: Add legal hold tags to a Storage blob container with Storage account object and container name
$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
Add-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer" -Tag tag1
This command adds legal hold tags to a Storage blob container with Storage account object and container name.
Example 3: Add legal hold tags to all Storage blob containers in a Storage account with pipeline
Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Add-AzRmStorageContainerLegalHold -Tag tag1,tag2,tag3
This command adds legal hold tags to all Storage blob containers in a Storage account with pipeline.
Parameters
-AllowProtectedAppendWriteAll
When enabled, new blocks can be written to both 'Append and Block Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-Container
Storage container object
Parameter properties
| Type: | PSContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-Name
Container Name
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | N, ContainerName |
Parameter sets
-ResourceGroupName
Resource Group Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-StorageAccount
Storage account object
Parameter properties
| Type: | PSStorageAccount |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-StorageAccountName
Storage Account Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AccountName |
Parameter sets
-Tag
Container LegalHold Tags
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
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.
Inputs
String
PSStorageAccount
PSContainer
Outputs
PSLegalHold
Azure PowerShell
Feedback
Was this page helpful?
