Microsoft.Azure.Batch 16.2.0

The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved
dotnet add package Microsoft.Azure.Batch --version 16.2.0
NuGet\Install-Package Microsoft.Azure.Batch -Version 16.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Azure.Batch" Version="16.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Azure.Batch --version 16.2.0
#r "nuget: Microsoft.Azure.Batch, 16.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.Azure.Batch as a Cake Addin
#addin nuget:?package=Microsoft.Azure.Batch&version=16.2.0

// Install Microsoft.Azure.Batch as a Cake Tool
#tool nuget:?package=Microsoft.Azure.Batch&version=16.2.0

License notes

The Azure Batch C# client is now under the MIT license. Prior to March 10 2017 it was under the Apache 2.0 license.

Azure Batch SDK developer guide

Microsoft.Azure.Batch.sln is your one stop shop for all things related to the Azure Batch C# client library. This solution file contains all of the projects affiliated with the Azure Batch client (including testing and tooling).

Changing the Azure Batch client

Depending on the type of change you want to make, the work required varies. If you follow this process you shouldn't miss anything:

  1. Update the Azure Batch Swagger specification, which resides in the Azure/azure-rest-api-specs GitHub repository (specifically here)
    • Add new entity types into the Swagger specification.
    • Add new APIs as path-verb pairs in the Swagger specification.
    • Add/remove properties on existing entity types in the Swagger specification.
  2. Regenerate the src\GeneratedProtocol folder using the steps below.
  3. Update the corresponding convenience layer specification file(s) located in Tools\ObjectModelCodeGenerator\Spec.
    • Add new entities that match the Swagger defined entities.
    • Add/remove properties on existing entities as done in the Swagger specification.
    • Ensure that documentation is properly updated to reflect changes made in the Swagger specification (it usually helps to look at a diff of the Swagger for the API version in question).
  4. Regenerate the src\Generated folder from the convenience layer specification file using the steps below.
  5. Add any custom code on the Generated objects into partial classes located in the src directory.
    • You might want to do this to add an [Obsolete] attribute or to add some helper factory methods.
  6. If any APIs have changed, or if new APIs have been added, you must update the following places:
    • The src\IProtocolLayer.cs interface.
    • The src\ProtocolLayer.cs class.
    • The corresponding operations class, for example PoolOperations.cs.
    • The corresponding entity which the operation is performed on, for example CloudPool.cs.
  7. Add tests for your new models and APIs into the correct test projects.
    • Azure.Batch.Unit.Tests for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins.
    • BatchClientIntegrationTests for integration tests. These tests run against a live Azure Batch endpoint and do not run during CI. See running the end to end tests for more details about how to run these tests.
    • Note: You should prefer to add unit tests over integration tests where possible -- integration tests should be reserved for ensuring that the Batch Service accepts the Swagger requests. Testing service behavior should occur in a service test, not the client.
  8. Update the file and the Version tag in src/Microsoft.Azure.Batch.csproj. Ensure that if you are making a breaking change, you update the major version of the version number.
  9. Run the tests and ensure that they pass.
  10. Open a PR to

Generate the src\GeneratedProtocol folder using AutoRest

The GeneratedProtocol folder holds the code generated by the AutoRest tool from a Swagger specification. The AutoRest tool has a command line interface of its own which you can use directly, or you can run powershell Start-AutoRestCodeGeneration -ResourceProvider "batch/data-plane" -SdkRepoRootPath "<path to root of this repo>" -AutoRestVersion "latest" -SdkGenerationDirectory "<path to root of this repo>\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol" -ConfigFileTag "package-2020-03.11.0"

Generate the src\Generated folder

This folder contains the convenience layer models for Azure Batch. It is generated from a custom tool. The custom tool reads all of the specification files located in Tools\ObjectModelCodeGenerator\Spec. The convenience layer models require more metadata than the Swagger specification provides, so this file is an extra mapping layer on top of Swagger which provides more detail. Note: These specification files are all about the models, they have nothing to do with the actual APIs.

  1. New entities defined in the Swagger specification have to be added here as well. See an existing entity for an example.
  2. If the type or name of a property has changed in the underlying Swagger specification, it should be updated here as well.

