From 30e9d13b60ba03bf633580b402d10009aefcb894 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 11:20:00 +0800 Subject: [PATCH 01/13] Updating Queue Storage to the new SDKs. --- .../using-fsharp-on-azure/queue-storage.md | 2 +- .../snippets/fsharp/azure/queue-storage.fsx | 73 +++++++------------ 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 20f1e23a8cbe8..2058003d58fee 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -30,7 +30,7 @@ Next, use a [package manager](package-management.md) such as [Paket](https://fsp Add the following `open` statements to the top of the `queues.fsx` file: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] +[!code-fsharp[QueueStorage](https://github.com/dotnet/docs/blob/main/samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] ### Get your connection string diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index af963941f9c7f..74166ae6df1c1 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -1,113 +1,94 @@ -open Microsoft.Azure // Namespace for CloudConfigurationManager -open Microsoft.Azure.Storage // Namespace for CloudStorageAccount -open Microsoft.Azure.Storage.Queue // Namespace for Queue storage types - +open Azure.Storage.Queues +open System // -// Get your connection string. +// Get your connection string and queue name. // -let storageConnString = "..." // fill this in from your storage account -(* -// Parse the connection string and return a reference to the storage account. -let storageConnString = - CloudConfigurationManager.GetSetting("StorageConnectionString") -*) -// -// Parse the connection string. -// - -// Parse the connection string and return a reference to the storage account. -let storageAccount = CloudStorageAccount.Parse(storageConnString) +let connectionString = "..." // fill this in from your storage account +let queueName = "..." // fill this with queue name in your storage account // // Create the Queue Service client. // -let queueClient = storageAccount.CreateCloudQueueClient() - -// -// Create a queue. -// - -// Retrieve a reference to a container. -let queue = queueClient.GetQueueReference("myqueue") - -// Create the queue if it doesn't already exist -queue.CreateIfNotExists() +let queueClient = new QueueClient(connectionString, queueName); +queueClient.CreateIfNotExists() // // Insert a message into a queue. // // Create a message and add it to the queue. -let message = new CloudQueueMessage("Hello, World") -queue.AddMessage(message) +let message = "Hello, World" +queueClient.SendMessage(message) // // Peek at the next message. // // Peek at the next message. -let peekedMessage = queue.PeekMessage() -let msgAsString = peekedMessage.AsString +let peekedMessage = queueClient.PeekMessage() +let msgToString = peekedMessage.ToString() // // Get the next message. // // Get the next message. Successful processing must be indicated via DeleteMessage later. -let retrieved = queue.GetMessage() +let nextMessage = queueClient.ReceiveMessage() + // // Change the contents of a retrieved message. // // Update the message contents and set a new timeout. -retrieved.SetMessageContent("Updated contents.") -queue.UpdateMessage(retrieved, - TimeSpan.FromSeconds(60.0), - MessageUpdateFields.Content ||| MessageUpdateFields.Visibility) +queueClient.UpdateMessage( + nextMessage.Value.MessageId, + nextMessage.Value.PopReceipt, + "Updated contents.", + TimeSpan.FromSeconds(60.0)) // // De-queue the next message, indicating successful processing // // Process the message in less than 30 seconds, and then delete the message. -queue.DeleteMessage(retrieved) +queueClient.DeleteMessage(nextMessage.Value.MessageId, nextMessage.Value.PopReceipt) // // Use Async-Await pattern with common Queue storage APIs. // async { - let! exists = queue.CreateIfNotExistsAsync() |> Async.AwaitTask + let! exists = queueClient.CreateIfNotExistsAsync() |> Async.AwaitTask - let! retrieved = queue.GetMessageAsync() |> Async.AwaitTask + let! receipt = queueClient.ReceiveMessageAsync() |> Async.AwaitTask // ... process the message here ... // Now indicate successful processing: - do! queue.DeleteMessageAsync(retrieved) |> Async.AwaitTask + queueClient.DeleteMessageAsync(receipt.Value.MessageId, receipt.Value.PopReceipt) |> Async.AwaitTask } // // Additional options for de-queuing messages. // -for msg in queue.GetMessages(20, Nullable(TimeSpan.FromMinutes(5.))) do +for msg in queueClient.ReceiveMessages(20, Nullable(TimeSpan.FromMinutes(5.))).Value do // Process the message here. - queue.DeleteMessage(msg) + queueClient.DeleteMessage(msg.MessageId, msg.PopReceipt) // // Get the queue length. // -queue.FetchAttributes() -let count = queue.ApproximateMessageCount.GetValueOrDefault() +let properties = queueClient.GetProperties().Value +let count = properties.ApproximateMessagesCount // // Delete a queue. // // Delete the queue. -queue.Delete() +queueClient.Delete() From 9a4316afff1064476411b97589dec4cdcb56a532 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 11:25:15 +0800 Subject: [PATCH 02/13] Update reference --- docs/fsharp/using-fsharp-on-azure/queue-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 2058003d58fee..20f1e23a8cbe8 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -30,7 +30,7 @@ Next, use a [package manager](package-management.md) such as [Paket](https://fsp Add the following `open` statements to the top of the `queues.fsx` file: -[!code-fsharp[QueueStorage](https://github.com/dotnet/docs/blob/main/samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] +[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] ### Get your connection string From 2b6c812ea173cfdd40bc1ecf3705645c61f2d768 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 11:31:43 +0800 Subject: [PATCH 03/13] test path --- docs/fsharp/using-fsharp-on-azure/queue-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 20f1e23a8cbe8..f7fe6b6cd67bc 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -30,7 +30,7 @@ Next, use a [package manager](package-management.md) such as [Paket](https://fsp Add the following `open` statements to the top of the `queues.fsx` file: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] ### Get your connection string From 4916025172461b95ebd741dfdef2282fdeefc3ee Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 11:37:46 +0800 Subject: [PATCH 04/13] modify format --- samples/snippets/fsharp/azure/queue-storage.fsx | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index 74166ae6df1c1..620831722eb96 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -1,5 +1,6 @@ open Azure.Storage.Queues open System + // // Get your connection string and queue name. // From fc8ebce22d7a1ec7ac822402617b6b1b02ea2f24 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 13:45:46 +0800 Subject: [PATCH 05/13] Update the doc in queue-storage --- .../using-fsharp-on-azure/queue-storage.md | 60 +++++++------------ .../snippets/fsharp/azure/queue-storage.fsx | 18 +++--- 2 files changed, 34 insertions(+), 44 deletions(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index f7fe6b6cd67bc..2a6ae93ce85c3 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -30,7 +30,7 @@ Next, use a [package manager](package-management.md) such as [Paket](https://fsp Add the following `open` statements to the top of the `queues.fsx` file: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L1-L2)] ### Get your connection string @@ -38,59 +38,45 @@ You'll need an Azure Storage connection string for this tutorial. For more infor For the tutorial, you'll enter your connection string in your script, like this: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L9-L9)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L8-L8)] However, this is **not recommended** for real projects. Your storage account key is similar to the root password for your storage account. Always be careful to protect your storage account key. Avoid distributing it to other users, hard-coding it, or saving it in a plain-text file that is accessible to others. You can regenerate your key using the Azure portal if you believe it may have been compromised. For real applications, the best way to maintain your storage connection string is in a configuration file. To fetch the connection string from a configuration file, you can do this: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L11-L13)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L10-L12)] Using Azure Configuration Manager is optional. You can also use an API such as the .NET Framework's `ConfigurationManager` type. -### Parse the connection string - -To parse the connection string, use: - -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L19-L20)] - -This will return a `CloudStorageAccount`. - ### Create the Queue service client -The `CloudQueueClient` class enables you to retrieve queues stored in Queue storage. Here's one way to create the service client: +The `QueueClient` class enables you to retrieve queues stored in Queue storage. Here's one way to create the service client: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L26-L26)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L19-L20)] Now you are ready to write code that reads data from and writes data to Queue storage. -## Create a queue - -This example shows how to create a queue if it doesn't already exist: - -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L32-L36)] - ## Insert a message into a queue To insert a message into an existing queue, first create a new -`CloudQueueMessage`. Next, call the `AddMessage` method. A -`CloudQueueMessage` can be created from either a string (in UTF-8 -format) or a `byte` array, like this: +Message. Next, call the `SendMessage` method. A +Message can be created from string (in UTF-8 +format), like this: -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L42-L44)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L26-L28)] ## Peek at the next message You can peek at the message in the front of a queue, without removing it from the queue, by calling the `PeekMessage` method. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L50-L52)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L34-L36)] ## Get the next message for processing -You can retrieve the message at the front of a queue for processing by calling the `GetMessage` method. +You can retrieve the message at the front of a queue for processing by calling the `ReceiveMessage` method. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L58-L59)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L42-L43)] You later indicate successful processing of the message by using `DeleteMessage`. @@ -109,13 +95,13 @@ you would keep a retry count as well, and if the message is retried more than some number of times, you would delete it. This protects against a message that triggers an application error each time it is processed. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L65-L69)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L50-L55)] ## De-queue the next message Your code de-queues a message from a queue in two steps. When you call -`GetMessage`, you get the next message in a queue. A message returned -from `GetMessage` becomes invisible to any other code reading messages +`ReceiveMessage`, you get the next message in a queue. A message returned +from `ReceiveMessage` becomes invisible to any other code reading messages from this queue. By default, this message stays invisible for 30 seconds. To finish removing the message from the queue, you must also call `DeleteMessage`. This two-step process of removing a message @@ -124,13 +110,13 @@ software failure, another instance of your code can get the same message and try again. Your code calls `DeleteMessage` right after the message has been processed. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L75-L76)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L61-L62)] ## Use Async workflows with common Queue storage APIs This example shows how to use an async workflow with common Queue storage APIs. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L82-L91)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L68-L77)] ## Additional options for de-queuing messages @@ -138,26 +124,26 @@ There are two ways you can customize message retrieval from a queue. First, you can get a batch of messages (up to 32). Second, you can set a longer or shorter invisibility timeout, allowing your code more or less time to fully process each message. The following code example uses -`GetMessages` to get 20 messages in one call and then processes +`ReceiveMessages` to get 20 messages in one call and then processes each message. It also sets the invisibility timeout to five minutes for each message. The 5 minutes starts for all messages at the same -time, so after 5 minutes have passed since the call to `GetMessages`, any +time, so after 5 minutes have passed since the call to `ReceiveMessages`, any messages that have not been deleted will become visible again. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L97-L99)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L83-L85)] ## Get the queue length -You can get an estimate of the number of messages in a queue. The `FetchAttributes` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessageCount` property returns the last value retrieved by the `FetchAttributes` method, without calling the Queue service. +You can get an estimate of the number of messages in a queue. The `GetProperties` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessagesCount` property returns the last value retrieved by the `GetProperties` method, without calling the Queue service. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L105-L106)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L91-L92)] ## Delete a queue To delete a queue and all the messages contained in it, call the `Delete` method on the queue object. -[!code-fsharp[QueueStorage](~/samples/snippets/fsharp/azure/queue-storage.fsx#L112-L113)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L98-L99)] ## Next steps diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index 620831722eb96..c2718a734202d 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -5,14 +5,18 @@ open System // Get your connection string and queue name. // -let connectionString = "..." // fill this in from your storage account -let queueName = "..." // fill this with queue name in your storage account +let storageConnString = "..." // fill this in from your storage account +(* +// Parse the connection string and return a reference to the storage account. +let storageConnString = + CloudConfigurationManager.GetSetting("StorageConnectionString") +*) // // Create the Queue Service client. // -let queueClient = new QueueClient(connectionString, queueName); +let queueClient = new QueueClient(storageConnString, "myqueue"); queueClient.CreateIfNotExists() // @@ -36,7 +40,7 @@ let msgToString = peekedMessage.ToString() // // Get the next message. Successful processing must be indicated via DeleteMessage later. -let nextMessage = queueClient.ReceiveMessage() +let retrieved = queueClient.ReceiveMessage() // @@ -45,8 +49,8 @@ let nextMessage = queueClient.ReceiveMessage() // Update the message contents and set a new timeout. queueClient.UpdateMessage( - nextMessage.Value.MessageId, - nextMessage.Value.PopReceipt, + retrieved.Value.MessageId, + retrieved.Value.PopReceipt, "Updated contents.", TimeSpan.FromSeconds(60.0)) @@ -55,7 +59,7 @@ queueClient.UpdateMessage( // // Process the message in less than 30 seconds, and then delete the message. -queueClient.DeleteMessage(nextMessage.Value.MessageId, nextMessage.Value.PopReceipt) +queueClient.DeleteMessage(retrieved.Value.MessageId, retrieved.Value.PopReceipt) // // Use Async-Await pattern with common Queue storage APIs. From 27caee3fc4aeee60c40a100c3bfa80c35a4ae458 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Tue, 1 Jun 2021 13:58:41 +0800 Subject: [PATCH 06/13] remove invalid changes --- samples/snippets/fsharp/azure/queue-storage.fsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index c2718a734202d..21ccfb6191c05 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -1,8 +1,8 @@ -open Azure.Storage.Queues +open Azure.Storage.Queues // Namespace for Queue storage types open System // -// Get your connection string and queue name. +// Get your connection string. // let storageConnString = "..." // fill this in from your storage account @@ -42,7 +42,6 @@ let msgToString = peekedMessage.ToString() // Get the next message. Successful processing must be indicated via DeleteMessage later. let retrieved = queueClient.ReceiveMessage() - // // Change the contents of a retrieved message. // From 8d70ae775accd7064ae98ebc0b4c610c92cb5b35 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Wed, 2 Jun 2021 16:05:49 +0800 Subject: [PATCH 07/13] Updating some variables' name and removing invalid changes. --- .../using-fsharp-on-azure/queue-storage.md | 24 +++++++++----- .../snippets/fsharp/azure/queue-storage.fsx | 33 +++++++++++-------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 2a6ae93ce85c3..e3c59a72791e4 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -56,6 +56,12 @@ The `QueueClient` class enables you to retrieve queues stored in Queue storage. Now you are ready to write code that reads data from and writes data to Queue storage. +## Create a queue + +This example shows how to create a queue if it doesn't already exist: + +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L26-L27)] + ## Insert a message into a queue To insert a message into an existing queue, first create a new @@ -63,20 +69,20 @@ Message. Next, call the `SendMessage` method. A Message can be created from string (in UTF-8 format), like this: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L26-L28)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L33-L34)] ## Peek at the next message You can peek at the message in the front of a queue, without removing it from the queue, by calling the `PeekMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L34-L36)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L40-L41)] ## Get the next message for processing You can retrieve the message at the front of a queue for processing by calling the `ReceiveMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L42-L43)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L47-L48)] You later indicate successful processing of the message by using `DeleteMessage`. @@ -95,7 +101,7 @@ you would keep a retry count as well, and if the message is retried more than some number of times, you would delete it. This protects against a message that triggers an application error each time it is processed. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L50-L55)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L54-L59)] ## De-queue the next message @@ -110,13 +116,13 @@ software failure, another instance of your code can get the same message and try again. Your code calls `DeleteMessage` right after the message has been processed. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L61-L62)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L65-L67)] ## Use Async workflows with common Queue storage APIs This example shows how to use an async workflow with common Queue storage APIs. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L68-L77)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L73-L82)] ## Additional options for de-queuing messages @@ -130,20 +136,20 @@ each message. The 5 minutes starts for all messages at the same time, so after 5 minutes have passed since the call to `ReceiveMessages`, any messages that have not been deleted will become visible again. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L83-L85)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L88-L90)] ## Get the queue length You can get an estimate of the number of messages in a queue. The `GetProperties` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessagesCount` property returns the last value retrieved by the `GetProperties` method, without calling the Queue service. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L91-L92)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L96-L97)] ## Delete a queue To delete a queue and all the messages contained in it, call the `Delete` method on the queue object. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L98-L99)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L103-L103)] ## Next steps diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index 21ccfb6191c05..d53132f3a6031 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -16,31 +16,36 @@ let storageConnString = // Create the Queue Service client. // +// Instantiate a QueueClient which will be used to create and manipulate the queue let queueClient = new QueueClient(storageConnString, "myqueue"); + +// +// Create a queue. +// + +// Create the queue if it doesn't already exist queueClient.CreateIfNotExists() // // Insert a message into a queue. // -// Create a message and add it to the queue. -let message = "Hello, World" -queueClient.SendMessage(message) +// Send a message to the queue +queueClient.SendMessage("Hello, World") // // Peek at the next message. // -// Peek at the next message. let peekedMessage = queueClient.PeekMessage() -let msgToString = peekedMessage.ToString() +let messageContents = peekedMessage.ToString() // // Get the next message. // // Get the next message. Successful processing must be indicated via DeleteMessage later. -let retrieved = queueClient.ReceiveMessage() +let updateMessage = queueClient.ReceiveMessage().Value // // Change the contents of a retrieved message. @@ -48,8 +53,8 @@ let retrieved = queueClient.ReceiveMessage() // Update the message contents and set a new timeout. queueClient.UpdateMessage( - retrieved.Value.MessageId, - retrieved.Value.PopReceipt, + updateMessage.MessageId, + updateMessage.PopReceipt, "Updated contents.", TimeSpan.FromSeconds(60.0)) @@ -58,7 +63,8 @@ queueClient.UpdateMessage( // // Process the message in less than 30 seconds, and then delete the message. -queueClient.DeleteMessage(retrieved.Value.MessageId, retrieved.Value.PopReceipt) +let delMessage = queueClient.ReceiveMessage().Value +queueClient.DeleteMessage(delMessage.MessageId, delMessage.PopReceipt) // // Use Async-Await pattern with common Queue storage APIs. @@ -67,21 +73,21 @@ queueClient.DeleteMessage(retrieved.Value.MessageId, retrieved.Value.PopReceipt) async { let! exists = queueClient.CreateIfNotExistsAsync() |> Async.AwaitTask - let! receipt = queueClient.ReceiveMessageAsync() |> Async.AwaitTask + let! delAsyncMessage = queueClient.ReceiveMessageAsync() |> Async.AwaitTask // ... process the message here ... // Now indicate successful processing: - queueClient.DeleteMessageAsync(receipt.Value.MessageId, receipt.Value.PopReceipt) |> Async.AwaitTask + queueClient.DeleteMessageAsync(delAsyncMessage.Value.MessageId, delAsyncMessage.Value.PopReceipt) |> Async.AwaitTask } // // Additional options for de-queuing messages. // -for msg in queueClient.ReceiveMessages(20, Nullable(TimeSpan.FromMinutes(5.))).Value do +for dequeueMessage in queueClient.ReceiveMessages(20, Nullable(TimeSpan.FromMinutes(5.))).Value do // Process the message here. - queueClient.DeleteMessage(msg.MessageId, msg.PopReceipt) + queueClient.DeleteMessage(dequeueMessage.MessageId, dequeueMessage.PopReceipt) // // Get the queue length. @@ -94,5 +100,4 @@ let count = properties.ApproximateMessagesCount // Delete a queue. // -// Delete the queue. queueClient.Delete() From 89bd56f20614e1690644460b33d935b390034c2a Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Thu, 3 Jun 2021 09:25:56 +0800 Subject: [PATCH 08/13] remove repeat comments after the 3-line header block for each section --- .../using-fsharp-on-azure/queue-storage.md | 22 +++++++++---------- .../snippets/fsharp/azure/queue-storage.fsx | 10 ++------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index e3c59a72791e4..cdf5a1938a8a6 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -52,7 +52,7 @@ Using Azure Configuration Manager is optional. You can also use an API such as t The `QueueClient` class enables you to retrieve queues stored in Queue storage. Here's one way to create the service client: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L19-L20)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L19-L19)] Now you are ready to write code that reads data from and writes data to Queue storage. @@ -60,7 +60,7 @@ Now you are ready to write code that reads data from and writes data to Queue st This example shows how to create a queue if it doesn't already exist: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L26-L27)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L25-L25)] ## Insert a message into a queue @@ -69,20 +69,20 @@ Message. Next, call the `SendMessage` method. A Message can be created from string (in UTF-8 format), like this: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L33-L34)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L31-L31)] ## Peek at the next message You can peek at the message in the front of a queue, without removing it from the queue, by calling the `PeekMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L40-L41)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L37-L38)] ## Get the next message for processing You can retrieve the message at the front of a queue for processing by calling the `ReceiveMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L47-L48)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L44-L44)] You later indicate successful processing of the message by using `DeleteMessage`. @@ -101,7 +101,7 @@ you would keep a retry count as well, and if the message is retried more than some number of times, you would delete it. This protects against a message that triggers an application error each time it is processed. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L54-L59)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L50-L54)] ## De-queue the next message @@ -116,13 +116,13 @@ software failure, another instance of your code can get the same message and try again. Your code calls `DeleteMessage` right after the message has been processed. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L65-L67)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L60-L61)] ## Use Async workflows with common Queue storage APIs This example shows how to use an async workflow with common Queue storage APIs. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L73-L82)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L67-L76)] ## Additional options for de-queuing messages @@ -136,20 +136,20 @@ each message. The 5 minutes starts for all messages at the same time, so after 5 minutes have passed since the call to `ReceiveMessages`, any messages that have not been deleted will become visible again. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L88-L90)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L82-L84)] ## Get the queue length You can get an estimate of the number of messages in a queue. The `GetProperties` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessagesCount` property returns the last value retrieved by the `GetProperties` method, without calling the Queue service. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L96-L97)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L90-L91)] ## Delete a queue To delete a queue and all the messages contained in it, call the `Delete` method on the queue object. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L103-L103)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L97-L97)] ## Next steps diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index d53132f3a6031..2258f816f01c8 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -16,21 +16,18 @@ let storageConnString = // Create the Queue Service client. // -// Instantiate a QueueClient which will be used to create and manipulate the queue let queueClient = new QueueClient(storageConnString, "myqueue"); // // Create a queue. // -// Create the queue if it doesn't already exist queueClient.CreateIfNotExists() // // Insert a message into a queue. // -// Send a message to the queue queueClient.SendMessage("Hello, World") // @@ -44,14 +41,12 @@ let messageContents = peekedMessage.ToString() // Get the next message. // -// Get the next message. Successful processing must be indicated via DeleteMessage later. let updateMessage = queueClient.ReceiveMessage().Value // // Change the contents of a retrieved message. // -// Update the message contents and set a new timeout. queueClient.UpdateMessage( updateMessage.MessageId, updateMessage.PopReceipt, @@ -62,9 +57,8 @@ queueClient.UpdateMessage( // De-queue the next message, indicating successful processing // -// Process the message in less than 30 seconds, and then delete the message. -let delMessage = queueClient.ReceiveMessage().Value -queueClient.DeleteMessage(delMessage.MessageId, delMessage.PopReceipt) +let deleteMessage = queueClient.ReceiveMessage().Value +queueClient.DeleteMessage(deleteMessage.MessageId, deleteMessage.PopReceipt) // // Use Async-Await pattern with common Queue storage APIs. From 4ee2ecee874e52f33e6a0c3c1dee25f526e7214e Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Thu, 3 Jun 2021 09:44:40 +0800 Subject: [PATCH 09/13] omit the new when creating queueClient. --- samples/snippets/fsharp/azure/queue-storage.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index 2258f816f01c8..5b49a767c55d7 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -16,7 +16,7 @@ let storageConnString = // Create the Queue Service client. // -let queueClient = new QueueClient(storageConnString, "myqueue"); +let queueClient = QueueClient(storageConnString, "myqueue"); // // Create a queue. From 12a9b3589d30be73b8e9fcc28aba82b3b3307ed2 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Mon, 7 Jun 2021 11:36:19 +0800 Subject: [PATCH 10/13] Update ReadMe file --- .../using-fsharp-on-azure/queue-storage.md | 41 ++++++++++--------- .../snippets/fsharp/azure/queue-storage.fsx | 10 +++-- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index cdf5a1938a8a6..1c703c9166879 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -30,7 +30,7 @@ Next, use a [package manager](package-management.md) such as [Paket](https://fsp Add the following `open` statements to the top of the `queues.fsx` file: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L1-L2)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L1-L3)] ### Get your connection string @@ -38,21 +38,21 @@ You'll need an Azure Storage connection string for this tutorial. For more infor For the tutorial, you'll enter your connection string in your script, like this: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L8-L8)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L9-L9)] However, this is **not recommended** for real projects. Your storage account key is similar to the root password for your storage account. Always be careful to protect your storage account key. Avoid distributing it to other users, hard-coding it, or saving it in a plain-text file that is accessible to others. You can regenerate your key using the Azure portal if you believe it may have been compromised. For real applications, the best way to maintain your storage connection string is in a configuration file. To fetch the connection string from a configuration file, you can do this: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L10-L12)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L11-L13)] Using Azure Configuration Manager is optional. You can also use an API such as the .NET Framework's `ConfigurationManager` type. ### Create the Queue service client -The `QueueClient` class enables you to retrieve queues stored in Queue storage. Here's one way to create the service client: +The `QueueClient` class enables you to retrieve queues stored in Queue storage. Here's one way to create the client: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L19-L19)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L20-L20)] Now you are ready to write code that reads data from and writes data to Queue storage. @@ -60,29 +60,29 @@ Now you are ready to write code that reads data from and writes data to Queue st This example shows how to create a queue if it doesn't already exist: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L25-L25)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L26-L26)] ## Insert a message into a queue To insert a message into an existing queue, first create a new Message. Next, call the `SendMessage` method. A -Message can be created from string (in UTF-8 -format), like this: +Message can be created from either a string (in UTF-8 +format) or a `byte` array, like this: -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L31-L31)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L32-L33)] ## Peek at the next message You can peek at the message in the front of a queue, without removing it from the queue, by calling the `PeekMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L37-L38)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L39-L40)] ## Get the next message for processing You can retrieve the message at the front of a queue for processing by calling the `ReceiveMessage` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L44-L44)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L46-L46)] You later indicate successful processing of the message by using `DeleteMessage`. @@ -101,7 +101,7 @@ you would keep a retry count as well, and if the message is retried more than some number of times, you would delete it. This protects against a message that triggers an application error each time it is processed. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L50-L54)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L52-L56)] ## De-queue the next message @@ -115,14 +115,15 @@ assures that if your code fails to process a message due to hardware or software failure, another instance of your code can get the same message and try again. Your code calls `DeleteMessage` right after the message has been processed. +All of the Queue methods we've shown so far have `Async` alternatives. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L60-L61)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L62-L63)] ## Use Async workflows with common Queue storage APIs This example shows how to use an async workflow with common Queue storage APIs. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L67-L76)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L69-L78)] ## Additional options for de-queuing messages @@ -136,25 +137,25 @@ each message. The 5 minutes starts for all messages at the same time, so after 5 minutes have passed since the call to `ReceiveMessages`, any messages that have not been deleted will become visible again. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L82-L84)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L84-L86)] ## Get the queue length -You can get an estimate of the number of messages in a queue. The `GetProperties` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessagesCount` property returns the last value retrieved by the `GetProperties` method, without calling the Queue service. +You can get an estimate of the number of messages in a queue. The `GetProperties` method asks the Queue service to retrieve the queue attributes, including the message count. The `ApproximateMessagesCount` property returns the last value retrieved by the `GetProperties` method. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L90-L91)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L92-L93)] ## Delete a queue To delete a queue and all the messages contained in it, call the `Delete` method on the queue object. -[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L97-L97)] +[!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L99-L99)] ## Next steps -Now that you've learned the basics of Queue storage, follow these links -to learn about more complex storage tasks. +If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. See [MessageEncoding](https://docs.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. +Now that you've learned the basics of Queue storage, follow these links to learn about more complex storage tasks. - [Azure Storage APIs for .NET](/dotnet/api/overview/azure/storage) - [Azure Storage Type Provider](https://github.com/fsprojects/AzureStorageTypeProvider) diff --git a/samples/snippets/fsharp/azure/queue-storage.fsx b/samples/snippets/fsharp/azure/queue-storage.fsx index 5b49a767c55d7..c36e4603ba574 100644 --- a/samples/snippets/fsharp/azure/queue-storage.fsx +++ b/samples/snippets/fsharp/azure/queue-storage.fsx @@ -1,5 +1,6 @@ open Azure.Storage.Queues // Namespace for Queue storage types open System +open System.Text // // Get your connection string. @@ -16,7 +17,7 @@ let storageConnString = // Create the Queue Service client. // -let queueClient = QueueClient(storageConnString, "myqueue"); +let queueClient = QueueClient(storageConnString, "myqueue") // // Create a queue. @@ -28,14 +29,15 @@ queueClient.CreateIfNotExists() // Insert a message into a queue. // -queueClient.SendMessage("Hello, World") +queueClient.SendMessage("Hello, World") // Insert a String message into a queue +queueClient.SendMessage(BinaryData.FromBytes(Encoding.UTF8.GetBytes("Hello, World"))) // Insert a BinaryData message into a queue // // Peek at the next message. // let peekedMessage = queueClient.PeekMessage() -let messageContents = peekedMessage.ToString() +let messageContents = peekedMessage.Value.Body.ToString() // // Get the next message. @@ -94,4 +96,4 @@ let count = properties.ApproximateMessagesCount // Delete a queue. // -queueClient.Delete() +queueClient.DeleteIfExists() From 3c7977b5c7547b1ca67b984444f5d2347134c40a Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Mon, 7 Jun 2021 12:00:26 +0800 Subject: [PATCH 11/13] Update Readme file --- docs/fsharp/using-fsharp-on-azure/queue-storage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 1c703c9166879..47c31681c4950 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -152,9 +152,13 @@ To delete a queue and all the messages contained in it, call the [!code-fsharp[QueueStorage](../../../samples/snippets/fsharp/azure/queue-storage.fsx#L99-L99)] +## Note + +If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. +See [MessageEncoding](https://docs.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. + ## Next steps -If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. See [MessageEncoding](https://docs.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. Now that you've learned the basics of Queue storage, follow these links to learn about more complex storage tasks. - [Azure Storage APIs for .NET](/dotnet/api/overview/azure/storage) From 212c9d8dd96520da0c760783b8afe1b3bfc53521 Mon Sep 17 00:00:00 2001 From: Wenjie Yu Date: Mon, 7 Jun 2021 12:08:13 +0800 Subject: [PATCH 12/13] Remove en-us in link --- docs/fsharp/using-fsharp-on-azure/queue-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index 47c31681c4950..cc52b90e59690 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -155,7 +155,7 @@ To delete a queue and all the messages contained in it, call the ## Note If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. -See [MessageEncoding](https://docs.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. +See [MessageEncoding](https://docs.microsoft.com/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. ## Next steps From fa7f3aa288d5c9679bc02e2643af8e797df91191 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 1 Jul 2021 11:27:18 -0400 Subject: [PATCH 13/13] Update docs/fsharp/using-fsharp-on-azure/queue-storage.md --- docs/fsharp/using-fsharp-on-azure/queue-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsharp/using-fsharp-on-azure/queue-storage.md b/docs/fsharp/using-fsharp-on-azure/queue-storage.md index cc52b90e59690..b0801007162d8 100644 --- a/docs/fsharp/using-fsharp-on-azure/queue-storage.md +++ b/docs/fsharp/using-fsharp-on-azure/queue-storage.md @@ -154,7 +154,7 @@ To delete a queue and all the messages contained in it, call the ## Note -If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. +If you're migrating from the old libraries, they Base64 encoded messages by default but the new libraries do not because it's more performant. See [MessageEncoding](https://docs.microsoft.com/dotnet/api/azure.storage.queues.queueclientoptions.messageencoding?view=azure-dotnet#Azure_Storage_Queues_QueueClientOptions_MessageEncoding) for how to set that up. ## Next steps