summary import { GalleryImage , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateASimpleGalleryImage ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const galleryName = "myGalleryName" ; const galleryImageName = "myGalleryImageName" ; const galleryImage = { hyperVGeneration : "V1" , identifier : { offer : "myOfferName" , publisher : "myPublisherName" , sku : "mySkuName" } , location : "West US" , osState : "Generalized" , osType : "Windows" } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . galleryImages . beginCreateOrUpdateAndWait ( resourceGroupName , galleryName , galleryImageName , galleryImage ) ; console . log ( result ) ; } createOrUpdateASimpleGalleryImage ( ) . catch ( console . error ) ;