QuestionQ103

VerifiedDevelop for Azure storage

You have an Azure Queue Storage account containing a queue named queue1.

You plan to use the Azure SDK for .NET to develop a solution that uses queue1.

You need to write C# code that returns an approximate count of the messages in queue1. The solution must minimize development effort.

Which method should you use in your code?

Explanation

QueueClient.GetProperties retrieves the properties of a specific queue, and the returned QueueProperties.ApproximateMessagesCount value provides the queue's approximate message count. This is the direct SDK operation for obtaining the estimate without retrieving messages.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!