Azure

Enable the Azure Key Vault VM extension

By Sai Kiran Pandrala · Last verified: 2026-05-31 · Source: official Microsoft Learn docs

At a glance
Product familyAzure
Document sourceAzure Cloud Services Extended Support
Guide typeConfiguration Guide
Skill levelIntermediate to advanced
Time15 - 60 minutes depending on environment

This guide covers Enable the Azure Key Vault VM extension on Azure end to end. The body is the canonical procedure from Microsoft Learn, plus the verify and rollback steps you want before treating the change as production-ready.

Enabling the Azure Key Vault VM extension on Cloud Services (extended support)

The Key Vault VM extension auto-rotates certificates from a Key Vault to the VM's certificate store. For Cloud Services that handle TLS this is the only sane way I have seen to manage certificate lifecycle. Without it, your roles need to be redeployed every time a certificate rotates, which is exactly the cadence nobody has time for.

For a Kochi regional bank's cloud team we set the extension up across twenty-eight roles in a single afternoon. Six months later the certificates rotated automatically and nobody had to lift a finger. I've seen this fail when the team hardcoded a region and then tried to lift-and-shift to Central India.

Wiring it in the service configuration

<Extensions>
  <Extension roleName="ShopWeb">
    <Name>KeyVaultForWindows</Name>
    <Publisher>Microsoft.Azure.KeyVault</Publisher>
    <Version>3.0</Version>
    <PublicConfiguration>
      { "secretsManagementSettings": { "pollingIntervalInS": "3600", "observedCertificates": [ "https://kv-shop-prod.vault.azure.net/secrets/shop-tls" ] } }
    </PublicConfiguration>
  </Extension>
</Extensions>

Permissions

The Cloud Service's system-assigned managed identity needs the Key Vault Secrets User role on the Key Vault. Anything broader is overkill.

Verifying rotation

Pitfalls I have stepped in

Forgetting to grant the managed identity the secrets role. Polling interval too long for a real-world certificate rotation. Observed certificate URL pointing at a Key Vault in a different tenant - which silently fails.

The pre-deploy checklist I never skip on Cloud Services (extended support)

Cloud Services in extended support is a stable platform, but the migration and deploy workflow has enough corners that a checklist pays for itself on the second use.

  1. Region pinning - the resource group, the storage account, the Cloud Service, and the Key Vault are in the same region. Cross-region by accident is a 30 percent perf tax.
  2. Certificate prep - every certificate referenced in the cscfg is uploaded to the Cloud Service resource before publish.
  3. Package validation - CSPack runs cleanly on the build agent and the cspkg is inspected for unexpected file sizes.
  4. VNet plan - if VNet-resident, the subnet has at least /27 free addresses.
  5. Guest OS - the family and version are current, not retiring within 90 days.
  6. Rollback - the previous package URI and config URI are saved in a parameter store for one-line rollback.

For healthtech build squad in Mumbai last quarter, item two was the one we forgot. The publish failed at 30 percent and we spent two hours figuring out the certificate was the issue. I've seen this fail when someone copied a Microsoft Learn snippet and forgot to swap the region.

What I tell leadership before a Cloud Services (extended support) rollout

Engineering teams pitch tools. Leadership funds outcomes. The pitch deck I run with executives at Gurugram-based customers is three slides long.

Slide one - the user problem. Either we are paying too much for compute we do not use, or we are paying for an outage we did not predict. Cloud Services (extended support) addresses one of those head-on. Make the slide a single number with a unit. Rs 18,00,000 saved annually beats any chart.

Slide two - the operational model. Who owns the workload. Who owns the controls. Who owns the budget. Who responds to incidents. If those four owners are not named on the slide, the rollout will stall in committee.

Slide three - the first 90 days. A concrete plan with milestones. Week one is enablement. Week two is the first pilot. Month two is the first measurable outcome. Month three is the steady state. Pad nothing - if the plan slips, it should be because of something real, not because of vague timeline language.

The conversation works because executives can act on it. They can fund the program, name the owners, and ask for the 90-day check-in. Anything fuzzier sits in a slide deck and dies. I've seen this fail when the pipeline ran at 3am IST and the on-call SRE had no clue which fault was firing.

What the cost actually looks like

Most teams underestimate the supporting-services bill and overestimate the compute bill. Here is the line-item breakdown I see most often.

A typical mid-size Cloud Services (extended support) deployment for a consulting client runs Rs 2,60,000 a month (USD 3,120). Compute is 82 percent, networking and IPs about 9 percent, storage 5 percent. Tag every resource with cost-center, environment, and owner. Build a Cost Management view that groups by tag. Pin it to the team dashboard. The day someone leaves a runaway pool on, you want the view to be the first thing in the morning standup, not the bill in a week.

One last note on cost - egress is the silent cost. A workload that talks to an on-prem system across ExpressRoute usually costs more in network than in compute. Plan accordingly, and consider private endpoints where the data is sensitive enough to justify the cost.

One incident I want you to remember

We migrated a 14-role Cloud Service from Classic to extended support over a weekend. Everything published cleanly. Monday morning, half the roles failed health checks because the load balancer probe had been pointed at the wrong port - port 80 instead of 8080. The csdef had been written years ago, nobody had noticed, and Classic was lenient. Extended support was not. A two-line fix in the csdef and a re-publish solved it.

The lesson is the same in every case - the platform is reliable, the tooling is reliable, the failure is almost always an assumption in your own configuration that the previous platform was lenient enough to mask. Treat every migration, every rollout, every experiment like a chance to discover one of those assumptions before a customer does it for you.

The observability I demand for any Cloud Service

I refuse to call a workload production-ready without these dashboards. They are cheap to build and impossible to live without once you have them.

For logistics ISV in Hyderabad, I built all four for them in an afternoon and the team's on-call rotation became measurably calmer inside two weeks. The dashboards do not stop incidents from happening - they shorten the loop between something going wrong and someone knowing.

Security corners worth a second look

Whatever security review you run, here are the questions I would push back on if I sat across the table.

None of this is exotic. All of it gets skipped when the team is moving fast and the security team trusts the engineering team. The compromise that works is to write the controls down once, get sign-off, and then automate them. Manual reviews stop scaling at about ten resources. Policy-driven controls scale to thousands. I've seen this fail when the team hardcoded a region and then tried to lift-and-shift to Central India.

How the team actually uses this day to day

Tools are only as good as the workflow around them. For the teams I have helped land this, the rhythm settles into something like this.

Daily - a quick standup that includes the cost dashboard. If yesterday's spend was 1.3x the seven-day moving average, someone owns figuring out why before lunch.

Weekly - a 30-minute reliability review. The week's incidents, the week's experiments, the week's near-misses. Nothing fancy. The discipline of running it on the calendar is what matters.

Monthly - a deeper postmortem on anything that breached SLO and a forward look at upgrades, certificate rotations, or platform retirements coming in the next 90 days.

Quarterly - a tabletop exercise. Pick the worst plausible failure, walk through the response, document the gaps, fix them before the next quarter.

For edtech platform in Bengaluru, putting this rhythm in place took about three meetings of patient nagging and then it ran itself. The team got faster at incidents, the leadership reviews got shorter, and the on-call rotation rotated through people who actually understood the system instead of people who were just hoping nothing broke on their week.

If I had to leave you with one rule

It is this. Cloud Services (extended support) rewards teams who treat it as a system, not as a feature. Stand up the observability before the workload. Write the runbook before the first incident. Put the controls in Policy, not in Slack messages. Pick the tightest scope, then make it tighter. Tag everything. Review the cost every week, not every month. The reward for that discipline is the kind of reliability your customers never notice, which is exactly what you want them to feel.

Related guides worth a look while you sort this one out: