Skip to content

Instantly share code, notes, and snippets.

@jsturtevant
Created September 28, 2023 23:13
Show Gist options
  • Save jsturtevant/8aca7a7335664d4fac277f1a2f192527 to your computer and use it in GitHub Desktop.
Save jsturtevant/8aca7a7335664d4fac277f1a2f192527 to your computer and use it in GitHub Desktop.
upload a vhd to a sig
$location="eastus"
$galleryName="SigWinTestingImages"
$resourceGroup="annual-channel"
$imageDefinition="capi-windows-annual"
$publisher="sigwincapi"
$offer="annualChannel"
$sku="original"
$storageAccountName="sigwin"
$subscription=""
$storageContainer="annualchvhd"
az storage account create `
--name $storageAccountName `
--resource-group $resourceGroup `
--location $location `
--sku Standard_LRS `
--encryption-services blob
az storage container create `
--account-name $storageAccountName `
--name $storageContainer `
--auth-mode login
az storage blob upload `
--account-name $storageAccountName `
--container-name $storageContainer `
--name 23H2_25951.vhd `
--file 23H2_25951.vhd `
--auth-mode login
az sig create --resource-group $resourceGroup --gallery-name $galleryName
az sig image-definition create `
--resource-group $resourceGroup `
--gallery-name $galleryName `
--gallery-image-definition $imageDefinition `
--publisher $publisher `
--offer $offer `
--sku $sku `
--os-type Windows `
--os-state generalized
az sig image-version create --resource-group $resourceGroup `
--gallery-name $galleryName --gallery-image-definition $imageDefinition `
--gallery-image-version 1.0.0 `
--os-vhd-storage-account "/subscriptions/$subscription/resourceGroups/$resourceGroup/providers/Microsoft.Storage/storageAccounts/$storageAccountName" `
--os-vhd-uri "https://$storageAccountName.blob.core.windows.net/$storageContainer/23H2_25951.vhd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment