About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation page demonstrates a Windows bias by providing only a Windows-based VM image example (using 'MicrosoftWindowsServer' and 'batch.node.windows amd64') in the C# SDK sample, with no equivalent Linux example. The documentation also references Windows-specific node agent SKUs and omits any mention of Linux VM images or node agents. No Linux command-line or configuration examples are provided, and the only detailed code sample is Windows-centric.
Recommendations:
- Add parallel examples for updating pools with Linux VM images (e.g., using Ubuntu or CentOS publishers and SKUs) and the corresponding Linux node agent SKU.
- Explicitly mention both Windows and Linux options when discussing VM image configuration, including sample values for each.
- Provide at least one code sample or REST API example that demonstrates updating a pool to use a Linux image.
- Reference Linux tools, patterns, or considerations where relevant, ensuring parity in guidance for both platforms.
Create pull request
Flagged Code Snippets
public async Task UpdatePoolVmImage()
{
// Authenticate
var clientId = Environment.GetEnvironmentVariable("CLIENT_ID");
var clientSecret = Environment.GetEnvironmentVariable("CLIENT_SECRET");
var tenantId = Environment.GetEnvironmentVariable("TENANT_ID");
var subscriptionId = Environment.GetEnvironmentVariable("SUBSCRIPTION_ID");
ClientSecretCredential credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
ArmClient client = new ArmClient(credential, subscriptionId);
// Get an existing Batch account
string resourceGroupName = "<resourcegroup>";
string accountName = "<batchaccount>";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// Update the pool
string poolName = "mypool";
BatchAccountPoolData data = new BatchAccountPoolData()
{
DeploymentConfiguration = new BatchDeploymentConfiguration()
{
VmConfiguration = new BatchVmConfiguration(new BatchImageReference()
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2022-datacenter-azure-edition-smalldisk",
Version = "latest",
},
nodeAgentSkuId: "batch.node.windows amd64"),
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
BatchAccountPoolData resourceData = result.Data;
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}