Enables Blob Restore Policy on a Storage account.
Syntax AccountName (Default)Enable-AzStorageBlobRestorePolicy
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
-RestoreDays <Int32>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AccountObject
Enable-AzStorageBlobRestorePolicy
-StorageAccount <PSStorageAccount>
-RestoreDays <Int32>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
BlobServicePropertiesResourceId
Enable-AzStorageBlobRestorePolicy
[-ResourceId] <String>
-RestoreDays <Int32>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Enable-AzStorageBlobRestorePolicy cmdlet enables Blob Restore Policy for the Azure Storage Blob service.
Examples Example 1: Enables Blob Restore Policy for the Azure Storage Blob service on a Storage accountEnable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -RetentionDays 5
Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -EnableChangeFeed $true
StorageAccountName : mystorageaccount
ResourceGroupName : myresourcegroup
DefaultServiceVersion :
DeleteRetentionPolicy.Enabled : True
DeleteRetentionPolicy.Days : 5
RestorePolicy.Enabled : False
RestorePolicy.Days :
RestorePolicy.MinRestoreTime :
ChangeFeed : True
IsVersioningEnabled : True
Enable-AzStorageBlobRestorePolicy -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -RestoreDays 4
Get-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount"
StorageAccountName : mystorageaccount
ResourceGroupName : myresourcegoup
DefaultServiceVersion :
DeleteRetentionPolicy.Enabled : True
DeleteRetentionPolicy.Days : 5
RestorePolicy.Enabled : True
RestorePolicy.Days : 4
RestorePolicy.MinRestoreTime : 8/28/2020 6:00:59 AM
ChangeFeed : True
IsVersioningEnabled : True
This command first enable Blob softdelete and changefeed, then enables Blob Restore Policy, finally check the setting in Blob service properties. The Blob service RestorePolicy.Days must be smaller than DeleteRetentionPolicy.Days. Blob softdelete and ChangeFeed must be enabled before enable blob Restore Policy. If softdelete and Changefeed are just enabled, might need wait for some time for server to handle the setting, before enable Blob restore policy.
Parameters -ConfirmPrompts 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 -DefaultProfileThe 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 -PassThruDisplay ServiceProperties
Parameter properties Type: SwitchParameter Default value: 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 -ResourceGroupNameResource 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: False Value from remaining arguments: False -ResourceIdInput a Storage account Resource Id, or a Blob service properties Resource Id.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets BlobServicePropertiesResourceId Position: 0 Mandatory: True Value from pipeline: False Value from pipeline by property name: True Value from remaining arguments: False -RestoreDaysSets the number of days for the blob can be restored..
Parameter properties Type: Int32 Default value: None Supports wildcards: False DontShow: False Aliases: Days Parameter sets (All) Position: Named Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -StorageAccountStorage 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: False Value from remaining arguments: False -StorageAccountNameStorage Account Name.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Aliases: AccountName, Name Parameter sets AccountName Position: 1 Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -WhatIfShows 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 CommonParametersThis 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 PSStorageAccount String Outputs PSRestorePolicyRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4