Dear All,
I need your help to restart the Azure backup agent (Windows and Linux ) using azure PowerShell.
Dear All,
I need your help to restart the Azure backup agent (Windows and Linux ) using azure PowerShell.
@KalaimaniThirupathi-5306 MARS Agent is a Windows app.....doesn't work on Linux.
May I know the exact scenario/purpose for restarting Azure backup agent using PowerShell?
Dear @SadiqhAhmed-MSFT Backup is failing due to the agent not being ready state.
@KalaimaniThirupathi-5306 The title on this thread is just confusing, as there is no MARS version for Linux .
For any windows service you can use the command Get-Service and then pipe the result into Stop-Service or Start-service.
Examples:
Get-Service obengine | stop-service
Get-Service obengine | start-service
If the response helped, do "Accept Answer" and up-vote it.
Here are the solution to reboot the agent services.
CLI:
az vm extension set --resource-group rgName --vm-name vmName --name CustomScript --publisher Microsoft.Azure.Extensions --version 2.0 --settings '{"commandToExecute": "systemctl restart waagent.service or systemctl restart walinuxagent.service based on the distro"}'
PowerShell:
Set-AzureRmVMExtension -ResourceGroupName <resourceGroupName> -VMName <vmName> -Location <location> -Publisher Microsoft.Azure.Extensions -ExtensionType CustomScript -Name CustomScript -TypeHandlerVersion 2.0 -SettingString '{"commandToExecute": "systemctl restart waagent.service or systemctl restart walinuxagent.service based on the distro"}'
@KalaimaniThirupathi-5306 Thanks for sharing the solution. This would certainly be helpful to others on this community.
Your question is already answered, Please follow the below url.
https://stackoverflow.com/questions/58688682/using-powershell-can-we-do-automation-script-to-auto-restart-the-azure-vm-agent
If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.
5 people are following this question.