Extensions.Azure.WebJobs.SQS
1.1.1
dotnet add package Extensions.Azure.WebJobs.SQS --version 1.1.1
NuGet\Install-Package Extensions.Azure.WebJobs.SQS -Version 1.1.1
<PackageReference Include="Extensions.Azure.WebJobs.SQS" Version="1.1.1" />
<PackageVersion Include="Extensions.Azure.WebJobs.SQS" Version="1.1.1" />
<PackageReference Include="Extensions.Azure.WebJobs.SQS" />
paket add Extensions.Azure.WebJobs.SQS --version 1.1.1
#r "nuget: Extensions.Azure.WebJobs.SQS, 1.1.1"
#:package Extensions.Azure.WebJobs.SQS@1.1.1
#addin nuget:?package=Extensions.Azure.WebJobs.SQS&version=1.1.1
#tool nuget:?package=Extensions.Azure.WebJobs.SQS&version=1.1.1
Azure WebJobs SQS Extension
Host-side Amazon SQS extension for the Azure Functions runtime. This package is referenced directly by apps using the in-process hosting model, and transitively (via the Worker SDK) by apps using the isolated worker hosting model, since the Functions host process is what actually listens to SQS in both cases.
đĻ Note: This package is a modernized continuation of the legacy AzureFunctions.Extension.SQS package, updated for Azure Functions v4, .NET 6/8, and modern AWS SDK patterns.
âšī¸ Recommendation: For new projects, install Extensions.Azure.Functions.Worker.SQS which supports the isolated worker model (Microsoft's recommended approach). Note: The in-process hosting model will be retired on November 10, 2026; this package itself stays supported as the host-side runtime extension for isolated worker apps.
Installation
dotnet add package Extensions.Azure.WebJobs.SQS
Features
- â Trigger functions from Amazon SQS queues
- â Send messages to SQS queues via output bindings
- â AWS credential chain support (no hardcoded credentials needed)
- â Automatic message deletion on successful processing
- â Configurable polling intervals and visibility timeouts
- â Async/await support throughout
- â .NET 6+ and .NET 8+ support
Quick Start
Prerequisites
- Azure Functions Runtime v4
- .NET 6 or .NET 8
- AWS Account with SQS queue
- AWS credentials configured (environment variables, IAM role, or AWS CLI)
Trigger Example
using Amazon.SQS.Model;
using Azure.WebJobs.Extensions.SQS;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
public class SqsFunctions
{
[FunctionName("ProcessSqsMessage")]
public void ProcessMessage(
[SqsQueueTrigger(QueueUrl = "%SQS_QUEUE_URL%")] Message message,
ILogger log)
{
log.LogInformation("Processing message: {MessageId}", message.MessageId);
log.LogInformation("Message body: {Body}", message.Body);
// Your processing logic here
// Message is automatically deleted on success
}
}
Output Binding Example
â ī¸ Security Note: This example uses
AuthorizationLevel.Anonymousfor demonstration purposes only. In production, useAuthorizationLevel.Functionor higher and require API keys or authentication to prevent unauthorized access.
using Amazon.SQS.Model;
using Azure.WebJobs.Extensions.SQS;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
public class SqsOutputFunctions
{
[FunctionName("SendMessage")]
public async Task<IActionResult> SendMessage(
[HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req,
[SqsQueueOut(QueueUrl = "%SQS_OUTPUT_QUEUE_URL%")] IAsyncCollector<string> messages)
{
var message = await new StreamReader(req.Body).ReadToEndAsync();
await messages.AddAsync(message);
return new OkObjectResult(new { status = "Message sent" });
}
}
Configuration
AWS Credentials
The extension uses the AWS credential chain to automatically discover credentials.
For local development - Use local.settings.json:
{
"Values": {
"AWS_ACCESS_KEY_ID": "your-access-key",
"AWS_SECRET_ACCESS_KEY": "your-secret-key",
"AWS_REGION": "us-east-1"
}
}
For Azure Functions (production) - Configure Application Settings:
- Via Azure Portal: Settings â Configuration â Application settings
- Via Azure CLI:
az functionapp config appsettings set \ --name <function-app-name> \ --resource-group <resource-group> \ --settings AWS_ACCESS_KEY_ID=<key> AWS_SECRET_ACCESS_KEY=<secret>
Best Practice - Use Azure Key Vault for production:
AWS_ACCESS_KEY_ID=@Microsoft.KeyVault(SecretUri=https://vault.azure.net/secrets/AwsAccessKeyId/)
AWS_SECRET_ACCESS_KEY=@Microsoft.KeyVault(SecretUri=https://vault.azure.net/secrets/AwsSecretAccessKey/)
The credential chain order:
- Environment variables (recommended)
- IAM roles (when running in AWS)
- AWS CLI credentials file (
~/.aws/credentials)
local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_INPROC_NET8_ENABLED": "1",
"SQS_QUEUE_URL": "https://sqs.us-east-1.amazonaws.com/123456789012/my-queue",
"SQS_OUTPUT_QUEUE_URL": "https://sqs.us-east-1.amazonaws.com/123456789012/my-output-queue",
"AWS_REGION": "us-east-1"
}
}
Attributes
SqsQueueTriggerAttribute
Triggers a function when messages are available in an SQS queue.
| Property | Type | Description | Default |
|---|---|---|---|
QueueUrl |
string | SQS queue URL (required) | - |
AWSKeyId |
string | AWS Access Key ID (optional) | null |
AWSAccessKey |
string | AWS Secret Access Key (optional) | null |
Region |
string | AWS Region (optional) | null |
MaxNumberOfMessages |
int | Max messages per batch (1-10) | 10 |
WaitTimeSeconds |
int | Long polling wait time (0-20) | 20 |
VisibilityTimeout |
int | Message visibility timeout (seconds) | 30 |
AutoDelete |
bool | Auto-delete on success | true |
SqsQueueOutAttribute
Sends messages to an SQS queue.
| Property | Type | Description | Default |
|---|---|---|---|
QueueUrl |
string | SQS queue URL (required) | - |
AWSKeyId |
string | AWS Access Key ID (optional) | null |
AWSAccessKey |
string | AWS Secret Access Key (optional) | null |
Region |
string | AWS Region (optional) | null |
Advanced Usage
Binding to Message Object
[FunctionName("ProcessFullMessage")]
public void ProcessFullMessage(
[SqsQueueTrigger(QueueUrl = "%SQS_QUEUE_URL%")] Message message,
ILogger log)
{
log.LogInformation("Message ID: {Id}", message.MessageId);
log.LogInformation("Receipt Handle: {Handle}", message.ReceiptHandle);
log.LogInformation("Attributes: {Count}", message.Attributes.Count);
foreach (var attr in message.MessageAttributes)
{
log.LogInformation("Attribute {Key}: {Value}",
attr.Key, attr.Value.StringValue);
}
}
Sending Multiple Messages
[FunctionName("SendBatch")]
public async Task<IActionResult> SendBatch(
[HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req,
[SqsQueueOut(QueueUrl = "%SQS_OUTPUT_QUEUE_URL%")] IAsyncCollector<string> messages)
{
for (int i = 0; i < 10; i++)
{
await messages.AddAsync($"Message {i + 1}");
}
return new OkObjectResult(new { sent = 10 });
}
Sending with Message Attributes
[FunctionName("SendWithAttributes")]
public async Task<IActionResult> SendWithAttributes(
[HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req,
[SqsQueueOut(QueueUrl = "%SQS_OUTPUT_QUEUE_URL%")] IAsyncCollector<SendMessageRequest> messages)
{
var request = new SendMessageRequest
{
MessageBody = "Hello with attributes",
DelaySeconds = 5,
MessageAttributes = new Dictionary<string, MessageAttributeValue>
{
["Priority"] = new MessageAttributeValue
{
DataType = "Number",
StringValue = "1"
},
["Source"] = new MessageAttributeValue
{
DataType = "String",
StringValue = "AzureFunctions"
}
}
};
await messages.AddAsync(request);
return new OkObjectResult(new { status = "sent" });
}
Migration Guide
From AzureFunctions.Extension.SQS (v2.x)
This package is the direct replacement for the deprecated AzureFunctions.Extension.SQS for in-process functions.
No code changes needed! Just update your package reference:
<PackageReference Include="AzureFunctions.Extension.SQS" Version="2.0.0" />
<PackageReference Include="Azure.WebJobs.Extensions.SQS" Version="1.0.0" />
Update using statements if needed:
// Old
using Azure.Functions.Extensions.SQS;
// New
using Azure.WebJobs.Extensions.SQS;
To Isolated Worker Model
If you want to migrate to the recommended isolated worker model, use Azure.Functions.Worker.Extensions.SQS instead. See the migration guide.
Troubleshooting
Messages Not Being Processed
- Check AWS credentials are configured correctly
- Verify queue URL is correct in configuration
- Check IAM permissions for SQS actions (
sqs:ReceiveMessage,sqs:DeleteMessage) - Review Azure Functions logs for errors
Permission Issues
Ensure your AWS credentials have these permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes",
"sqs:SendMessage"
],
"Resource": "arn:aws:sqs:*:*:*"
}
]
}
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- AWSSDK.SQS (>= 3.7.0)
- Microsoft.Azure.WebJobs (>= 3.0.41)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
-
net8.0
- AWSSDK.SQS (>= 3.7.0)
- Microsoft.Azure.WebJobs (>= 3.0.41)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.1 | 108 | 4/14/2026 |
| 1.1.0 | 96 | 4/14/2026 |
| 1.0.0 | 712 | 12/2/2025 |
| 0.0.3-beta | 675 | 12/2/2025 |
| 0.0.2-beta | 681 | 12/2/2025 |