The Restore-AzStorageContainer cmdlet restores a previously deleted Azure storage blob container.
This cmdlet only works after enabled Container softdelete with Enable-AzStorageBlobDeleteRetentionPolicy.
Examples
Example 1: List containers include deleted containers, and restore all deleted containers with pipeline
Storage Account Name: storageaccountname
Name PublicAccess LastModified IsDeleted VersionId
---- ------------ ------------ --------- ---------
container1 Off
container2 Off
This command lists all containers include deleted containers, filter out all the deleted containers, then restore all deleted container to the same container name with pipeline.
This first command lists all containers and filter out deleted containers.
The secondary command restores a deleted container by manually input the parameters.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.