question

JanVavra avatar image
0 Votes"
JanVavra asked BrunoR-7105 answered

Automation task in Azure doesn't start nor stop a machine

At Azure portal at a one specific Azure VM with Windows I've configured two Automated task. One for starting at 8 am and another at 6 pm to stop.
These tasks are not working. I receive only email with error report.

Your automation task failed to start virtual machine adclient
Your automation task failed to stop virtual machine adclient (obviously because the VM is not running)

azure-virtual-machines
· 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.

@JanVavra Any updates on the issue?

Please "Accept as Answer" if below helped so it can help others in community looking for help on similar topics.

Thanks

0 Votes 0 ·
learn2skills avatar image
0 Votes"
learn2skills answered

@JanVavra

I am using Automation Runbook: start-stop-vms

Configure Start/Stop VMs during off-hours

Go to automation>Runbook>Jobs ( if still existing jobs is running click stop)

55079-capture.jpg




Please don’t forget to "Accept the answer" and up-vote wherever the information provided helps you, this can be beneficial to other community members.



capture.jpg (65.1 KiB)
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.

SumanthMarigowda-MSFT avatar image
0 Votes"
SumanthMarigowda-MSFT answered

@JanVavra For a better understanding of the issue: When did the problem start? Was it working fine before?
May I know which version of OS(version) are you using? Can you share the screenshot of the error message?
I would suggest ensuring you have all Windows updates applied to the VMs you are seeing the issue with.

This article provides information on troubleshooting and resolving issues that arise when you deploy the Azure Automation Start/Stop VMs during off-hours feature on your VMs: https://docs.microsoft.com/en-us/azure/automation/troubleshoot/start-stop-vm

Please refer to this Stack Overflow threads which gives some ideas on your query
https://stackoverflow.com/questions/30574146/whats-the-right-way-to-run-startup-task-for-azure-virtual-machine
https://stackoverflow.com/questions/62551801/task-scheduler-windows-server-2019-task-not-running-onstart

Hope this helps!

Kindly let us know if the above helps or you need further assistance on this issue.


Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

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.

JanVavra81 avatar image
0 Votes"
JanVavra81 answered learn2skills commented

@learn2skills

I haven't made any automation account. I started from vm properties | Automation | Tasks (preview) | clicked Add

55381-obrazek.png



Is that way bad and I should go your way?


obrazek.png (13.1 KiB)
· 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.


got it your using start/stop VM in Automation>Tasks (preview). But still this option is in preview.

I am not tested on the above option. Suggested to use Automation>Runbook here it is easy and more convenient
.

0 Votes 0 ·
JanVavra81 avatar image
0 Votes"
JanVavra81 answered SumanthMarigowda-MSFT commented

@Sumarigo-MSFT
It is a Windows 10.

Should I make an Windows account in the VM?

· 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.

@JanVavra Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. If the issue still persist!
I wish to engage with you offline for a closer look and provide a quick and specialized assistance, please send an email with subject line “Attn:subm” to AzCommunity[at]Microsoft[dot]com referencing this thread and the Azure subscription ID, I will follow-up with you. Once again, apologies for any inconvenience with this issue.
Thanks for your patience and co-operation.

0 Votes 0 ·
ArgoZhang avatar image
0 Votes"
ArgoZhang answered Superapp-9715 commented

@JanVavra
same issue

Status code: 401
Body:
{
"error": {
"code": "InvalidAuthenticationTokenTenant",
"message": "The access token is from the wrong issuer 'https://sts.windows.net/XXXXXX/'. It must match the tenant 'https://sts.windows.net/XXXXXXX/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/XXXXXXX' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."
}
}

· 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.

Hi, were you able to solve it?

It seems that there are 2 ways to do this:

1) Creating an Automation account, then execure runbook "Start/Stop VMs during off-hours" (https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management-config)

2) Through Logic Apps or Tasks (preliminary version), as @ArgoZhang is trying. This is what I'm trying too, and I get the same error.

Any idea on how to proceed?

0 Votes 0 ·
BrunoR-7105 avatar image
0 Votes"
BrunoR-7105 answered

No, no, no, bla bla bla, too much complications, Runbook definitly don't work or does not need to anything.

I can stop my VM by choosing "Automtic Stop" in "Operations" menu.
Why, tell me why I don't have the same way to start my VM ?

The result of execution of Logic App tells me also this horrifying message

{
"error": {
"code": "InvalidAuthenticationTokenTenant",
"message": "The access token is from the wrong issuer 'https://sts.windows.net/xxx-xxx-xxx'. It must match the tenant 'https://sts.windows.net/xxx-xxx-xxx/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/xxx-xxx-xxx' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."
}
}

Automatic help tells me to "reallocate my machine" ! Why ? To cost me more ?

This make me lost my time and my money reading thousands and thousands of pages about automation and certificate that are good or not.

Please, find a solution I need a real help.

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.