Im following this document to add the insights to the batch account. document
Following are the steps followed to add the insights. Step 1: installed the batch_insights.exe and added in application package as I dont want to add in on the go as described in steps. Step 2: Added environment variables such as ApplicationInsights_instrumentation key and application Id. Step 3: Updated start task -
%AZ_BATCH_APP_PACKAGE_batch_insights\batch-insights.exe /install /norestart && start /wait
Step 4: In document it is specified to add some python script, do we need to add the step at all and if yes, I need to download the script and how to run after that, Could anyone explain this steps in detail.
The repository you are referring to is old and Batch service resource manager api has been updated with new features now.
Refer this MS Document to Monitor your Azure Batch service via Application Insights, It gives an example to Write logs to Application Insights via .Net framework.
Install this package:-
Refer this Github sample for the same.
In
ApplicationInsights.config
file update the Application Insights Instrumentation key:-Try to initialize the Application Insight code from the sample and run your application.
You can also implement a custom code in a python file using OpenTelemetry and then send custom logs to Application Insights. By running that python file as a startup task.
Refer my SO answer1 to use Opencensus library to send logs to application insights, And this SO answer2 to run python script in Azure Batch service.