1

I want to send data from AWS Lambda to Azure Service Bus Queue. Below is my attempt.

var azure = require("azure"); function test() { var serviceBusService = azure.createServiceBusService( "URL" ); var message = { body: "Test message", customProperties: { testproperty: "TestValue" } }; for (let i = 0; i < 10; i++) { serviceBusService.sendQueueMessage("myqueue", message, function(error) { if (!error) { console.log("message sent"); } }); } } test(); 

And it works fine in my local system

What I want - I want to put this code in AWS Lambda.

Error - When I upload it to Lambda I get error as "Could not find azure package".

Solution Attempted - I zipped my local folder container "node-modules" which has azure package and zipped it to upload but I am getting size Limit reached for Lambda exception as zip file is greater than 50 MB (lambda limit).

1 Answer 1

1

The azure NPM package is a) deprecated and b) a rollup of all features so it's much larger than you strictly need. If you really want to continue to use this then consider using a subset of the package, specifically azure-arm-* or azure-*.

You should consider moving to the newer SDK, specifically the azure-arm-sb ServiceBus package. Note that it too will be deprecated next year, when MS migrates it fully to TypeScript.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.