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
To learn more about creating a container, and to explore more code samples, see [Create a blob container with Python](storage-blob-container-create-python.md).
224
+
223
225
### Upload blobs to a container
224
226
225
227
The following code snippet:
@@ -233,6 +235,8 @@ Add this code to the end of the `try` block:
To learn more about uploading blobs, and to explore more code samples, see [Upload a blob with Python](storage-blob-upload-python.md).
239
+
236
240
### List the blobs in a container
237
241
238
242
List the blobs in the container by calling the [list_blobs](/python/api/azure-storage-blob/azure.storage.blob.containerclient#list-blobs-name-starts-with-none--include-none----kwargs-) method. In this case, only one blob has been added to the container, so the listing operation returns just that one blob.
@@ -241,6 +245,8 @@ Add this code to the end of the `try` block:
To learn more about listing blobs, and to explore more code samples, see [List blobs with Python](storage-blobs-list-python.md).
249
+
244
250
### Download blobs
245
251
246
252
Download the previously created blob by calling the [download_blob](/python/api/azure-storage-blob/azure.storage.blob.blobclient#download-blob-offset-none--length-none----kwargs-) method. The example code adds a suffix of "DOWNLOAD" to the file name so that you can see both files in local file system.
@@ -249,6 +255,8 @@ Add this code to the end of the `try` block:
To learn more about downloading blobs, and to explore more code samples, see [Download a blob with Python](storage-blob-download-python.md).
259
+
252
260
### Delete a container
253
261
254
262
The following code cleans up the resources the app created by removing the entire container using the [delete_container](/python/api/azure-storage-blob/azure.storage.blob.containerclient#delete-container---kwargs-) method. You can also delete the local files, if you like.
@@ -259,6 +267,8 @@ Add this code to the end of the `try` block:
To learn more about deleting a container, and to explore more code samples, see [Delete and restore a blob container with Python](storage-blob-container-delete-python.md).
271
+
262
272
## Run the code
263
273
264
274
This app creates a test file in your local folder and uploads it to Azure Blob Storage. The example then lists the blobs in the container, and downloads the file with a new name. You can compare the old and new files.
0 commit comments