You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method restores the content and metadata of a soft-deleted blob and any associated soft-deleted snapshots. Calling this method for a blob that hasn't been deleted has no effect.\
49
+
This method restores the content and metadata of a soft-deleted blob and any associated soft-deleted snapshots. Calling this method for a blob that hasn't been deleted has no effect.
## Restore soft-deleted blobs and directories (hierarchical namespace)
64
-
65
-
> [!IMPORTANT]
66
-
> This section applies only to accounts that have a hierarchical namespace.
67
-
68
-
1. Install version `12.4.0` or greater of the Azure Data Lake Storage client library for Python by using [pip](https://pypi.org/project/pip/). This command installs the latest version of the Azure Data Lake Storage client library for Python.
69
-
70
-
```
71
-
pip install azure-storage-file-datalake
72
-
```
73
-
74
-
2. Add these import statements to the top of your code file.
75
-
76
-
```python
77
-
import os, uuid, sys
78
-
from azure.storage.filedatalake import DataLakeServiceClient
79
-
from azure.storage.filedatalake import FileSystemClient
80
-
```
81
-
82
-
3. The following code deletes a directory, and then restores a soft-deleted directory.
83
-
84
-
The code example below contains an object named `service_client` of type **DataLakeServiceClient**. To see examples of how to create a **DataLakeServiceClient** instance, see [Authorize access and connect to data resources](data-lake-storage-directory-file-acl-python.md#authorize-access-and-connect-to-data-resources).
If you rename the directory that contains the soft-deleted items, those items become disconnected from the directory. If you want to restore those items, you'll have to revert the name of the directory back to its original name or create a separate directory that uses the original directory name. Otherwise, you'll receive an error when you attempt to restore those soft-deleted items.
109
-
110
63
## Resources
111
64
112
65
To learn more about how to delete blobs and restore deleted blobs using the Azure Blob Storage client library for Python, see the following resources.
0 commit comments