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

K Thiru 21 Reputation points
2021-06-10T11:57:12.14+00:00

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,263 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,842 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,114 questions
{count} votes

Accepted answer
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2021-06-11T20:03:58.127+00:00

    Hi @K Thiru ,

    it's "complex" but it is possible to start an Azure Automation Runbook with an Azure Function:
    https://wintellisys.com/use-azure-function-to-start-azure-automation-runbook/

    Azure Automation is able to run on a Hybrid Worker and this way you are able to access an on-premises AD:
    https://learn.microsoft.com/en-us/azure/automation/automation-hybrid-runbook-worker

    ----------

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

    Regards
    Andreas Baumgarten


2 additional answers

Sort by: Most helpful
  1. MayankBargali-MSFT 68,476 Reputation points
    2021-06-11T10:17:31.347+00:00

    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
    2021-07-20T11:40:41.847+00:00

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