Using PowerShell running AddMessageAsync results in WaitForActivation

Catherine Bundy (Aquent LLC) 21 Reputation points
2022-08-10T00:16:27.283+00:00

I created a queue:

PS C:\Users\Catherine Bundy> $queue |select -Property *

CloudQueue : Microsoft.Azure.Storage.Queue.CloudQueue
Uri : https://augustgophers.queue.core.windows.net/myqueue
ApproximateMessageCount :
EncodeMessage : True
QueueClient : Azure.Storage.Queues.QueueClient
QueueProperties : Azure.Storage.Queues.Models.QueueProperties
Context : Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext
Name : myqueue

I add a message:

PS C:\Users\Catherine Bundy> $queueMessage = [Microsoft.Azure.Storage.Queue.CloudQueueMessage]::new("This is message 3")
PS C:\Users\Catherine Bundy> $queue.CloudQueue.AddMessageAsync($queueMessage)

The result:

Id IsCompleted Status
-- ----------- ------
7 False WaitingForActivation

I watch the queue from the portal (hitting refresh repeatedly) and the message never appears.

However, adding a message from the portal does show up in the queue.

Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
109 questions
{count} votes

Accepted answer
  1. SaiKishor-MSFT 17,236 Reputation points
    2022-08-10T22:02:54.907+00:00

    @Catherine Bundy (Aquent LLC) Thank you for reaching out to Microsoft Q&A. I understand that you are receiving WaitingForActivation when you try to add messages to the queue using AddMessageAsync.

    Please refer to this similar article which suggests you to use- static async void Main(string[] args) { ... await queue.AddMessageAsync(message); ... }

    or queue.AddMessageAsync(message).GetAwaiter().GetResult();

    As per - https://stackoverflow.com/questions/55706246/cannot-add-message-to-storage-queue-using-c-sharp

    Please let us know if that helps. Thank you!

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Catherine Bundy (Aquent LLC) 21 Reputation points
    2022-08-13T00:17:44.85+00:00

    That worked! Thank you very much!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.