Azure Image Builder - Image version name

SenhorDolas 1,146 Reputation points

Very new to this so bear with me.

I have been following up Azure Academy videos on how to setup an AIB pipeline and install apps on my template VM.

This works fine (I have more questions about Azure Repo but I will post separately) but the image version comes out with a funny name, is it possible to name the image version (see pic for example)


Cheers, M

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,085 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
{count} votes

5 answers

Sort by: Most helpful
  1. kobulloc-MSFT 23,336 Reputation points Microsoft Employee

    Welcome to Azure!

    The short answer is that you can't rename resources (it's a popular request) but there's a lot that can be done during the resource creation process and there is a workaround if you find yourself needing to change the name of a resource group.

    What determines my resource name?
    Typically resources are named based on a name you provide either while configuring the resource or based on the resource group. For example, if you were to create a resource group named "AzureVMQuickstart" and then create a VM in the portal named "MyFirstVM", you'd get the following resources:

    • MyFirstVM (Virtual machine)
    • MyFirstVM-ip (Public IP address)
    • MyFirstVM-nsg (Network security group)
    • AzureVMQuickstart-vnet (Virtual network)
    • MyFirstVM_OSDisk_1h3s4bcc97lw204... (Disk)
    • MyFirstVM-13254 (Network interface)

    There are some exceptions to this rule where you'll see a long string of characters for something but in general it's pretty clear what either the resource group name was or the resource name it was created from.

    How do I change my resource or resource group name?
    Changing the names of resource groups or resources once they've been made is one of the more popular requests that's still outstanding:

    Voting on this helps to improve visibility and priority so I would encourage you to vote if you would like to see these features added.

    While you can't change a resource group name, you can move all of the resources from your old resource group to a new resource group with a new name. This can take some time, however, and isn't recommended as part of a normal workflow.

    This is a good writeup on how to move resources from one resource group to another from Steve Sherry:

    As well as another simple CLI/PowerShell example along with an explanation on why this happens by Matthias Güntert:

    As far as resources are concerned, unfortunately those cannot be renamed at this time. Most often you do have some degree of control over the name during creation, however, which should help.

    0 comments No comments

  2. SenhorDolas 1,146 Reputation points

    Sorry, did not see your reply (no alert in my email for some reason)
    Thanks for coming back to me.
    I understand that I cant rename RG and resources but my question was move about the image version naming?
    Since this is created via automation from Azure Image Builder I am guessing it will be an automated name and as such at this stage there is nothing we can do?

    0 comments No comments

  3. kobulloc-MSFT 23,336 Reputation points Microsoft Employee

    @SenhorDolas Thank you again for being patient and sorry for the delay. From the documentation regarding the resource group naming convention:

    Template configurations can be passed using PowerShell, Az CLI, ARM templates and using the Azure VM Image Builder DevOps task, when you submit it to the service we will create an Image Template Resource. When the Image Template Resource is created you will see a staging resource group created in your subscription, in the format: IT_<DestinationResourceGroup><TemplateName>(GUID). The staging resource group contains files and scripts referenced in the File, Shell, PowerShell customization in the ScriptURI property.

    As for the resources and templates, there are a couple key steps regarding naming (using CLI on Windows here as an example):

    # Resource group name - we are using myImageBuilderRG in this example  
    # Name for the image   

    (Paying attention to the value for -n)

    az resource create \  
        --resource-group $imageResourceGroup \  
        --properties @helloImageTemplateWin.json \  
        --is-full-object \  
        --resource-type Microsoft.VirtualMachineImages/imageTemplates \  
        -n helloImageTemplateWin01  

    Let me know if you need more detail here. Additionally, there are some resources that might help (I usually recommend going through the docs when you are first learning about a service):

  4. Schroeder, Michael (CTR) 26 Reputation points

    The answer to this question can be found here:

    Version is specified in the GalleryImageId property of the "distribute" block. Use one of two formats:

    -> Automatic versioning - This is the automatic version number you are seeing. The format is:

    -> Explicit versioning - This is what you're after. It allows you to specify the version number. The format is:
    /subscriptions/<subscriptionID>/resourceGroups/<rgName>/providers/Microsoft.Compute/galleries/<sharedImageGalName>/images/<imageDefName>/versions/<version - for example: 1.1.1>

    0 comments No comments

  5. SenhorDolas 1,146 Reputation points

    Hi Everyone,

    I see that there is a way of specifying Image version name via json but is there a way for the "Azure VM Image Builder Task" which I use from DevOps?

    On a separate note, how do I create a json script based on what I have setup in AIB task? I really don't know how to make the transition which I think I need to cos the task is very limited?

    Thanks Everyone

    0 comments No comments