The purpose of this README.md file is to explain the steps required to setup this project in your local environment for testing.
- Python
- Docker
- Azure acount
- Azure CLI
Clone Repo
git clone https://github.com/Arnold-git/Azure-container-App-demo
Change current working directory
cd Azure-container-App-demo
Create a Virtual environment
python -m venv .venv
Activate virutual Environment
#windows
source .venv/Scripts/activate
#linux
source .venv/bin/activate
Install dependencies
pip install -r app/requirements.txt
Start Server
uvicorn app.main:app --reload
Build and Run container image
docker build --tag fastapi-azure-demo . && docker run -d --name fastapi-azure-container -p 3200:3200 fastapi-azure-demo
Open the URL in your browser to see the web app running locally.
In a bash or any other CLI client, run the following command in the project root folder
Deploy to Azure container Apps
az containerapp up --resource-group fastapi-azure-demo-rg --name fastapi-azure-demo --ingress external --target-port 3200 --source .
You should see this in your terminal when the deployment is complete.
Monitor logs
az containerapp logs show --name fastapi-azure-demo --resource-group fastapi-azure-demo-rg --type console --follow
clean up
az group delete --name fastapi-azure-demo-rg
I wrote a detailed article Check it out here