Attach a script to a custom image that run at deployment

Matthieu Noiret 26 Reputation points
2020-09-25T10:38:43.13+00:00

Hi,

My objective is to create a custom image that automatically install a certain product on the VM.

The problem is that some installation settings are depending on the configuration of the computer so I need to run the installation script at deployment.

I didn't find any features on the Azure platform which allows me to do that so if anyone as an idea ?

Thank you,

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

Accepted answer
  1. ChristopherW-MSFT 1,601 Reputation points
    2020-09-28T18:35:16.72+00:00

    Hi @Matthieu Noiret

    Azure VM's Custom Script Extension should do the trick: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-automate-vm-deployment
    If you're able to run the Installation through PowerShell in the VM, then the Custom Script Extension will automatically run it after Startup.

    Windows Task Scheduler can also be setup to automatically run PowerShell on Startup, or Software Installation.

    And another solution would be to use GPO for Domain Joined machines: https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/use-group-policy-to-install-software


0 additional answers

Sort by: Most helpful