Skip to content

Python API using Flask to integrate with Azure Storage and Azure Service Bus

Notifications You must be signed in to change notification settings

epomatti/azure-python-api-servicebus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python API - Service Bus, Blob Storage

A sample Python API using Flask to integrate with Azure Storage and Azure Service Bus.

Infrastructure

You'll need a storage account with a blob container, and a Service Bus with a queue.

group='rg-myproj'
location='eastus2'
storage='stmyproj'
namespace='bus-myproj'

az group create -n $group -l $location
az storage account create -n $storage -g $group -l $location
az storage container create -n 'files' --account-name $storage

az servicebus namespace create -n $namespace -g $group -l $location
az servicebus queue create -n 'inQueue' --namespace-name $namespace -g $group
az servicebus queue create -n 'outQueue' --namespace-name $namespace -g $group

Running it

Install dependencies:

python3 -m venv env
. env/bin/activate
pip install -r requirements.txt

Create the configurations file and temp directory:

mkdir files
cp example.config.ini config.ini

Generate the data and serve the application:

# Generate the sample data
python3 src/data_generator.py

# Run the program
python3 src/main.py

With Docker:

docker build -t python-api .
docker run -it --rm --name python-api python-api

About

Python API using Flask to integrate with Azure Storage and Azure Service Bus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published