question

GVS avatar image
0 Votes"
GVS asked shivakumarky answered

Services start/stop automatically in azure

Hi , Anyone please help me to know how to start a service if stopped in windows azure VM automatically without manual intervention

azure-virtual-machines
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
Do you mean a service within the Virtual machine, or the Azure Service of the the Virtual Machine stopped?

0 Votes 0 ·

service within the machine i mean everyday com+ service gets stopped so i need to logon to machine and start service instead of this if azure runbook or any thing which help us to start the service automatically it really helps

0 Votes 0 ·

@AzureisMyCareer-5423 Any update on the issue?

Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics

0 Votes 0 ·
TKujala avatar image
0 Votes"
TKujala answered

Hi @AzureisMyCareer-5423,


Open the Service management console on the server.


Start --> Run --> services.msc


Select the correct service and the Recovery tab.


Select First failure --> Restart the Service.


11378-restart-the-service.jpg




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered HLaguide commented

Much more bullet proof method is to script it something like this and run as a periodic scheduled task.

https://gallery.technet.microsoft.com/scriptcenter/f6449995-6fd3-4a37-8afd-bcc7f5388c6b


--please don't forget to Accept as answer if the reply is helpful--


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management


Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello,

This script is it also available to start Azure Analysis service ?

0 Votes 0 ·
shivakumarky avatar image
0 Votes"
shivakumarky answered

Hi,

Even i have not came across any solution so far to start services when they got stopped. One solution is to configure restart service on failure and i was thinking of building below solution.
1. Implement Change Tracking in Automation Account for your VM's which are reporting to workspace
2. Create a Log analytics alert to trigger the alert whenever any VM service goes down. Instead of triggering the email alert, trigger a runbook action.
3. Configure the runbook to utilize common schema alert and based on the values in the alert, runbook should invoke the "run command" on VM directly to start the service which is stopped. Or we can try to use custom script extension or desired state configuration based on our solution requirement.
4. If the runbook could not start the service then it should trigger the alert to IT Team to check and resolve the issue.





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.