Coming from a C# background — I found monitoring my python FastAPI application with Azure Application Insights stupidly difficult. Mainly due to a lack of direct support in Azure or documentation for doing it manually. In C#, you can automatically instrument on App Insights without adding a single line of code. There is no equivalent option for python. However, you can achieve a decent first pass at auto instrumenting your python app using open telemetry, a few simple lines of code and some environment variables. Here’s how…(I’ll skip the B******t now — just code.) Also — here is a stock image of a dog with a croissant. The code snippet includes package imports, instrumentation setup, and configuration of Azure monitor. It depends on 2 environment variables: APPLICATIONINSIGHTS_CONNECTION_STRING and OTEL_EXPERIMENTAL_RESOURCE_DETECTORS. The author couldnt find a complete working solution online, so this guide aims to help others facing similar challenges. Credit goes to a referenced article for providing the foundation code. Python, Fastapi, Monitoring, Opentelemetry, Azure Application Insight. Written by Theo McCabe, a Software Engineer. Follow for more insights on software development. Status: About, Careers, Blog, Privacy, Terms, Text to speech, Teams.