https://github.com/epomatti/azure-python-api-servicebus
Python API using Flask to integrate with Azure Storage and Azure Service Bus
https://github.com/epomatti/azure-python-api-servicebus
azure-storage python service-bus
Last synced: 7 months ago
JSON representation
Python API using Flask to integrate with Azure Storage and Azure Service Bus
- Host: GitHub
- URL: https://github.com/epomatti/azure-python-api-servicebus
- Owner: epomatti
- Created: 2019-09-23T13:25:13.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2022-04-05T21:07:07.000Z (over 3 years ago)
- Last Synced: 2025-01-17T18:44:31.154Z (9 months ago)
- Topics: azure-storage, python, service-bus
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```sh
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 $storageaz 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:
```sh
python3 -m venv env
. env/bin/activate
pip install -r requirements.txt
```Create the configurations file and temp directory:
```sh
mkdir files
cp example.config.ini config.ini
```Generate the data and serve the application:
```sh
# Generate the sample data
python3 src/data_generator.py# Run the program
python3 src/main.py
```With Docker:
```sh
docker build -t python-api .
docker run -it --rm --name python-api python-api
```