Receiving 'RunAsAccount not found' with Managed Identity enabled in Azure Automation

Matthew Dailey 21 Reputation points
2022-05-16T13:58:04.84+00:00

I created an Azure Automation account with system assigned Managed Identity and the Start/Stop VM Solution enabled. The 'ScheduledStartStop_Parent' runbook runs at its scheduled time but it throws this error:

et-AutomationConnection : RunAsAccount not found. To create this RunAsAccount, navigate to the RunAsAccount blade and create a RunAsAccount. Refer doc for more details (https://learn.microsoft.com/azure/automation/create-runas-account)At line:211 char:37+ ... icePrincipalConnection=Get-AutomationConnection -Name $connectionName+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Get-AutomationConnection], AssetManagementClientException + FullyQualifiedErrorId : 3,Orchestrator.AssetManagement.Cmdlets.GetAutomationConnectionCmdlet   

The documentation recommends not to use RunAsAccount but its throwing an error telling me to create a RunAsAccount.

Is there an extra configuration step with Managed Identity that I'm missing? How do I solve this error?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,128 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 17,726 Reputation points
    2022-05-17T06:50:05.667+00:00

    @Matthew Dailey Welcome to Microsoft Q & A Community Forum. Yes, its recommended to use Managed Identity for authenticating Azure resources from the runbooks. However, the existing Start Stop Solution uses "RunAsAccount" for authentication. I would suggest you create RunAsAccount for this scenario. For information on how to create RunAsAccount , you can refer this document.

    I assume you have installed Start Stop Solution v1 version. I would like you to know about the next version, which is in preview right now. This new version (v2) offers all the same functionality as this one but is designed to take advantage of newer technology in Azure. It adds some of the commonly requested features from customers, such as multi-subscription support from a single Start/Stop instance.

    Start/Stop VMs during off-hours (v1) will be deprecated soon and the date will be announced once V2 moves to general availability (GA).

    Also, we will update our documentation with the information that you have requested.


0 additional answers

Sort by: Most helpful