A simple File Management System backend application using python fast API deployed in Azure apps that allows users to upload, retrieve, and manage files. The project will integrate with Azure service bus for message processing and Azure Blob for file storage, along with CosmosDB for storing metadata about the uploaded files.
Terraform provisions the infra and github actions handles the CI.
From the architecture, the step
1
is a provisioning step which creates the infra and also update secrets to github actions.
The step 2
updates the container registry upon github actions run.
Thank you for your interest for contributing
Ensure docker
and make
is installed and working on the local environment
- Build the package into a docker container with tag
fsmgmt
make build
- Launch the app inside the container at
http://localhost:8000
make run
- Run unit tests to check everything works
make test
- Check logs
docker logs fsmgmt
The infrastructure is implemented with terraform and all the configs and scripts exists under infra/
directory
terraform
installed and available on the pathaz
cli installed and ready to be logged in
- Setup python
fsmgmt
venv environment
python -m venv fsmgmt
source fsmgmt/bin/activate
- Setup subscription and credentials a. Change directory to the correct directory
cd infra/
b. Store .env.template
to .env
and values to it.
cp .env.template .env
# Edit .env and fill-in values
c. Source those values with source
command
source .env
d. Login to your Azure subscription with az cli to provide access to terraform
az login
- Terraform initialize
terraform init
- Terraform apply
terraform apply
- Create bare python fast api app, says hello world for CRUD operations
- Deploy in Azure apps
- Implement blob storage and attach to app
- Implement upload and listing
- Implement cosmosDB and attach to app
- Add metadata to cosmosDB
- Implement deletion
- Add Azure service bus
a. Version 1: Python App available locally that can upload to blob
- Run terraform from CLI from local computer
- Terraform: Implement Azure blob storage with terraform
- Terraform: Create a service principal
- Terraform: Assign
storage blob officer
permissions to that service principal for the given storage account - Python: Implement python FAST API app to accept upload, list and download with dummy actions
- Create client id and client secret for that service principal and set it to env vars
- Python: Read client id and client secret and upload the data to blob
- Python: List and download blob data
b. Version 2: Database updated with metadata
- Define metadata: size, timestamp, filename and blob path
- Terraform: Create CosmosDB with postgreSQL
- Terraform: Assign
database admin
? permissions to service principal for that DB. - Python: Connect and upload metadata to DB everytime
c. Version 3: Python app to be deployed to Azure apps 1.
d. Version 4: Add the Azure message bus 1.