There are a number of special flags which have meaning in the specification files. The easiest way to see a list of what flags are supported and at what level is to look at the backing code generation code:

  1. For properties: Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs
  2. For types: Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\ObjectModelTypeData.cs

Once you have added and updated the required files in Tools\ObjectModelCodeGenerator\Spec mark the ObjectModelCodeGenerator as your startup project in Visual Studio and run it -- it will regenerate the contents of the src\Generated folder.

Running the end to end tests

A full end to end test pass takes 20-40 minutes. The following environment variables must be set for the the end to end tests to work - it is recommended to set up a script which sets these all so that it can easily be reused later:

  1. MABOM_BatchAccountEndpoint: The endpoint for your Batch account, i.e. https://<account>.<region>
  2. MABOM_BatchAccountSubscriptionId: The subscription id that your Batch and Storage accounts are in. Please note your storage account and your Batch account need to be in the same subscription.
  3. MABOM_BatchAccountResourceGroupName: The resource group your Batch account is in.
  4. MABOM_BatchAccountName: The name of your Batch account.
  5. ​MABOM_BatchAccountKey: The key of your Batch account.
  6. MABOM_StorageAccountResourceGroupName: The name of the resource group of your storage account.
  7. MABOM_StorageAccount: The name of your storage account.
  8. MABOM_StorageKey: The key to your storage account.
  9. MABOM_BlobEndpoint: The blob endpoint for the storage account, i.e. https://<account>
  10. MABOM_BatchManagementEndpoint: The management endpoint for the tenant you are targeting. This will usually be
  11. MABOM_AzureAuthenticationClientId: The client ID of an AAD App Registration with contributor access to the subscription you're using (#2).
  12. MABOM_AzureAuthenticationClientSecret: The secret for the App Registration (#11).

If running the tests against a test tenant, you also must set:

  1. MABOM_BatchTRPExtraHeaders to x-ms-version=2015-12-01;
  2. MABOM_BatchTRPCertificateThumbprint: The thumbprint used to authenticate with the Batch Resource Provider.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.4 is compatible.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Microsoft.Azure.Batch:

Package Downloads
Microsoft.Azure.Batch.Conventions.Files The ID prefix of this package has been reserved for one of the owners of this package by

This library encapsulates a set of storage conventions for Azure Batch task and job outputs, making it convenient for clients to browse and retrieve outputs by task and job id and the type of output.

Microsoft.Azure.Batch.FileStaging The ID prefix of this package has been reserved for one of the owners of this package by

This library simplifies uploading resource files for use by tasks in the Microsoft Azure Batch service. Visit our home page for more detail - For technical overview, see API reference can be found at


Package Description

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on Microsoft.Azure.Batch:

Repository Stars
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at or our versioned developer docs at
Microsoft Azure PowerShell
Azure Batch and HPC Code Samples
Microsoft Genomics implementation of the Broad Institute's Cromwell workflow engine on Azure
ApsimX is the next generation of APSIM
Version Downloads Last updated
16.2.0 38,766 2/29/2024
16.1.0 29,369 1/27/2024
16.0.0 163,061 6/15/2023
15.4.0 230,448 11/1/2022
15.3.0 352,870 1/14/2022
15.1.0 252,902 8/11/2021
15.0.0 16,227 7/31/2021
14.0.0 352,064 9/29/2020
13.0.0 290,811 3/6/2020
12.0.0 199,797 8/7/2019
11.0.0 145,951 6/6/2019
10.1.0 88,148 2/25/2019
10.0.0 74,502 12/14/2018
9.0.1 81,347 11/2/2018
9.0.0 45,751 8/24/2018
8.1.2 115,077 5/24/2018