Organizations subject to UK GDPR (per ICO guidance), EU GDPR, or California’s CCPA/CPRA regulations can use the DSAR Intake Portal to offer a secure, web-based channel for submitting Data Subject Access Requests (DSARs) with One-Time Password (OTP) email validation. Comprising a web form and API, the portal enables organizations to receive requests online, validate submissions, and log each inquiry as a dedicated case complete with supporting evidence files. The portal supports submissions from individuals, authorized third parties, and employees acting on a requester's behalf. Every submission undergoes server-side validation and bot protection before being securely stored in private cloud storage and assigned a unique case reference number for tracking.
Unlicensed version
Limited up to 5 cases in total
Online subject access request web form (SPA) for requester, third party and employee requests
Server-side validation of every field, with configurable regular expression (RegEx) patterns
Configurable service types, data types, declaration text and terms link
Evidence uploads with file type, size and file signature checks
Case reference returned to the requester, with duplicate-submission protection
Case records and evidence stored in private Azure Blob Storage
Google reCAPTCHA bot protection, loaded only after cookie consent
Cookie consent banner and preferences panel
Rate limiting, CORS allow-list and security headers
Runs with managed identity, so no storage keys are needed in Azure
Accessible web form: skip link, error summary linked to fields, labelled fields
Application logging, with optional Application Insights monitoring
Optional email one-time code verifications
Optional confirmation email to the requester and notification to the support team
Optional Azure Front Door ID enforcement
Licensed version (additional features)
Unlimited cases while the license is valid
An Azure subscription with an App Service (.NET Core minimum v10) for the API
A storage account for Blob Storage (and Table Storage if one-time codes are used)
Optional: Azure Communication Services email, Azure Front Door, Application Insights
Optional: Google reCAPTCHA v2 keys
For a fixed annual subscription, you get the whole product for fixed year, with no limit on how many people submit requests or use email code verification.
One fixed price. A single annual subscription covers the full product. There are no per-request, per-requester or per-code charges, so a busy month costs the same as a quiet one.
Unlimited cases. Receive as many subject access requests as you get. There is no case cap, monthly quota or pricing tier.
Unlimited email code verification. One-time code verification is included for every requester at any volume. The only limits are security protections, such as a short wait between code requests and a lockout after repeated wrong codes. They stop abuse and do not limit genuine use.
Everything included. Every customer gets the same full feature set: bot protection, evidence upload, confirmation emails, support notifications and monitoring options. There are no add-on modules to buy.
Your data stays in your Cloud subscription. Cases and evidence are stored in your own storage account and region as plain JSON and files. No third-party SaaS holds your requesters' data, and there is nothing to export if you ever leave.
Built on Azure you already run. App Service, Blob Storage, optional Table Storage and Communication Services email, with no database to look after.
Secure by design. The server never trusts the browser. Bot checks, optional one-time codes, rate limits, private storage and file signature checks protect every request.
Privacy minded. Cookie consent before Google loads, no personal data in emails, no email addresses or codes in logs, and monitoring you can switch on or off.
Configurable without code. Services, data types, employee domains, validation patterns, limits and wording are all settings.
Audit friendly. Each case is one JSON record with a case reference, UTC time, form version and status. Each evidence file also has a recorded fingerprint (SHA-256 hash), so any change can be detected.
Ready for case management. The case record follows an agreed JSON contract that other systems can pick up and process in DSAR case management workflows.
Try before you buy. The unlicensed version runs the whole product for up to 5 cases.
The portal is sold as a fixed-price annual subscription. There is no charge per case, per requester or per email code.
One price, one year. The standard license subscription is valid for one year. The price does not change with the number of cases or email verifications.
Unlimited use. While the license is valid there is no limit on cases, and email one-time code verification is included for every requester.
Simple setup. The license is set with three app settings: company, serial key and subscription ID. The app checks them when it starts, and changing a setting restarts the app.
Automatic expiry. The expiry date is checked on every submission, so a running instance stops being licensed at the expiry time without a restart.
Renewal. If the license expires, the portal goes back to the unlicensed limit of 5 cases in total. That limit counts every case already stored, so once 5 or more exist, new requests are refused with a message asking for renewal. Existing cases and evidence are not touched, and renewing restores unlimited intake.
Fixed limit. The unlicensed limit is built into the product and cannot be raised by editing configuration.
Included in the annual subscription
The complete portal: web form (SPA), API, validation and evidence handling
Unlimited cases while the license is valid
Unlimited email code verification
All listed DSAR Intake Portal features, with no add-on modules.
You still will have to pay separately, directly to the provider
Azure App Service hosting
Azure storage for cases and evidence
[Optional] Email sending through Azure Communication Services, including one-time code emails
[Optional] Any usage charges from Google reCAPTCHA for enhanced bot protection
[Optional] Azure FrontDoor Service or Azure App Configuration service for enhanced security
[Optional] Azure Log Analytic and Azure Application Insights for enhanced observability
When a requester uploads a file, the API calculates its SHA-256 hash (a 64-character fingerprint such as 9F86D081...) from the file's contents. It stores the hash in the case record (case.json) next to the file's name, size, type and storage path, in the sha256 field of each attachment. The scan status starts as "pending".
Recommendation: enable immutable storage on the incoming data, and scan every file with security tools before it is released to users or other systems.
The fingerprint lets you:
Check a file has not changed. Recalculate the hash (for example with Get-FileHash file.pdf in PowerShell) and compare it with the value in case.json.
Show what was received. The record shows exactly which file arrived with a request, which helps if the file is ever disputed.
Spot duplicates. Two uploads with the same hash are the same file, whatever it is called.
On its own the fingerprint is a basic integrity check, not a digital signature. The hash sits in the same storage account as the file, so anyone with write access to that storage could change both. The portal also does not scan files for viruses. That is why the two controls below matter.
Evidence cannot be altered or deleted. For the retention period you set, files and case records stay exactly as the requester sent them. This holds even for administrators and for a compromised application identity.
The fingerprint becomes trustworthy. A hash is strong evidence only if neither the file nor the record holding it can be changed afterwards.
Protection from ransomware, accidents and insider changes. Locked data cannot be encrypted, overwritten or deleted by mistake.
Stronger audit and legal position. You can show that what you hold is what was received.
The portal creates each file and case.json for submission once and never edits them.
Uploaded files come from the public and could contain malware. Anything that opens them later, such as staff, a case management tool or another system, could be harmed. Immutable storage keeps a file unchanged, but it does not make it safe. Because an immutable file cannot be edited, record the scan result outside the file, not by changing it.
Recommended flow:
Land. The portal writes the case and files to a landing (quarantine) container with immutability on. Only the scanning platform reads from it.
Scan. A security tool scans each file, for example Microsoft Defender for Storage malware scanning or another scanner, and checks the case.json content for anything suspicious.
Verify. Recalculate each file's SHA-256 hash and compare it with case.json, to confirm the file was not changed.
Release. Copy only files that pass into a separate clean store and label them with scanStatus set to completed. Files that fail stay in the landing container for investigation and are never released.
Consume. Users and other systems read only from the clean store, never from the landing container. They treat a missing or non-completed scan label as not safe.
This functionality falls outside the portal's built-in capabilities. Your internal IT or security team will need to implement the scanning and release workflow within your own environment using custom scripts.
The text fields (names, address, description and others) come from the public. The portal rejects HTML-looking text in the description and "Other" fields and restricts the others by pattern, but systems that import the record should still treat every value as untrusted: never show it as HTML, use parameterised database queries, and check it against the expected JSON structure before importing it.
• Match your records policy. Immutable files cannot be removed before the retention period ends, including when someone asks for erasure. Agree the period with your data protection officer.
• Test before locking. Start with an unlocked retention policy. A locked policy cannot be shortened or removed.
• Least privilege. The API only needs to create, read and list. Give its identity no delete permission.
• Legal hold. Use a legal hold to keep specific cases beyond the normal period.
The portal has two parts: a static web form (the SPA) which you modify with corporate theme and a .NET API on Azure Web App Service. The form collects a subject access request and sends it to the API. The API checks everything again, saves the case and any evidence files to Azure Blob Storage, and can send confirmation emails.
The demo deployment installs a working DSAR Intake Portal in your own Azure subscription with a few PowerShell commands. Demonstration scripts are built for proof of concept rather than production use. It uses the lowest-cost options that still show every feature, such as a Basic App Service plan, locally redundant storage and the free tier of App Configuration. The demo deployment uses one resource group and Azure cloud low-cost resource options to keep the proof of concept simple and cheap. A production deployment needs stronger resources, more resilience and tighter network and traffic controls. Check Azure pricing for your region before you deploy to estimate running costs.
Anonymous requests. Anyone can submit a subject access request from a web form. No account is needed.
Email ownership check. A one-time code is emailed to the requester, who must enter it before the request is accepted.
Bot protection. Google reCAPTCHA blocks automated submissions.
Validated data. Every field is checked against defined patterns (regular expressions) in the form and again on the server before the request is accepted.
Controlled evidence uploads. Only the defined file types can be uploaded, within size and number limits.
Immutable storage. Cases and evidence are written to storage that has an immutability policy, so saved data cannot be changed or deleted during the retention period.
Monitoring. Application Insights gives counts of successful and failed submissions. With the optional failure logging change, it also records the reason each submission failed.
Region tag. Azure Front Door adds the requester's location (GB, US, or EU) to each case. This helps you identify whether a request falls under UK GDPR (per ICO guidance), EU GDPR, or California's CCPA/CPRA guidance, or originates from another region (recorded as "na"). Because the tag is derived from the requester's IP address, treat it as an initial guide and confirm the applicable response timeline with your privacy team
Friendly and accessible. If something is missing or wrong, an error summary at the top lists exactly which fields need attention, and each field shows its own message. The form works on phones, tablets and wide computer screens.
Steps run one after another. First step is mandatory all other steps are optional depending on DSAR portal deployment requirements. After the first step you can add the other steps in any order you like.
Following PS command lists the current settings at any point, so you can confirm configuration for each step.
Get-DSARConfigurations -Suffix <suffix>
• Install a recent Azure CLI (the demo script asks for version 2.91.0 or later) from Microsft URL: https://aka.ms/installazurecliwindowsx64 and run az login with a privileged account that can create resources and assign roles.
• Install the PowerShell (PS) module:
Install-Module -Name SecureMFA_DSAR_INTAKE -Repository PSGallery -Scope AllUsers.
• The demo runs unlicensed, so it accepts up to 5 cases. When 5 case limit reached , delete old cases or Use Set-DSARLicense to apply a license.
• Use your own reCAPTCHA keys. The sample settings contain Google's public test keys, which accept every token, so they do not really block bots.
• Allow time. Front Door can take 30 minutes or more to become ready, and the web app can take up to 15 minutes to pick up changed settings unless you restart it.
Run these commands in PowerShell on Windows device in order. Lines above command fields explain each step. Steps 2 and 7 are optional and installs all portal capabilities. The suffix is a short random code that step 1 adds to every resource name. Lines marked "Test" are checks you can run after a step.
Step 0. Prerequisites
Install the latest Azure CLI (minimum version 2.91.0) from https://aka.ms/installazurecliwindowsx64, then check the installed version
az version
Sign in with a privileged account and select the subscription to deploy into
az login
Install the SecureMFA_DSAR_INTAKE module from the PowerShell Gallery.
Install-Module -Name SecureMFA_DSAR_INTAKE -Repository PSGallery -Scope AllUsers
You can check installed module version with
Get-Module -Name SecureMFA_DSAR_INTAKE
Step 1. Install the core demo DSAR Intake Portal
The command installs SPA and Web App into rg-dsar-intake-portal resource group into your Azure cloud subscription.
Install-DSARDemoIntakePortal
Test: check the web app (API) health endpoint. Replace the suffix value with the one generated by your deployment.
$suffix = "value";
$apiUrl= "https://app-dsar-intake-api-$suffix.azurewebsites.net"
Invoke-RestMethod "$apiUrl/health"
Step 2. Enable Application Insights and web app logging
Enable Azure Application Insights (auto-instrumentation) and web app logging
$rg = "rg-dsar-intake-portal";
$app = "app-dsar-intake-api-$suffix";
$LogAnalyticsWorkspace = "log-dsar-intake-$suffix"
Set-DSARLogging -AppName $app -Action Enable -LogLevel Information -LogAnalyticsWorkspace $LogAnalyticsWorkspace -RetentionDays 30
Step 3. Create an immutability policy on the data container
Create an unlocked 1-day immutability policy on the data blob storage container
$dataSa = "stdsardata$suffix";
$ContainerName = "dsar-intake"
$RetentionDays = 1
az storage container immutability-policy create --resource-group $rg --account-name $dataSa --container-name $ContainerName --period $RetentionDays
Optional for demo: lock the policy for strict compliance. A locked policy cannot be shortened or deleted by anyone. To lock it, retrieve the ETag and then lock the policy.
$ETAG = (az storage container immutability-policy show --resource-group $rg --account-name $dataSa --container-name $ContainerName --query etag -o tsv).Replace('"', '')
az storage container immutability-policy lock --resource-group $rg --account-name $dataSa --container-name $ContainerName --if-match $ETAG
Test: show the web form address. Then submit a request on the form and check that case.json and the evidence files are created in the storage account.
$spaSa = "stdsarspa$suffix"; $spaUrl = (az storage account show -n $spaSa -g $rg --query primaryEndpoints.web -o tsv).TrimEnd('/'); $spaUrl
List the files in the container with their creation dates, to see when each file's 1-day lock expires
az storage blob list --account-name $dataSa --container-name $ContainerName --query "[].{FileName:name, Created:properties.creationTime, LastModified:properties.lastModified}" --output table
Review Logs: if Application Insights is enabled, check that the number of successful intakes matches the number of cases created with bellow KQL query.
requests
| where name == "POST /api/intake"
| lookup (
traces
| where message startswith "Intake validation failed"
| project operation_Id, reason = tostring(customDimensions.ValidationErrors)
) on operation_Id
| project timestamp, operation_Id, success, resultCode, reason
| order by timestamp desc
Step 4. Install the Azure email service
Install the demo Azure Email Service. Use the suffix generated by the portal deployment. The deployment turns on email in the web app configuration and sets the Azure email service endpoints.
Install-DSARDemoAzureEmailService -Suffix $suffix
Test: Submit a new request with an email address on the web form. The requester now receives an email confirming that the request was created.
Step 5. Turn on one-time password validation and support notifications
Turn on one-time password (OTP) validation of the requester's email address before a request can be submitted. Email sending (step 4) must be enabled first. This step also turns on email notifications to the support team whenever a new case is submitted. To apply the changes, restart the web app in the Azure portal, or wait about 15 minutes for it to restart and load the new settings.
$SupportEmailAddresses = “supportemail@mydomain.com”
az webapp config appsettings set -n $app -g $rg --settings "Otp__Enabled=true";
az webapp config appsettings set -n $app -g $rg --settings "Email__SupportNotificationEnabled=true";
az webapp config appsettings set -n $app -g $rg --settings "Email__SupportAddresses=$SupportEmailAddresses";
In the web form's config.js file, also set the value below. It must be on whenever the web app enforces OTP.
otpEnabled = true
Check that the new settings were applied. Bellow command lists all web app settings and the config.js values for your suffix.
Get-DSARConfigurations -Suffix "$suffix";
Test: Submit a new request. The support team now gets a notification email, and the requester gets a confirmation email. The form can only be submitted with a valid one-time password, which is always sent to the contact email address to confirm it is valid.
Step 6. Install Azure Front Door
Install the demo Azure Front Door service. Use the suffix generated by the portal deployment. The deployment adds the Front Door ID to the web app configuration to secure the API. It also records the location of each request (GB, US or EU region).
Install-DSARDemoAzureFrontDoorService -Suffix "$suffix"
In the web form's config.js file, change apiBaseUrl from the direct web app address to the Front Door address.
$apiBaseUrl = "https://dsar-frontdoor-xxxxxxxxx.azurefd.net"
Check that the new settings were applied.
Get-DSARConfigurations -Suffix "$suffix";
Front Door takes time to provision, so allow at least 30 minutes before testing. You can check that the service is running by opening the Front Door address in a browser.
Test: direct access to the web app (API) should be blocked. Only the health endpoint should still answer.
$apiUrl= "https://$app.azurewebsites.net";
$apiUrlFrontDoor = "$apiBaseUrl";
Invoke-RestMethod "$apiUrl/health";
Invoke-RestMethod "$apiUrl/api/lookups";
Invoke-RestMethod "$apiUrlFrontDoor/api/lookups";
Test: check that a new request has its geoCountry value filled in from the Front Door headers. Replace the case reference with one from your own test submission and Show the case metadata.
$DSARcase = "DSAR-2611-XHLWN-2G2UC"
az storage blob metadata show --account-name $dataSa -c dsar-intake -n "$DSARcase/case.json" --auth-mode login -o json
Download the case record and check that it now includes the geoCountry value
az storage blob download --account-name $dataSa -c dsar-intake -n "$DSARcase/case.json" --auth-mode login -f case.json -o none | ConvertFrom-Json ; Get-Content .\case.json
Step 7. Install Azure App Configuration
Install the demo Azure App Configuration service. This moves the settings of the existing DSAR Intake API web app into a new Azure App Configuration store. Secrets can then be kept individually in Azure Key Vault for extra security, and settings can be shared across several web apps when you scale across regions or services.
Install-DSARDemoAzureAppConfigurationService -Suffix "$suffix";
Confirm that the web app settings have moved to Azure App Configuration
Get-DSARConfigurations -Suffix "$suffix";
Completely deletes all Demo resources in deployment
Uninstall-DSARDemoIntakePortal
Every API setting below can be supplied in either of two places. Use whichever suits your environment setup, or a mix.
Web app setting. An application setting on the App Service. A colon in the name becomes a double underscore, so Otp:Enabled is entered as Otp__Enabled. Lists use a number: Cors__AllowedOrigins__0, Cors__AllowedOrigins__1
Azure App Configuration. A key with the prefix sMFA:DSAR:PORTAL:, so Otp:Enabled is stored as sMFA:DSAR:PORTAL:Otp:Enabled. Only keys with the label named in AppConfigLabel are read (the label is default if not set).
Things to know:
The three "Settings source" values must be web app settings, because they tell the app where to find App Configuration.
If the same setting is in both places, App Configuration wins, because it is loaded last.
Changing a web app setting restarts the app automatically. Changing a value in App Configuration does not, so restart the app yourself.
The app checks the key settings when it starts and refuses to start if something required is missing or out of range, with a message naming the setting.
Secrets (serial key, reCAPTCHA secret, code passphrase, connection strings) are best kept as web app settings that use Key Vault references.
Values are text. Switches are true or false. Lists of values are separated by semicolons.
Each pattern is a regular expression with a 250 millisecond time limit. An empty or invalid pattern stops the app from starting. Change them only if you need different rules, and make the same change in the web form's app.js. Bellow six Regex patterns are default configurations to support validation patterns defined In a table.
Email uses Azure Communication Services. Text settings that hold several paragraphs use semicolons between the paragraphs, so a paragraph cannot contain a semicolon.
Placeholders you can use in the subjects and bodies: {CaseId}, {SubmissionDate}, {RequestorType}, {Services}, {DataScope}, {AttachmentCount} and {CasePath}. Emails never carry the requester's personal data.
Switch these on together with email. A code stays valid for between AcceptPreviousIntervals and AcceptPreviousIntervals + 1 intervals.
Without a valid licence the portal accepts up to 5 cases in total. Use bellow PowerShell command to apply a license if you use Web App Configuration to manage DSAR Intake Portal settings
Set-DSARLicense -AppName "WebAppName" -ResourceGroup "rg-dsar-intake-portal" -Company "MyCompany" -SerialKey " MySerialKey" -SubscriptionId "MySubscriptionID"
Use bellow PowerShell command to apply a license if you use App Configuration Service to manage DSAR Intake Portal settings
Set-DSARLicense -AppConfig "AppConfigurationServiceName" -Company "MyCompany" -SerialKey "MySerialKey" -SubscriptionId "MySubscriptionID"
These are web app settings or App Service configuration only, not App Configuration keys. The logging script sets them for you.
The web app log level (Error, Warning, Information or Verbose) is an App Service platform setting, not an app setting. Set it with the logging script.
You can Enable Application Insights (auto-instrumentation) and Web App logging with bellow PowerShell command
Set-DSARLogging -AppName "WebAppName" -Action Enable -LogLevel Information -LogAnalyticsWorkspace “MyLogAnalyticsWorkspace” -RetentionDays 30
To remove the portal logging and delete the Application Insights resource, run bellow PowerShell command:
Set-DSARLogging -AppName "WebAppName" -Action Disable -Target All -DeleteAppInsightsResource
SPA web form has its own settings file (config.js), edited after deployment with no rebuild.
These cannot be changed by configuration: the rate limit of 10 requests a minute per IP on intake and code requests, the 120 MB request size, the 11 MB limit per upload section, the 100,000 character payload limit, and the 5-case unlicensed limit.
Following endpoints are available in DSAR Intake Web APP.
CORS allows only the origins in Cors:AllowedOrigins, the methods GET, POST and OPTIONS, and the headers Idempotency-Key, Content-Type and X-User-Country (Allows to capture requestor’s geo location if edge network device like Azure Front Door is configured to pass this header value for users HTTP request).
Successful submission of a request returns response, status 201 (status 200 with the same body when the same key is sent again):
{ "caseId": "DSAR-2611-ABCDE-FGHJK", "submissionDate": "2026-11-01T20:15:30Z", "attachmentCount": 2 }
The case ID is built from a hash of the idempotency key, so a retry always maps to the same case.
For each case following data will be created.
The case reference is derived from the SPA's idempotency key, so a retry of the same submission returns the existing case instead of creating a duplicate.
When OTP enabled following data will be created in dsarotpusers table.
A background service removes OTP users whose last logon is older than Otp__RetentionDays (7 by default, range 1 to 365).
It runs when the app starts and then repeats every Otp__CleanupIntervalHours (24 by default, range 1 to 168).
It only runs when Otp__Enabled is true. When it is false, one log line says the clean-up was not scheduled.
Before validating, the web app service trims spaces, removes control characters, strips spaces, brackets and hyphens from the phone number, clears fields that do not apply to the chosen requester type, and resets the server-owned fields.
The file signature check reads the first bytes of each file, so renaming a file to .pdf does not get it through.
A banner offers Allow reCAPTCHA, Reject and Manage choices. Google's script loads only after the requester allows it, and a Cookie settings link in the footer lets them change their mind at any time.
The choice is stored in a first-party cookie, dsar_consent, for 180 days by default.
Rejecting blocks submissions while bot protection is on, and the banner says so. A notice with an Allow reCAPTCHA button also appears next to the bot check on the form.
Withdrawing consent reloads the page. Google's own cookies sit on google.com and are cleared through the browser's settings.
All wording can be overridden in config.js under cookieConsent.text. Raise version if the change alters what the visitor agrees to.
cookieConsent: {
enabled: true, // false: no banner, reCAPTCHA loads straight away
version: "1", // bump to ask everybody again
expiryDays: 180, // how long a choice is remembered
cookiePolicyUrl: "", // optional link, shown as "Read more about cookies"
text: { // optional wording overrides
bannerBody: "...",
allowButton: "Allow reCAPTCHA"
}
}
The dsar_consent cookie is set with Path=/, SameSite=Lax and the Secure flag on https. Confirm with your privacy team that treating it as essential fits your policy.
First visit. A banner appears at the bottom of the page with Allow reCAPTCHA, Reject and Manage choices.
Allow. The choice is saved, the banner closes and the reCAPTCHA widget loads.
Reject. The choice is saved and the banner closes. The widget does not load, and a notice beside the bot check explains that the form cannot be submitted until reCAPTCHA is allowed. With one-time codes on, the same applies to asking for a code.
Manage choices or the footer link. A dialog lists the essential cookie (always on) and the bot protection cookie (a tick box), with Save choices and Cancel.
Later changes. Turning the choice off reloads the page so the widget stops loading. Turning it on loads the widget straight away.
Version change. If version is raised, any saved choice with the old version is ignored and the banner appears again.
The dialog works with the keyboard: focus stays inside it, Escape closes it, and focus returns to where it came from.
The wording keys are bannerTitle, bannerBody, allowButton, rejectButton, manageButton, readMore, panelTitle, necessaryLabel, necessaryText, captchaLabel, captchaText, saveButton, cancelButton, footerLink and noticeText. In necessaryText, {months} is replaced by the expiry in months.
Consent is a browser-side control. The API never receives or checks it, and the case record does not store it. Bot protection is enforced separately on the server, so removing the banner from the page does not let a request skip the bot check.
Changing CAPTCHA provider means changing the wording that names Google and raising version. See "Alternative CAPTCHA providers".
Wording needs approval. Have your privacy team approve the banner text and the cookie policy link before go-live.
Follow these steps to generate production keys for the application:
Open the Admin Console: Sign in with an organizational Google account and navigate to https://www.google.com/recaptcha/admin/create
Label the Key: Enter a descriptive Label to identify the environment (e.g., dsar-intake-prod).
Select reCAPTCHA Type: Choose Challenge (v2), then select the "I'm not a robot" Checkbox option.
Configure Allowed Domains: Add your production SPA hostname (e.g., stdsarspa3o2b1.z33.web.core.windows.net). Enter the host only—omit https://, paths, and port numbers.
Submit and Retrieve Keys: Accept the terms of service, click Submit, and copy both the Site key (public SPA frontend key - recaptchaSiteKey ) and Secret key (private Web App backend key - BotProtection__SecretKey) into your production configuration.
Note: Domain allow list updates can take up to 30 minutes to propagate across Google's servers.
The portal is built for Google reCAPTCHA v2 (the "I'm not a robot" checkbox). Providers such as Cloudflare Turnstile and hCaptcha offer a reCAPTCHA-compatible interface, so you can switch with a few settings and one line in the web form. These providers have not been tested with this solution. Prove the switch in a test environment before you use it in production.
• The API contract is the same. The API sends secret, response and optionally remoteip to the address in BotProtection__VerifyUrl, and reads success from the JSON reply. Turnstile and hCaptcha use the same request and reply.
• The web form needs no new code. It creates the widget with the grecaptcha JavaScript calls. Both providers have a compatibility mode that offers the same calls, so only the script address changes.
1. Create the keys at the new provider. In the Cloudflare Turnstile or hCaptcha dashboard, create a new site or widget and copy the site key (public) and secret key (private). Add the host name of your web form to the allowed hostnames. Enter the host only, for example stdsarspa3o2b1.z33.web.core.windows.net, with no https://, path or port.
2. Update the API settings. Set these two settings. Each can be a web app setting or an Azure App Configuration key. Changing a web app setting restarts the app. After changing App Configuration, restart the app yourself.
3. Update the web form. Three files change.
config.js. Put the new provider's site key in recaptchaSiteKey. The setting name stays the same.
app.js. In the initCaptcha() function, replace the script address (the s.src line). Keep the onload and render parts, because the form relies on them to create the widget. If you drop them, no widget appears.
// From (Google reCAPTCHA):
s.src = "https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit";
// To (Cloudflare Turnstile):
s.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha&onload=onRecaptchaLoad&render=explicit";
// Or (hCaptcha):
s.src = "https://js.hcaptcha.com/1/api.js?recaptchacompat=on&onload=onRecaptchaLoad&render=explicit";
index.html. Allow the new provider in the Content-Security-Policy meta tag. Without this the browser blocks the script and the widget fails silently.
Once you have fully switched, remove the Google entries from script-src, frame-src and img-src.
4. Update the cookie wording and privacy notice. The cookie banner and the notice next to the widget name Google reCAPTCHA. In config.js, change the cookieConsent text (bannerBody, allowButton, captchaLabel, captchaText, noticeText) to name the new provider, and raise cookieConsent.version so everyone is asked again. Update the default wording in index.html to match. The widget may also behave differently: Turnstile often completes without a tick, so you may want to reword the "Tick 'I'm not a robot'" message. Because a different company now receives visitor data, update your privacy notice and processing records.
5. Verify.
Load the form with the browser's DevTools open. On the Network tab, confirm the new script loads. On the Console tab, confirm there are no Content-Security-Policy errors.
Allow the cookie, complete the check, and submit the form. In the Network tab, confirm the request to /api/intake (or /api/otp/request when one-time codes are on) includes captchaToken, and that the response is 201 (or 200 for a code request).
Check the API log stream. The messages "reCAPTCHA rejected" and "reCAPTCHA verify returned HTTP" should not appear. If they do, the listed error codes point to the cause, for example a wrong secret key or a hostname that was not added.
Submit once without completing the check, and confirm the form asks for it.
Keep the previous Google values. To return, restore the original BotProtection__VerifyUrl and BotProtection__SecretKey, the Google recaptchaSiteKey, the original script address and the original Content-Security-Policy and cookie wording.
This section shows in one place how data is protected at rest, which encryption options are available, and how one-time code data is encrypted by the portal.
All of these use Microsoft-managed keys unless you choose otherwise. Choosing customer-managed keys needs no change to the portal's code, because the encryption happens inside the storage service.
The portal protects each user's one-time code secret itself, on top of the storage encryption.
A secret is created. The first time an email address asks for a code, the portal generates a random 32-byte secret for it.
A key is derived. A 256-bit AES key is derived from Otp__EncryptionPassphrase using PBKDF2 with SHA-256, 100,000 rounds and a fresh random 16-byte salt.
The secret is encrypted. It is encrypted with AES-256-GCM, using a fresh random 12-byte nonce. GCM adds a 16-byte tag that detects any tampering. The user's email address is bound in as associated data.
It is stored as text. The salt, nonce, tag and encrypted secret are joined, converted to base64 and stored with the prefix v1: in the OtpSecret column of the table.
Codes are calculated, not stored. Each 6-digit code is worked out from the secret and the current time interval with HMAC-SHA256 (the same idea as RFC 6238). The code is emailed to the user, works once and expires after a short time.
Checking a code. The portal decrypts the secret, recalculates the codes for the allowed intervals, and compares them in fixed time so the comparison does not leak information.
What this protects against:
Someone who can read the table cannot work out codes without the passphrase.
A secret copied onto another user's row does not decrypt, because the email address is bound into the encryption.
A changed or damaged value fails the GCM check and is treated as unreadable.
What the portal does not encrypt itself: the email address (it is the row key), timestamps, counters, the last IP address and user agent, and the last wrong code entered. These rely on the storage encryption alone, so limit who can read the table.
Each user's secret is protected with an AES-256 key derived from Otp__EncryptionPassphrase. The passphrase must be at least 16 characters, and the app will not start with a shorter one.
Store the passphrase securely, for example as a Key Vault reference, and keep it stable.
Use a long random value. A password manager or a random generator is better than a memorable phrase.
If the passphrase changes, stored secrets become unreadable. Affected users simply get a fresh secret on their next code request. There is no re-encryption step.
Never select or print the OtpSecret column when you inspect the table.
The API redirects HTTP to HTTPS, and its calls to Azure storage, Communication Services and reCAPTCHA use HTTPS.
Set the minimum TLS version to 1.2 on the web app, the storage account and Front Door, and keep secure transfer required on the storage account.
The one-time code travels in the body of an email, which is not end-to-end encrypted. Codes are short-lived and work only once.
Follow these steps to keep your portal secure, up to date, and running smoothly over time.
Platform Maintenance
Keep the .NET runtime patched: The SecureMFA DSAR Intake API runs on ASP.NET Core (minimum version .NET 10). Because the API is deployed as framework-dependent, the .NET runtime is not bundled inside the application package. Microsoft typically releases monthly security patches—always run the latest patch level and upgrade to a newer major version before your current version reaches end of support (check the Microsoft .NET Support Policy for lifecycle dates).
Azure SDK libraries: Bundled dependencies (Azure.Core, Azure.Identity, Azure.Storage.Blobs, and Microsoft.Identity.Client) are updated in new releases of the SecureMFA_DSAR_INTAKE module to patch vulnerabilities and include performance improvements.
SPA web form: The front-end form uses plain JavaScript with no third-party npm packages to patch. Google's reCAPTCHA script is loaded directly from Google and stays current automatically.
Azure platform services: Microsoft manages underlying OS and platform patching for Azure App Service, Azure Storage, and Azure Communication Services. You remain responsible for security configurations such as minimum TLS versions and RBAC role assignments.
Establish a regular maintenance routine to check the PowerShell Gallery for new releases of the SecureMFA_DSAR_INTAKE module. Deploying an updated package refreshes the backend API and its dependencies without overwriting your existing App Service configuration.
1. Check for a newer module version
Run the following PowerShell snippet to compare your local module version against the PowerShell Gallery:
$local = (Get-Module -ListAvailable -Name SecureMFA_DSAR_INTAKE | Sort-Object Version -Descending | Select-Object -First 1).Version
$gallery = (Find-Module -Name SecureMFA_DSAR_INTAKE -Repository PSGallery).Version
[PSCustomObject]@{InstalledVersion = $local; GalleryVersion = $gallery; IsUpToDate = ($local -eq $gallery)}
2. Prepare and back up settings
Test first: Always deploy and validate new versions in a staging/test environment before updating production.
Review release notes: Check the module release notes for any newly required application settings. The API will fail to start if a mandatory setting is missing.
Back up configuration: While deployment preserves existing settings, export a backup beforehand. Store this file securely, as it contains secrets (also record your values if you use Azure App Configuration):
az webapp config appsettings list -g <resource-group> -n <app-name> > backup-settings.json
3. Deploy the API
After updating your local SecureMFA_DSAR_INTAKE PowerShell module, deploy the latest API package to your App Service:
Install-DSARWebAppIntakeAPI -AppName "WebAppName" -ResourceGroup "rg-dsar-intake-portal"
4. Verify the deployment
Query the /health endpoint to confirm the API is running the new version and shows isLicensed as expected. If issues occur, inspect the _default_docker.log files in App Service logs.
Invoke-RestMethod "$apiUrl/health";
Check the PowerShell Gallery release notes for the SecureMFA_DSAR_INTAKE module before upgrading the front end:
If the SPA version matches the new module version: Follow the steps below to upgrade the SPA.
If the SPA version is older than the module version: No front-end changes were introduced in that release, and a SPA upgrade is unnecessary. (Note: Each module release bundles the latest versions of both the API and SPA packages. If you are skipping multiple versions, review all intermediate release notes to see if any earlier release updated the SPA.)
1. Back up existing files
Download and save a copy of your current SPA files (index.html, app.js, config.js, consent.js, and styles.css).
2. Deploy the SPA
Run the following PowerShell command using your updated SecureMFA_DSAR_INTAKE module:
Install-DSARSPAIntakePortal -StorageAccountName "stdsarspa<suffix>"
3. Restore configuration and clear caches
Update config.js: Copy your configuration values from your backed-up config.js into the newly deployed config.js. Do not overwrite the entire file, as newer versions may introduce additional configuration keys.
Purge caches: Clear your browser cache and purge any CDN or Azure Front Door cache sitting in front of the storage account so users receive the updated files.
Data safety: Upgrades do not modify or delete existing stored cases or evidence.
Preserve encryption keys: Never change Otp__EncryptionPassphrase during an upgrade. Changing it renders previously stored OTP secrets unreadable, forcing users to generate a new secret on their next request.
Rollback procedure: Keep your previous API .zip package and backed-up SPA files until the new version has been verified in production. To roll back:
Swap your deployment slot back or redeploy the previous api.zip.
Re-upload the backed-up SPA files (index.html, app.js, config.js, consent.js, styles.css).
Restore your backed-up App Service settings if any changes were made.
Start with these four places. They answer most questions:
The health endpoint. Open https://<app>.azurewebsites.net/health. It shows the version and whether the portal is licensed. If it does not answer, the app is not running.
The log stream. Run az webapp log tail -g <resource-group> -n <app-name>, or open the Kudu docker log page. Start-up checks, licence status and warnings appear here.
The browser's DevTools. The Console tab shows blocked scripts and cross-origin errors. The Network tab shows the status code and the reply of each call.
Application Insights, if enabled. The Failures view lists failed requests and failed calls to storage, email and reCAPTCHA. Data appears a few minutes after the event.
The DSAR Intake portal requires minimum a .NET 10 ASP.NET Core app running on Azure App Service. Two separate features can watch it when optionally enabled.
Application Insights attaches to the app from outside. Two app settings switch it on. The connection string says which Application Insights resource receives the data. The agent version setting (~3 on Linux) tells App Service to load the monitoring agent when the app starts.
Once loaded, the agent watches the app while it runs and records:
incoming requests (route, status code, duration)
outgoing calls to Blob Storage, Table Storage, Communication Services email and reCAPTCHA
exceptions with stack traces
application log messages, Warning and above
performance and HTTP metrics
It sends them in batches to Application Insights, which stores them in the linked Log Analytics workspace. You read them in the Azure portal under Logs, Failures and Application Map. Data appears after a few minutes.
Application Insights (no-code) agent works from outside the app, nothing is added to ASP.NET code. You get what agent records.
Check that it attached by opening https://<app>.scm.azurewebsites.net/ApplicationInsights
This is a feature of App Service itself and uses no agent. App Service captures what the app writes to its console (your ILogger messages) and the platform's own events, and saves them as files on the app's disk. On Windows it also saves an HTTP access log. The log level (Error, Warning, Information or Verbose) decides which lines are kept.
You read the files live with the log stream, or at https://<app>.scm.azurewebsites.net/api/logs/docker
They are size-limited and rotated, cannot be searched with queries and raise no alerts.
They work best together. Application Insights shows trends and failures across requests. The web app log shows the detail of what the app itself said.
The App Service log level you choose decides which of them are written.
Note: Verbose is the only level that logs client IP addresses for every request. Use it for short troubleshooting sessions only.
Information you get from DSAR Intake Portal web app. The "Level" column shows the lowest setting at which each message appears.
None of these is written to the logs:
Requester names, email addresses, phone numbers, postal addresses or account numbers
The request description or any form field
One-time codes
Uploaded file names or file content
The content of the saved case record
Failed-email messages record only the status and error code, never the recipient address.
These lines come from .NET itself, not from web app code. What exactly appears also depends on your appsettings.json logging section.
Web app code shares to with logging service field names and static validation messages for Intake Validator. No user PII (names, emails, addresses, or file contents) is logged.
At Information, typically: start-up lines such as the address the app is listening on, "Application started", the hosting environment and the content folder. An unexpected error that reaches the exception handler is recorded with its details at every level. The caller only sees a generic message.
At Verbose, typically: many more lines per request, such as "request starting" and "request finished" with method, path, status code and duration, route matching, cross-origin and rate-limit decisions, and calls to outside services such as reCAPTCHA. Expect a lot more log volume.
IP addresses and user agents are personal data under GDPR. Keep retention short and record this logging in your processing record.
App Service log files. The console output of the Linux container, visible at the Kudu docker log address or with the log stream. This is where your Information lines mainly appear.
Application Insights (if enabled). It usually receives warnings and above from your code as trace messages. That means the blocked-request warning, with its IP address, can also be stored there. Check what arrives in Application Insights under Logs, and set the retention you need.
Two commands cover normal use: one switches monitoring on, the other removes it. Sign in with az login first, then set these variables (replace <suffix> with your deployment suffix, for example nx2gw):
$suffix = "<suffix>"
$rg = "rg-dsar-intake-portal"
$app = "app-dsar-intake-api-$suffix"
$LogAnalyticsWorkspace = "log-dsar-intake-$suffix"
-ResourceGroup defaults to rg-dsar-intake-portal. Add -ResourceGroup $rg if your resource group has a different name.
Set-DSARLogging -AppName $app -Action Enable -LogLevel Information -LogAnalyticsWorkspace $LogAnalyticsWorkspace -RetentionDays 30
-Target is not given, so it defaults to All: both Application Insights and web app logging. In order, the command:
Checks the web app exists and detects that it runs on Linux.
Creates the Log Analytics workspace log-dsar-intake-<suffix> in ukwest if it does not exist, and keeps it if it does.
Creates Application Insights appi-dsar-intake-api-<suffix> linked to that workspace, or re-uses it if it already exists.
Sets the two Application Insights app settings. This restarts the app for a few seconds.
Sets the workspace retention to 30 days.
Switches on web app logging at Information (application, web server and docker container logs).
Prints the status of everything it changed.
It is safe to run again. To change the web app log level later, run it again with a different -LogLevel (Error, Warning, Information or Verbose). Verbose asks you to type YES. Telemetry appears in Application Insights after a few minutes. Retention applies to the whole workspace, which here is used only by this app.
Set-DSARLogging -AppName “WebAppName” -Action Disable -Target All -DeleteAppInsightsResource
This switches everything off and deletes the Application Insights resource. In order, the command:
Removes the Application Insights app settings. This restarts the app for a few seconds.
Switches off web app logging (application, web server and docker container logs).
Deletes the Application Insights resource and its stored telemetry, after you type its name to confirm. This cannot be undone.
Removes the leftover "Failure Anomalies" alert rule and the shared "Application Insights Smart Detection" action group, unless another rule still uses that group.
It does not delete the Log Analytics workspace, and log files already written stay on the App Service disk until they rotate. Data already in the workspace should stay until the 30-day retention ends. If you need it gone sooner, delete the workspace separately in the portal.
Tip: add -WhatIf to either command to preview what it would change without changing anything.
Run Set-DSARLogging -Explain to print the full general guide. It makes no Azure calls.