Scheduled Task using Entra ID Account on Entra-joined VM

Lipke, Harald 1 Reputation point

we have a Windows2022 server on Azure - Entra ID joined only (not hybrid joined!)
we want ro run a batch job that authenticates to SQL Managed Instance

How can we assign an Entra-Only User account to the scheduled task? We only manage to use local accounts here - who cannot authenticate to the database.

So basically its about: How can I use an entra id account in a scheduled task on entra joined VM?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,370 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,087 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 22,921 Reputation points

    Hi @Lipke, Harald

    Thank you for reaching out to the Microsoft Q&A platform.

    I can suggest you some steps on high level here along with relevant document links to support you.

    To use an Entra-only user account in a scheduled task on an Entra-joined VM, you can create a user-assigned managed identity for your Azure Automation account and use it to access other resources, such as your SQL Managed Instance.

    Create a PowerShell runbook in your Azure Automation account that authenticates to your SQL Managed Instance using the user-assigned managed identity.

    Create a scheduled job in your Azure Automation account that runs the PowerShell runbook at the desired frequency

    If I have answered your query, please click "Accept as answer" as a token of appreciation