Author : MD TAREQ HASSAN | Updated : 2020/11/11

What is batch service?

Usage

Concepts

Steps in a common Batch workflow

Steps in a common Batch workflow

[Image courtesy: Microsoft docs]

Batch job using PowerShell

Login-AzAccount       # Login-AzureRmAccount 

Get-AzSubscription    # Get-AzureRmSubscription

Set-AzContext -SubscriptionName "IaaS for Devs" # Set-AzureRmContext

$location = "westus"
$rgName = "batch-ps-rg"
$acctName = "storageacctps99999"
$batchAcctName = "batchacctps201999"

New-AzResourceGroup -Name $rgName -Location $location 

$storageAcct = New-AzStorageAccount -ResourceGroupName $rgName `
            -Name $acctName `
            -Location $location `
            -SkuName Standard_LRS `
            -Kind StorageV2

New-AzBatchAccount -ResourceGroupName $rgName `
            -Name $batchAcctName `
            -Location $location `
            -AutoStorageAccountId $storageAcct.Id

Batch job using Azure CLI

az login

az account list --output tsv

az account set --subscription "IaaS for Devs"

az group create --name batch-cli-rg --location westus

az storage account create \
    --resource-group batch-cli-rg \
    --name storageacctcli12342 \
    --location westus2 \
    --sku Standard_LRS

az batch account create \
    --name batchacctcli12342 \
    --storage-account storageacctcli12342 \
    --resource-group batch-cli-rg \
    --location westus2

Batch job using .Net

https://docs.microsoft.com/en-us/azure/batch/quick-run-dotnet