Open In App

Microsoft Azure – Install Guest Configuration Extension for Linux

Improve
Improve
Like Article
Like
Save
Share
Report

Pre-requisite:- Azure

Azure is Microsoft’s cloud platform, just like Google has its Google Cloud and Amazon has its Amazon Web Service or AWS.000. Generally, it is a platform through which we can use Microsoft’s resources. 

Here in this article, we will show how to install guest configuration agents on Linux virtual machines in Azure using PowerShell commands or scripts in simple easy steps. To implement this activity one should require Contributor or Virtual Machine Administrator roles on the target azure resource to install the Linux guest agent on VM. Let’s get started with the implementation.

Implementation

Step 1: Log in to Azure Portal.

Step 2: Access the Azure Cloud Shell and Switch to PowerShell Terminal.

powershell

 

Step 3: Now Create a new file using touch installGuestAgent.ps1

touch installLinuxGuestAgent.ps1

Step 4:- use code to write the code and paste the mentioned command into the file

code installLinuxGuestAgent.ps1

Note: Now in the code add the VM Name, Resource Group, and VM Location values of choice that you wish to install on the Linux VM.

Set-AzVMExtension -Publisher 
'Microsoft.GuestConfiguration' 
-Type 'ConfigurationforLinux' `
-Name 'AzurePolicyforLinux' 
-TypeHandlerVersion 1.0 
-ResourceGroupName ' add rgroup ' `
-Location ' add vm location 
' -VMName ' add vm name ' 
-EnableAutomaticUpgrade $true
query in powershell

 

Step 5: Save the file and run the code. Use the following command to run the code.

./installLinuxGuestAgent.ps1
Save the file and run the code

 

Step 6: Go to your target Azure VM and check the Extensions + applications. You should see this “AzurePolicyforLinux” extension on Azure VM if successful.

output

 

This is how you can install a guest configuration extension for Linux in Azure.


Last Updated : 31 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads