[✅ Solution] Send message to azure queue using http request

Hi, I’m trying to send a message to an azure storage queue using an http request. I developed the code in Python and was successful, but it didn’t work using the “perfom a calculation” action in the workflow.

Can anyone help me?

const storageAccountName = 'test';
const queueName = 'queue-test';
const sasToken = 'generated_by_azure';

const url = `https://${storageAccountName}.queue.core.windows.net/${queueName}/messages?${sasToken}`
const messageText = 'Test Submission to Azure Queue';
const body = `<?xml version="1.0" encoding="UTF-8"?>
<QueueMessage>
  <MessageText>${messageText}</MessageText>
</QueueMessage>`;

const headers = {
    'Content-Type': 'application/xml'
};

const response = await http.post(url, {
    headers: headers, 
    data: body,
    timeout: 30,
    }
);

console.log(response.data) 

Hi @Hanniel_Camara

Have you tried using the Execute a script block instead of Perform a calculation?

2 Likes

Hmm, I haven’t been able to send it yet, but now I can receive the result of my request… I think it will work out at some point.

Thank you very much

I also had a lot of trouble with the “perform a calculation” field whenever I gave it a try. With “execute a script” it just works. What’s the reason for the “perform a calculation” field anyway?