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
@@ -4,7 +4,7 @@ description: A tutorial on using the Azure Queue Storage to create queues, and i
4
4
author: normesta
5
5
ms.author: normesta
6
6
ms.reviewer: dineshm
7
-
ms.date: 06/09/2020
7
+
ms.date: 08/07/2024
8
8
ms.topic: tutorial
9
9
ms.service: azure-queue-storage
10
10
ms.devlang: csharp
@@ -39,7 +39,11 @@ In this tutorial, you learn how to:
39
39
40
40
## Create an Azure Storage account
41
41
42
-
First, create an Azure Storage account. For a step-by-step guide to creating a storage account, see [Create a storage account](../common/storage-account-create.md?toc=/azure/storage/queues/toc.json). This is a separate step you perform after creating a free Azure account in the prerequisites.
42
+
1. First, create an Azure Storage account.
43
+
44
+
For a step-by-step guide to creating a storage account, see [Create a storage account](../common/storage-account-create.md?toc=/azure/storage/queues/toc.json). This is a separate step you perform after creating a free Azure account in the prerequisites.
45
+
46
+
2. Make sure that your user account has been assigned the [Storage Queue Data Contributor](queues/storage-quickstart-queues-dotnet#authenticate-to-azure) role, scoped to the storage account, parent resource group, or subscription. See [Authenticate to Azure](storage-quickstart-blobs-dotnet.md#assign-roles-to-your-microsoft-entra-user-account).
43
47
44
48
## Create the app
45
49
@@ -127,25 +131,7 @@ Since the app uses cloud resources, the code runs asynchronously.
127
131
128
132
## Create a queue
129
133
130
-
Before making any calls into Azure APIs, you must get your credentials from the Azure portal.
Add the connection string into the app so it can access the storage account.
137
-
138
-
1. Switch back to Visual Studio Code.
139
-
140
-
1. In the `Main` method, replace the `Console.WriteLine("Hello, World");` code with the following line that gets the connection string from the environment variable.
Before making any calls into Azure APIs, you must make sure you're authenticated with the same Microsoft Entra account you assigned the role to. Once authenticated, you can create and authorize a `QueueClient` object by using `DefaultAzureCredential` to access queue data in the storage account. `DefaultAzureCredential` automatically discovers and uses the account you signed into. To learn how to sign in and then create a `QueueClient` object, see [Authorize access and create a client object](storage-quickstart-queues-dotnet#authorize-access-and-create-a-client-object).
149
135
150
136
## Insert messages into the queue
151
137
@@ -199,17 +185,118 @@ If there are no command-line arguments, attempt a retrieve operation. Call the `
199
185
200
186
Finally, wait for user input before exiting by calling `Console.ReadLine`.
201
187
202
-
1. Expand the `Main` method to check for command-line arguments and wait for user input.
188
+
1. Expand the `Main` method to check for command-line arguments and wait for user input. In the code snippet below, make sure to replace the `{storageAccountName}` placeholder with the name of your storage account.
0 commit comments