sample-app-aoai-chatGPT
sample-app-aoai-chatGPT copied to clipboard
Application Insights not usable when deployed as webapp from AI Studio
The Application Insights link is greyed out says "Application Insights is not supported for your app's runtime configuration"
I've tried the workaround listed here https://github.com/microsoft/ApplicationInsights-dotnet/issues/2578#issuecomment-1311978824 but still not getting data.
One thing that I found helpful is adding Application Insights to the app.py code.
Here is some sample code.
from opencensus.ext.azure.log_exporter import AzureLogHandler
...
AZURE_APP_INSIGHTS_CONNECTION_STRING = os.environ.get("AZURE_APP_INSIGHTS_CONNECTION_STRING")
...
# Set up Azure Application Insights logger
app_insights_conn_str = AZURE_APP_INSIGHTS_CONNECTION_STRING
logger = logging.getLogger(__name__)
handler = AzureLogHandler(connection_string=app_insights_conn_str)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
logger.info('Loaded Application Insights')