Lock-AzRmStorageContainerImmutabilityPolicy

Locks ImmutabilityPolicy of a Storage blob containers

Syntax

Lock-AzRmStorageContainerImmutabilityPolicy
    [-ResourceGroupName] <String>
    [-StorageAccountName] <String>
    -ContainerName <String>
    -Etag <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Lock-AzRmStorageContainerImmutabilityPolicy
    -ContainerName <String>
    -StorageAccount <PSStorageAccount>
    -Etag <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Lock-AzRmStorageContainerImmutabilityPolicy
    -Container <PSContainer>
    -Etag <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Lock-AzRmStorageContainerImmutabilityPolicy
    [-InputObject] <PSImmutabilityPolicy>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Lock-AzRmStorageContainerImmutabilityPolicy cmdlet locks ImmutabilityPolicy of a Storage blob containers.

Examples

Example 1: Lock ImmutabilityPolicy of a Storage blob container with Storage account name and container name

PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer"
PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Etag $policy.Etag

This command Locks ImmutabilityPolicy of a Storage blob container with Storage account name and container name.

Example 2: Lock ImmutabilityPolicy of a Storage blob container, with Storage account object

PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer"
PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -Etag $policy.Etag -Force

This command locks ImmutabilityPolicy of a Storage blob container, with Storage account object.

Example 3: Lock ImmutabilityPolicyof a Storage blob container, with container object

PS C:\>$containerObject = Get-AzStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer"
PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject
PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -Etag $policy.Etag -Force

This command locks ImmutabilityPolicy of a Storage blob container with Storage container object.

Example 4: Lock ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object

PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Lock-AzRmStorageContainerImmutabilityPolicy -Force

This command locks ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Storage container object

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSContainer
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-ContainerName

Container Name

Type:String
Aliases:N
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Etag

Immutability policy etag.

Type:String
Aliases:IfMatch
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Force to remove the ImmutabilityPolicy.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

ImmutabilityPolicy Object to Remove

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSImmutabilityPolicy
Aliases:ImmutabilityPolicy
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-ResourceGroupName

Resource Group Name.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageAccount

Storage account object

Type:PSStorageAccount
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-StorageAccountName

Storage Account Name.

Type:String
Aliases:AccountName
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSStorageAccount

Microsoft.Azure.Commands.Management.Storage.Models.PSContainer

Microsoft.Azure.Commands.Management.Storage.Models.PSImmutabilityPolicy

Outputs

Microsoft.Azure.Commands.Management.Storage.Models.PSImmutabilityPolicy