This project is no longer actively maintained. Please see the main Azure Batch GitHub repository for more information about Azure Batch.
Azure Batch Insights is a tool used to get system statistics for your Azure Batch account nodes.
- Goto the Azure portal
- Search for Application Insights
- Create or use an existing one(Application type input doesn't matter)
Set 3 environment variables in your start task. Make sure this is set as a Batch environment variable rather than exporting. Without the Batch environment variable it will not show up in Batch Explorer. Then set the start task user to be Pool Admin
(Task admin
might work too)
APP_INSIGHTS_INSTRUMENTATION_KEY
: This your app insight instrumentation key
On the application insight blade in the Azure Portal
APP_INSIGHTS_APP_ID
: This is your app insight application id
On the application insight blade in the Azure Portal
BATCH_INSIGHTS_DOWNLOAD_URL
: This is the link to the exe to run. To find this go to the releases and get the link to the release you need
For example:
Linux
: https://github.com/Azure/batch-insights/releases/download/v1.0.0/batch-insightsWindows
: https://github.com/Azure/batch-insights/releases/download/v1.0.0/batch-insights.exe
Add this to your start task
# For version 1.x of batch insights
/bin/bash -c 'wget -O - https://raw.githubusercontent.com/Azure/batch-insights/master/scripts/1.x/run-linux.sh | bash'
# For latest version of batch insights
/bin/bash -c 'wget -O - https://raw.githubusercontent.com/Azure/batch-insights/master/scripts/run-linux.sh | bash'
Add this to your start task
# For version 1.x of batch insights
cmd /c @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Azure/batch-insights/master/scripts/1.x/run-windows.ps1'))"
# For latest version of batch insights
cmd /c @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Azure/batch-insights/master/scripts/run-windows.ps1'))"
Note: The script used above just downloads the executable at the BATCH_INSIGHTS_DOWNLOAD_URL
URL and run it in the background. You can download it some other way and start it separately.
Add this command in your start task commandLine
:
/bin/bash -c 'wget -O - https://raw.githubusercontent.com/Azure/batch-insights/master/ubuntu.sh | bash'
Add this command in your start task commandLine
:
/bin/bash -c 'wget -O - https://raw.githubusercontent.com/Azure/batch-insights/master/centos.sh | bash'
cmd /c @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Azure/batch-insights/master/windows.ps1'))"
If you already have a version of python installed you just need to download nodestats.py
and install dependencies
You can add this to your main script:
pip install psutil python-dateutil applicationinsights==0.11.3
wget --no-cache https://raw.githubusercontent.com/Azure/batch-insights/master/nodestats.py
python --version
python nodestats.py > batch-insights.log 2>&1 &
See available configuration options
You can set the AZ_BATCH_INSIGHTS_ARGS
environemnt variable to pass parameters to the tool.
e.g. AZ_BATCH_INSIGHTS_ARGS
> --disable networkIO --aggregation 5
Option 1: Batch Explorer
BatchLabs is a desktop app used to manage, debug and monitor your azure batch accounts. You can download it here If you followed the getting started instruction batchlabs should show you the statistics for each of your pool.
Use the app insights tools to build your own query on the Azure Portal
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.