This repository contains a FastAPI application that is integrated with Azure Application Insights for enhanced observability and monitoring. It showcases how to set up basic telemetry, including custom logging, within a Python web application.
- Python 3.7+
- An Azure account
- Azure Application Insights resource
-
Clone the Repository
git clone `project` cd `<repository-name>`
-
Install Dependencies
Create a virtual environment and activate it:
python -m venv .venv Mac or Linux: source .venv/bin/activate Windows: .\.venv\Scripts\activate
Install the required packages:
pip install -r requirements.txt
-
Configure Environment Variables
Copy the
.env.example
file to a new file named.env
, and fill in theAPPLICATIONINSIGHTS_CONNECTION_STRING
with your Azure Application Insights connection string.APPLICATIONINSIGHTS_CONNECTION_STRING=<your_connection_string>
To run the application locally, use the following command:
uvicorn main:app --reload