Automating CURL Installation on Multiple Azure VMs

razec18 220 Reputation points
2024-10-04T02:18:29.4466667+00:00

Hello everyone,

I'm looking for a way to automate the installation of CURL on multiple Azure virtual machines efficiently. I would appreciate any suggestions or best practices on how to achieve this in a simple manner.

Additionally, I have a question: Is it possible to deploy CURL via Group Policy Objects (GPO) as well? If so, I would love to hear about the steps or considerations involved.

Thank you in advance for your help!

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,070 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,306 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
999 questions
{count} votes

Accepted answer
  1. Sai Krishna Katakam 1,085 Reputation points Microsoft Vendor
    2024-10-04T06:05:08.4566667+00:00

    Hi João Vitor do Prado Maia,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To automate the installation of CURL on multiple Azure virtual machines, you can use the Azure Run Command feature. This feature allows you to run scripts on your Azure VMs remotely using the Azure portal, REST API, Azure CLI, or PowerShell. Here’s a step-by-step guide:

    Using Azure Run Command with PowerShell:

    • Make sure you have the Azure PowerShell module installed.
    • Use the Invoke-AzVMRunCommand cmdlet to run a script on your VMs. Here’s an example script to install CURL on multiple VMs in a specific resource group:
    # Set your Azure subscription
    Set-AzContext -Subscription "your-subscription-id"
    # Get all running VMs in the resource group
    $vms = Get-AzVM -ResourceGroupName "your-resource-group" -Status | Where-Object {$_.PowerState -eq "VM running"}
    # Script to install CURL
    $script = @"
    sudo apt-get update
    sudo apt-get install -y curl
    "@
    # Run the script on each VM
    $vms | ForEach-Object {
        Invoke-AzVMRunCommand -ResourceGroupName $_.ResourceGroupName -Name $_.Name -CommandId 'RunShellScript' -ScriptString $script
    }
    

    Using Azure Custom Script Extension:

    • The Custom Script Extension can be used to download and execute scripts on Azure VMs. This is useful for post-deployment configuration and software installation.
    • You can provide the script directly in the Azure portal or store it in an Azure Storage account or GitHub.
    • For more detailed information, you can refer to the documentation on Use infrastructure automation tools with virtual machines in Azure.

    Deploying CURL via Group Policy Objects (GPO):
    Yes, you can deploy CURL using GPO, but it requires CURL to be packaged as an .msi file.

    • Repackage CURL if necessary, place it in a shared folder, and configure GPO to deploy the software to your target machines.
    • You can find the steps for deploying software using GPO in this document Assign Computer Startup Scripts.

    If you have any further queries, do let us know. If the comment is helpful, please click "Upvote".

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.