We are planning to implement Local Administrator Password Solution, but the first thing I wondered was how inconvenient it would be for support engineers and helpdesk staff to retrieve LAPS account and password. Log into the Intune portal, navigate to the devices tab, search for the device, and dig through the properties to find the LAPS password — every single time they need an admin account. That had to be faster.
So (with some help of a good friend) I built the LAPS Portal: an Azure Web App with an Azure Function App as the backend, secured by two app registrations for authentication and Graph API calls. It runs at no extra cost and works on any device. Especially useful when you’re standing next to a device in the field and need the LAPS account and password right then and there — just open the portal on your phone, type the device name, and you’re done.
Resource group:rg-laps-data-portal (the RG your create before)
Name:law-laps-data-portal (name you prefer)
Region: West Europe (your desired region)
Click Review + create → Create
Once created, open Azure Cloud Shell
Choose PowerShell when asked.
Run the following script to retrieve the Workspace ID and Primary key:
$law = Get-AzOperationalInsightsWorkspace -ResourceGroupName "rg-laps-data-portal" -Name "law-laps-data-portal"; Write-Host "Workspace ID: $($law.CustomerId)"; Write-Host "Primary Key: $((Get-AzOperationalInsightsWorkspaceSharedKey -ResourceGroupName "rg-laps-data-portal" -Name "law-laps-data-portal").PrimarySharedKey)"
Note both output values — you will need them in Step 4 for the Function App environment variables
Note/copy the URL from Default domain on the Overview page — you need this in the next step.
Step 6: Create the App Registration for the Frontend
This app registration is required before you can enable App Service Authentication in Step 8. You need the Web App URL from Step 5 to complete this step.
Go to Entra ID → App registrations → + New registration
Name:LAPS-Portal-frontend (name your prefer)
Supported account types: Single tenant only
Click Register
Note the Application (client) ID — you will need this in Step 8
Go to Manage → Authentication(Preview) → + Add Redirect URI
Choose Web (not SPA)
Enter Redirect URI: https://<default-domein-url-from-step-5>/.auth/login/aad/callback
Check ID tokens
Click Configure.
Grant admin consent to prevent permission prompts
To ensure no users in your tenant see a permissions consent prompt when opening the portal:
Go to Permissions → click Grant admin consent for <your tenant>
Click Yes.
Remove the permission:
Step 7: Deploy the Frontend
Go to App services → Open the web app your created in step 5 → Development Tools → Advanced Tools → Go → (opens Kudu)
Open File Manager → navigate to site/wwwroot
Drag and drop index.html and proxy.php from the GitHub repo into the file manager and delete hostingstart.html.
NOTE: Do not upload the files but drag and drop them, because then an upload glitch can happenas you can see below.
Correct upload:
Wrong upload:
proxy.php acts as a server-side proxy between the browser and the Azure Function. The real Function URL and key are stored as a Web App environment variable (FUNCTION_URL) and never exposed to the browser.
Add the FUNCTION_URL environment variable to the Web App
Go to the Web App (laps-data-portal) → Settings → Environment variables → App settings → + Add:
+ 2h converts UTC to Central European Summer Time (CEST). Use + 1h in winter (CET).
It can take up to 30 min. after the first retrieve from the portal before the log query returns data.
Save the query via Save → Save as query so you don’t have to retype it. You can also pin the results to your Azure dashboard via Pin to → Azure dashboard for quick daily access.
Conclusion
With just a few Azure resources and no custom authentication code, you now have a secure, mobile-friendly LAPS portal that any authorized helpdesk engineer or IT administrator can use from anywhere — whether they’re at their desk or standing next to a device in the field.
No more navigating through the Intune portal to find a LAPS password. Just open the portal, type the device name, and you’re done.
A few things to take away from this build:
App Service Authentication secures the portal without writing any authentication code — Azure handles the entire login flow automatically.
Store secrets as Function App environment variables, never hardcoded in scripts — this keeps sensitive credentials out of your source code and version control.
Every lookup is logged with the caller’s UPN, device name, IP address, and result — giving you full accountability and a clear audit trail of who accessed what and when.
Don’t forget to configure Conditional Access with MFA and a session timeout — this adds an important extra layer of security on top of the portal authentication.
The first start/sign in to the LAPS portal can take a bit longer. When the Function App has been idle for a while, Azure deallocates the underlying infrastructure to save resources. The first request after a period of inactivity forces Azure to spin up the PowerShell runtime again, which takes 10–30 seconds.
The total Azure cost for normal internal use is effectively zero — the Function App runs on a Consumption plan and the Web App on a free F1 tier.
Flowchart
So I put all the created components and their relationships into a flowchart.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.