Skip to content

Commit 9d6efa1

Browse files
authored
Merge pull request #212072 from pauljewellmsft/pauljewell-quickstart-linter-project
Update quickstart based on contributor guide
2 parents ad8eea1 + 3205e6b commit 9d6efa1

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

articles/storage/blobs/storage-quickstart-blobs-python.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,24 @@ title: 'Quickstart: Azure Blob Storage library v12 - Python'
33
description: In this quickstart, you learn how to use the Azure Blob Storage client library version 12 for Python to create a container and a blob in Blob (object) storage. Next, you learn how to download the blob to your local computer, and how to list all of the blobs in a container.
44
author: pauljewellmsft
55
ms.author: pauljewell
6-
ms.date: 01/28/2021
6+
ms.date: 09/26/2022
77
ms.topic: quickstart
88
ms.service: storage
99
ms.subservice: blobs
1010
ms.devlang: python
1111
ms.custom: devx-track-python, mode-api
1212
---
1313

14-
# Quickstart: Manage blobs with Python v12 SDK
14+
# Quickstart: Azure Blob Storage client library for Python
1515

16-
In this quickstart, you learn to manage blobs by using Python. Blobs are objects that can hold large amounts of text or binary data, including images, documents, streaming media, and archive data. You'll upload, download, and list blobs, and you'll create and delete containers.
16+
Get started with the Azure Blob Storage client library for Python to manage blobs and containers. Follow steps to install the package and try out example code for basic tasks.
1717

18-
More resources:
19-
20-
- [API reference documentation](/python/api/azure-storage-blob)
21-
- [Library source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob)
22-
- [Package (Python Package Index)](https://pypi.org/project/azure-storage-blob/)
23-
- [Samples](../common/storage-samples-python.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json#blob-samples)
18+
[API reference documentation](/python/api/azure-storage-blob) | [Library source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob) | [Package (PyPi)](https://pypi.org/project/azure-storage-blob/) | [Samples](../common/storage-samples-python.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json#blob-samples)
2419

2520
## Prerequisites
2621

27-
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
28-
- An Azure Storage account. [Create a storage account](../common/storage-account-create.md).
22+
- An Azure account with an active subscription - [create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
23+
- An Azure Storage account - [create a storage account](../common/storage-account-create.md).
2924
- [Python](https://www.python.org/downloads/) 2.7 or 3.6+.
3025

3126
## Setting up
@@ -36,7 +31,7 @@ This section walks you through preparing a project to work with the Azure Blob S
3631

3732
Create a Python application named *blob-quickstart-v12*.
3833

39-
1. In a console window (such as cmd, PowerShell, or Bash), create a new directory for the project.
34+
1. In a console window (such as PowerShell, cmd, or bash), create a new directory for the project.
4035

4136
```console
4237
mkdir blob-quickstart-v12
@@ -50,27 +45,22 @@ Create a Python application named *blob-quickstart-v12*.
5045

5146
### Install the package
5247

53-
While still in the application directory, install the Azure Blob Storage client library for Python package by using the `pip install` command.
48+
From the project directory, install the Azure Blob Storage client library for Python package by using the `pip install` command.
5449

5550
```console
5651
pip install azure-storage-blob
5752
```
5853

59-
This command installs the Azure Blob Storage client library for Python package and all the libraries on which it depends. In this case, that is just the Azure core library for Python.
54+
This command installs the Azure Blob Storage for Python package and libraries on which it depends. In this case, the only dependency is the Azure core library for Python.
6055

6156
### Set up the app framework
6257

63-
From the project directory:
58+
From the project directory, follow steps to create the basic structure of the app:
6459

6560
1. Open a new text file in your code editor
66-
1. Add `import` statements
67-
1. Create the structure for the program, including basic exception handling
68-
69-
Here's the code:
70-
71-
:::code language="python" source="~/azure-storage-snippets/blobs/quickstarts/python/V12/app_framework.py":::
72-
61+
1. Add `import` statements, create the structure for the program, and include basic exception handling, as shown below
7362
1. Save the new file as *blob-quickstart-v12.py* in the *blob-quickstart-v12* directory.
63+
:::code language="python" source="~/azure-storage-snippets/blobs/quickstarts/python/V12/app_framework.py":::
7464

7565
[!INCLUDE [storage-quickstart-credentials-include](../../../includes/storage-quickstart-credentials-include.md)]
7666

@@ -82,7 +72,7 @@ Azure Blob Storage is optimized for storing massive amounts of unstructured data
8272
- A container in the storage account
8373
- A blob in the container
8474

85-
The following diagram shows the relationship between these resources.
75+
The following diagram shows the relationship between these resources:
8676

8777
![Diagram of Blob storage architecture](./media/storage-blobs-introduction/blob1.png)
8878

@@ -96,14 +86,14 @@ Use the following Python classes to interact with these resources:
9686

9787
These example code snippets show you how to do the following tasks with the Azure Blob Storage client library for Python:
9888

99-
- [Get the connection string](#get-the-connection-string)
89+
- [Get the connection string](#get-the-connection-string-for-authentication)
10090
- [Create a container](#create-a-container)
10191
- [Upload blobs to a container](#upload-blobs-to-a-container)
10292
- [List the blobs in a container](#list-the-blobs-in-a-container)
10393
- [Download blobs](#download-blobs)
10494
- [Delete a container](#delete-a-container)
10595

106-
### Get the connection string
96+
### Get the connection string for authentication
10797

10898
The code below retrieves the storage account connection string from the environment variable created in the [Configure your storage connection string](#configure-your-storage-connection-string) section.
10999

@@ -157,7 +147,7 @@ Add this code to the end of the `try` block:
157147

158148
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.
159149

160-
The app pauses for user input by calling `input()` before it deletes the blob, container, and local files. Verify that the resources were created correctly, before they're deleted.
150+
The app pauses for user input by calling `input()` before it deletes the blob, container, and local files. Verify that the resources were created correctly before they're deleted.
161151

162152
Add this code to the end of the `try` block:
163153

@@ -194,9 +184,11 @@ Deleting the local source and downloaded files...
194184
Done
195185
```
196186

197-
Before you begin the cleanup process, check your *data* folder for the two files. You can open them and observe that they're identical.
187+
Before you begin the cleanup process, check your *data* folder for the two files. You can compare them and observe that they're identical.
188+
189+
## Clean up resources
198190

199-
After you've verified the files, press the **Enter** key to delete the test files and finish the demo.
191+
After you've verified the files and finished testing, press the **Enter** key to delete the test files along with the container you created in the storage account.
200192

201193
## Next steps
202194

0 commit comments

Comments
 (0)