Access on-premise active directory from Azure functions/logic apps

K Thiru 21 Reputation points

I'm in the process of integrating the HR system and Active directory which involves creating new users, updating existing user attributes, and disabling users in AD.

We have an on-premise Active Directory and use the Azure AD Connect to sync the Azure Active directory. We also have a domain controller in Azure VM. I have checked with the (on-premises data gateway - logic app) and (hybrid connection - azure function) both don't support on-premise active directory.

Any idea or workaround will be helpful to connect on-premise active directory or Azure VM domain controller from azure functions/logic apps etc.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,486 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,934 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,159 questions
{count} votes

Accepted answer
  1. Andreas Baumgarten 99,466 Reputation points MVP

    Hi @K Thiru ,

    it's "complex" but it is possible to start an Azure Automation Runbook with an Azure Function:

    Azure Automation is able to run on a Hybrid Worker and this way you are able to access an on-premises AD:


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

2 additional answers

Sort by: Most helpful
  1. MayankBargali-MSFT 69,846 Reputation points

    Hi @K Thiru

    You can not connect to your on premise active directory using azure function/logic app. But you can use Microsoft Graph API for Azure Active Directory. You can call the REST API endpoint from azure function/logic app.

    AFAIK sync is only possible from On-prem AD to Azure AD and vice versa only few attributes (password, exchange password) that are synced back but not entire user object. If you are looking that you can create user in Azure AD and that can sync with on prem AD then that is not possible.

  2. K Thiru 21 Reputation points

    I have connected the active directory in on-prem and azure VM using vnet connection in azure function and it worked perfectly.