Customer request was to have a mechanism to provide Azure AD users temporary access to databases, in the case of support requests, application development, etc. The following solution uses a Logic App that is triggered by a new Microsoft Form response, where the user to request access. The Logic App connects to two Azure Automation runbooks to give access to the requested user, then remove access after the specified length of time.
-
Create an Azure Automation account with Run As account (service principal)
-
Give Service Principal Azure AD Admin permissions to SQL Server
-
Add runbooks from this repo to Azure Automation account
Provide access
Remove access -
Create Logic App