Add-AzRmStorageContainerLegalHold
Adds legal hold tags to a Storage blob container
Add-AzRmStorageContainerLegalHold
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
-Name <String>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-AzRmStorageContainerLegalHold
-Name <String>
-StorageAccount <PSStorageAccount>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-AzRmStorageContainerLegalHold
-Container <PSContainer>
-Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Add-AzRmStorageContainerLegalHold cmdlet adds legal hold tags to a Storage blob container
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.
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.
When enabled, new blocks can be written to both 'Appened and Block Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Storage container object
Type: | PSContainer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
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 |
Container Name
Type: | String |
Aliases: | N, ContainerName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Resource Group Name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Storage account object
Type: | PSStorageAccount |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Storage Account Name.
Type: | String |
Aliases: | AccountName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Container LegalHold Tags
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback: