GDPR Compliance

We use cookies to ensure you get the best experience on our website. By continuing to use our site, you accept our use of cookies, privacy policy and terms of service.

Technical guide

ASP.NET Core security checklist for Azure App Service

AI tools are finding vulnerabilities faster than teams can patch them. Most of what protects a .NET app on Azure is a short list of checks you can run this week, and the one most teams skip is how a fix actually reaches production.

Craftware Technologies · Last updated November 18, 2026 · 6-minute read

2026 CVE forecastAbout 66,000Roughly double 2025, per FIRST
July 2026 Patch TuesdayAbout 570 fixesClose to triple the month before
CVE-2026-40372Rebuild requiredASP.NET Core Data Protection, April 2026

Why this list, and why now

Through 2026, AI models have been finding software flaws faster than maintainers can fix them. FIRST's mid-year forecast put the year at about 66,000 published vulnerabilities, roughly double 2025, and Microsoft's July 2026 Patch Tuesday fixed about 570 in one release. The press has started calling it Patchmageddon.

Two things follow for anyone running a .NET application on Azure. There is more to patch, and patching itself has become a source of outages: in the fall of 2026, federal officials and lawmakers pointed to rushed patching of AI-found flaws, rather than attacks, as a likely cause of several major outages. The useful response is not to patch faster by hand. It is to know what you are exposed to, and to make a fix routine to ship.

The checklist below is in the order we would work through an application. Most of it takes minutes per item.

Packages and runtimes

What the platform patches for you, and what it doesn't

  • Built-in .NET runtime on App Service: patch updates are applied automatically, by overwriting the installed version. A framework-dependent app picks them up on restart.
  • NuGet packages inside your app: never patched by the platform. They change only when you update the reference, rebuild and redeploy.
  • Self-contained and container deployments: the runtime is baked in at publish time. They get no runtime patches until you republish.
  • Linux App Service: the Platform Release Channel (Latest, Standard or Extended) sets how quickly runtime patches arrive. Standard is the default.
  1. Audit every package, including transitive ones. dotnet restore reports known vulnerabilities as warnings NU1901 to NU1904. Projects targeting .NET 10 audit transitive packages by default; on .NET 8 and 9 only direct references are audited unless you set <NuGetAuditMode>all</NuGetAuditMode>. Run dotnet package list --vulnerable --include-transitive (or dotnet list package on older SDKs) for a full report.
  2. Fail the build on high and critical findings. Set <NuGetAuditLevel>high</NuGetAuditLevel> and treat NU1903 and NU1904 as errors in CI, so a vulnerable package can't reach production unnoticed. Use dotnet nuget why <package> to find which direct reference pulls a vulnerable transitive one in.
  3. Know which deployment model you use. If the app is published self-contained or runs in a container, put "rebuild and redeploy" on the calendar for every monthly .NET servicing release, because nothing else will patch it.
  4. Check the runtime's support date. A .NET version past end of support receives no security fixes at all. Our free .NET end-of-support checker dates each runtime, and the .NET 8 and 9 end-of-support guide covers the next deadline.

CVE-2026-40372 is the example to remember. The flaw was introduced in the Microsoft.AspNetCore.DataProtection package in .NET 10.0.0 to 10.0.6 and fixed in 10.0.7 in April 2026. Apps that referenced the package directly, or were published self-contained, stayed exposed until someone rebuilt and redeployed them.

The application itself

  1. Every endpoint has an explicit authorization decision. Set a fallback authorization policy that requires an authenticated user, then mark the public endpoints with [AllowAnonymous]. New endpoints are then closed by default instead of open by default.
  2. Antiforgery is on for anything that changes data. Razor Pages and MVC forms validate tokens by default; minimal APIs that accept form posts and any endpoint you exempted deserve a second look.
  3. No SQL built from strings. Search for FromSqlRaw, ExecuteSqlRaw and SqlCommand with concatenated input. Use parameters or FromSql with interpolation, which parameterizes for you.
  4. File uploads are limited and stored outside the web root. Check size limits, allowed types, generated file names, and that nothing uploaded can be served back as executable content.
  5. Production errors don't leak detail. The developer exception page and detailed errors are off outside Development, and logs don't record tokens, passwords or full request bodies.
  6. HTTPS and HSTS are enforced in the app too. UseHttpsRedirection and UseHsts in production, plus a Content-Security-Policy and the other security headers your pages need.
  7. Data Protection keys are stored deliberately. On App Service, keys default to the %HOME%\ASP.NET\DataProtection-Keys folder, which is shared across instances but not protected at rest, and each deployment slot has its own key ring, so a slot swap can sign users out. For a multi-slot or multi-app setup, persist keys to Azure Blob Storage and protect them with Azure Key Vault.

Secrets and identity

  1. No secrets in source, config files or pipeline logs. Search the repository history, not just the current branch: a key deleted last year is still in Git. Anything found should be rotated, not just removed.
  2. Use managed identities and Key Vault references. The app reaches Azure SQL, Storage and Key Vault with its own managed identity, and remaining secrets live in Key Vault, surfaced to the app as Key Vault references in app settings.
  3. Review who can change production. List the Owner and Contributor role assignments on the subscription and resource groups. Former employees, contractors and old service principals are the usual findings.

Azure hosting configuration

  1. HTTPS only, and a modern minimum TLS version. HTTPS-only redirect is not on by default in App Service; turn it on. Set the minimum TLS version to 1.2 or higher for both the app and its SCM site.
  2. Turn off FTP and basic publishing credentials. Disable SCM and FTP basic authentication and deploy with Microsoft Entra ID. Azure Policy has built-in audit and remediation policies for both.
  3. Remote debugging is off, and access is restricted where it can be. Use access restrictions or private endpoints for anything that should not be on the public internet, starting with the SCM site and the database firewall.
  4. Read what Microsoft Defender for Cloud already says. Its recommendations cover much of this section automatically. It does not see your code, so it complements items 5 to 11 rather than replacing them.
  5. Logs and backups exist and someone looks at them. Diagnostic logging sent to Log Analytics, database backup retention you have actually checked, and an alert that reaches a person when the app fails.

Patching without breaking production

The last item is the one that turns the rest into a habit.

  1. A security fix can reach production in hours, safely. That means a pipeline, not a person: build and run the tests on every package or runtime update, deploy to a staging slot, check the paths that matter, swap, and keep the previous version one swap away for rollback.
01

Update on a schedule

Take package and runtime updates monthly, the week after Patch Tuesday, rather than waiting for a critical one. Small, regular updates break less than a year of them at once.

02

Test the paths that matter

A handful of automated tests over sign-in, the main transactions and the integrations catches most update regressions. You don't need full coverage to patch safely.

03

Stage, swap, and keep a way back

Deploy to a staging slot, warm it up, swap, and swap back if something is wrong. Store Data Protection keys outside the slot first, or the swap signs users out.

04

Choose your runtime cadence

On Linux App Service, the Extended release channel gives you time to validate a runtime patch before it arrives; Latest gets fixes soonest. Pick one deliberately rather than by default.

When to get help

If the checklist turned up more than your team has time for, or you can't tell which findings matter in your code, that is what our .NET and Azure security review is for: a fixed-price, read-only review of one application and its Azure hosting, with ranked findings and a patch plan. It is a review, not a penetration test. If nobody on the team understands the application well enough to answer these questions, start with what to do when your developer leaves.

More guides

Craftware Technologies builds and modernizes custom .NET and Azure software from Sugar Land, Texas, with senior engineers in US Central time. If you have run the checks and want a second pair of eyes on what they found, or on how your patches reach production, sales@craftwaretech.com reaches us.