Scheduled Task using Entra ID Account on Entra-joined VM

Lipke, Harald 1 Reputation point
2024-05-29T07:35:08.5633333+00:00

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.
9,041 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 28,281 Reputation points Microsoft Employee Moderator
    2024-05-29T10:59:44.57+00:00

    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.

    https://learn.microsoft.com/en-us/azure/automation/add-user-assigned-identity

    Create a PowerShell runbook in your Azure Automation account that authenticates to your SQL Managed Instance using the user-assigned managed identity. https://learn.microsoft.com/en-us/azure/automation/learn/powershell-runbook-managed-identity

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

    https://learn.microsoft.com/en-us/azure/automation/quickstarts/create-azure-automation-account-portal

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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.