Chapter 5 · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services

Azure Queue Storage

20 practice questions · 5 marks weightage

Practice questions

  1. Question 1Q-A6F1A1

    A .NET worker retrieves a message from Azure Queue Storage and may need up to two minutes to process it. The worker calls ReceiveMessagesAsync with a two-minute visibility timeout. What is the purpose of this timeout?

    1. A.It permanently deletes the message after two minutes.
    2. B.It temporarily hides the message from other consumers; if it is not deleted before the timeout expires, it becomes visible again.
    3. C.It limits the message body to two minutes of processing time and then truncates the message.
    4. D.It delays the first delivery of the message for two minutes.
    See the answer and solution
  2. Question 2Q-26488B

    An Azure Queue Storage worker receives a message, but processing fails repeatedly because the message contains invalid data. The application wants to prevent the message from continually blocking normal processing. Which approach is most appropriate?

    1. A.Use the message's DequeueCount, and after a configured threshold, delete it from the source queue and store it in a poison-message queue for investigation.
    2. B.Reset the message's DequeueCount to zero by calling UpdateMessageAsync.
    3. C.Set the visibility timeout to zero so that no consumer can receive the message again.
    4. D.Increase the queue's metadata limit so that the message can be retried indefinitely without being returned.
    See the answer and solution
  3. Question 3Q-0B6A6F

    A long-running .NET worker receives a message using Azure.Storage.Queues and needs to extend the message's invisibility while processing continues. Which action correctly extends the lease for the currently received message?

    1. A.Call UpdateMessageAsync(message.MessageId, message.PopReceipt, message.MessageText, TimeSpan.FromMinutes(5)) using the latest message ID and pop receipt.
    2. B.Call SendMessageAsync with the original message text and a five-minute visibility timeout.
    3. C.Call DeleteMessageAsync with only the message ID, which automatically renews visibility before deletion.
    4. D.Call ReceiveMessagesAsync again with the same message ID and a five-minute visibility timeout.
    See the answer and solution
  4. Question 4Q-A6180F

    A .NET application must place a 100 KiB document-related work item in Azure Queue Storage. What is the recommended design?

    1. A.Store the document in Blob Storage and enqueue a message containing its URI and required metadata.
    2. B.Enqueue the entire document because Azure Queue Storage automatically splits large messages.
    3. C.Convert the document to Base64 because Base64 removes the queue message size limit.
    4. D.Use multiple queues automatically created by Queue Storage for each part of the document.
    See the answer and solution
  5. Question 5Q-F3635F

    A legacy worker reads Azure Queue Storage messages and expects the message body to be Base64-encoded. Which C# code configures the Azure.Storage.Queues client correctly before sending a message?

    1. A.var options = new QueueClientOptions { MessageEncoding = QueueMessageEncoding.Base64 }; var client = new QueueClient(connectionString, "jobs", options); await client.SendMessageAsync("{"id":42}");
    2. B.var options = new QueueClientOptions { MessageEncoding = QueueMessageEncoding.None }; var client = new QueueClient(connectionString, "jobs", options); await client.SendMessageAsync("{"id":42}");
    3. C.var client = new QueueClient(connectionString, "jobs"); await client.EncodeMessagesAsync(QueueMessageEncoding.Base64);
    4. D.var client = new QueueClient(connectionString, "jobs"); await client.SendMessageAsync(Convert.FromBase64String("{"id":42}"));
    See the answer and solution

15 more questions on Azure Queue Storage

Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed