capturing image and installing software's on VM and then capture image and later again some softwares - any automation process?

sns 9,236 Reputation points
2023-11-16T18:11:40.44+00:00

We take image and build VM, and then we install required softwares in VM and then capture image

we do this process too often and is there any way to automate this process.?

I heared the there is a service "Azure Image Builder" in the azure

can we use azure image build in my case? if yes how to use and at what stage we use? can you give me highlevel steps?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,105 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,366 Reputation points Microsoft Employee
    2023-11-16T18:47:34.54+00:00

    Hello, @sns !

    How do I automate the VM creation process?

    You are correct, VM Image Builder would be the recommended solution for automating VM image creation when configuring security, settings, and necessary software. VM Image Builder only requires that you create a configuration that describes your image and the service takes care of the rest:

    You just need to manage the image configuration and the images you’d like to have, Azure VM Image Builder service will take care of the rest for you

    (Management when using VM Image Builder)

    To create a Windows VM, you would do the following at a high level. While initially this looks like a lot of steps, most of this is initial setup, resource group configuration, and verification:

    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/image-builder

    1. Register the providers: This registers the VM Image Builder feature.
    2. Set variables: These will be used to store configuration settings.
    3. Create a resource group: This will be used to store the image configuration template artifact and the image.
    4. Create a user-assigned identity and set permissions for the resource group: VM Image Builder uses user-identity to inject the image in the resource group.
    5. Create a user-assigned managed identity and grand permissions: This allows VM Image Builder to access the storage account where the script is stored.
    6. Download the image configuration template: We've created a JSON configuration template that is used with the variables created above.
    7. Create the image: Submit the image configuration to the VM Image Builder service.
    8. Start the image build: Starts the image-building process.
    9. Create the VM: Creates the VM.
    10. Verify the customization: RDP to the VM to verify the customization.

    Additional reading:


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.