Skip to content

localstack/localstack-azure-samples

LocalStack for Azure Samples

License LocalStack Azure

This repository contains comprehensive sample projects demonstrating how to develop and test Azure cloud applications locally using LocalStack for Azure. Each sample provides complete infrastructure-as-code templates, application code, and deployment instructions for seamless local development.

Prerequisites

Required Tools

  • Docker: Container runtime for LocalStack
  • Azure CLI: Azure command-line interface
  • azlocal CLI: LocalStack Azure CLI wrapper
  • jq: JSON processor for scripting

Infrastructure as Code

  • Bicep: Azure ARM template language
  • Terraform: Multi-cloud infrastructure provisioning

Development Tools

Outline

Sample Name Description
Function App and Storage Azure Functions App using Blob, Queue, and Table Storage
Function App and Front Door Azure Functions App exposed via Front Door
Function App and Managed Identities Azure Function App using Managed Identities
Function App and Service Bus Azure Function App using Service Bus
Web App and CosmosDB for MongoDB API Azure Web App using CosmosDB for MongoDB API
Web App and CosmosDB for NoSQL API Azure Web App using CosmosDB for NoSQL API
Web App and Managed Identities Azure Web App using Managed Identities
Web App and SQL Database Azure Web App using SQL Database
ACI and Blob Storage Azure Container Instances with ACR, Key Vault, and Blob Storage
Azure Service Bus with Spring Boot Azure Service Bus used by a Spring Boot application

Sample Structure

Each sample project is organized by Azure service and includes:

  • Infrastructure templates (Bicep/Terraform) and/or Bash installation scripts.
  • Application code with best practices
  • Step-by-step deployment guides and tutorials.
  • Optionally, testing and validation scripts.

Local Testing

To validate all samples locally, you can run the same test suite used in the CI. This script will start LocalStack, configure the Azure CLI cloud profile, and execute the deployment and test scripts for each sample.

cd localstack-azure-samples

# Set your LOCALSTACK_AUTH_TOKEN
export LOCALSTACK_AUTH_TOKEN=<your-token>

# Or create a .env file:
# echo "LOCALSTACK_AUTH_TOKEN=<your-token>" > .env

./run-samples.sh

Troubleshooting: Line Endings

If you encounter errors like invalid option name or : command not found when running on Linux/WSL, it's likely due to Windows-style line endings (CRLF). You can fix this by running:

find . -name "*.sh" -exec sed -i 's/\r$//' {} +

Or by installing and using dos2unix.

Configuration

Follow the comprehensive setup guide in LocalStack for Azure Quick Start to configure your LocalStack for Azure development environment.

Documentation

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting pull requests.

  1. Fork the repository
  2. Create a feature branch
  3. Add your sample with complete documentation
  4. Submit a pull request

License

This project is licensed under the MIT LICENSE.

Support

Show Your Support

Please give a ⭐ to this repository, if you find these samples helpful for your Azure local development workflow!

About

Explore advanced Azure services on your local machine. These sample projects showcase key features of LocalStack, enabling local development and testing of serverless and containerized applications.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors