Skip to content

feat(vm-samples): Intel TDX support, Confidential OS disk encryption docs, JWT decode fix#28

Merged
vinfnet merged 2 commits into
Azure-Samples:mainfrom
vinfnet:update-cvm-build-attestation
Jun 3, 2026
Merged

feat(vm-samples): Intel TDX support, Confidential OS disk encryption docs, JWT decode fix#28
vinfnet merged 2 commits into
Azure-Samples:mainfrom
vinfnet:update-cvm-build-attestation

Conversation

@vinfnet

@vinfnet vinfnet commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates BuildRandomCVM.ps1 and supporting docs to support Intel TDX alongside AMD SEV-SNP, run the modern Azure/cvm-attestation-tools attest flow inside the freshly deployed CVM, and decode the returned MAA JWT cross-platform.

Changes

BuildRandomCVM.ps1

  • Auto-detect AMD SEV-SNP (DCa*/ECa*) vs Intel TDX (DCe*/ECe*) from the VM SKU and pick the matching config_snp.json / config_tdx.json.
  • Run the latest attest-lin.zip / attest-win.zip release inside the VM via Invoke-AzVMRunCommand and decode the MAA JWT (header + payload + key claims) using jq on Linux and built-in ConvertFrom-Json on Windows.
  • Pre-flight checks before any resources are created: reject Intel SGX SKUs (different isolation model), validate SKU availability in the target region, and confirm vCPU quota for the SKU's family.
  • Windows fix: relax $ErrorActionPreference around attest.exe (it writes INFO logs to stderr), widen Out-String to 16384 cols, and anchor the JWT regex to eyJ so interleaved Python log lines can't corrupt the captured token.
  • 10×60s retry loop around Invoke-AzVMRunCommand to absorb the transient 409 Conflict the run-command extension can return immediately after VM provisioning (especially on TDX).

Docs

  • vm-samples/README.md: new "What is Confidential OS disk encryption with CMK?" section with comparison table, pre-flight checks subsection, Intel TDX examples, manual cross-platform attest snippets, and aka.ms/accdocs links throughout.
  • README.md: refreshed VM Samples entry to call out TDX + Confidential OS disk encryption + new attestation flow; linked the TDX What's New row to /vm-samples/README.md.
  • WindowsAttest.ps1: deprecation banner pointing at Azure/cvm-attestation-tools.

Validation

End-to-end smoketest deploys (deploy + in-VM attestation + JWT decode + auto-cleanup):

Region OS SKU Result
westeurope Ubuntu 24.04 Standard_DC2es_v6 (TDX) tdxvm / azure-compliant-cvm
westeurope Windows Server 2022 Standard_DC2es_v6 (TDX) tdxvm / azure-compliant-cvm
northeurope Windows Server 2022 Standard_DC2as_v5 (SNP) sevsnpvm / azure-compliant-cvm

…JWT decode fix

BuildRandomCVM.ps1:

- Auto-detect AMD SEV-SNP vs Intel TDX from VM SKU; pick matching cvm-attestation-tools config

- Run latest attest-lin/attest-win release inside the VM and decode the MAA JWT (jq on Linux, ConvertFrom-Json on Windows)

- Pre-flight checks: reject Intel SGX SKUs; verify SKU availability and vCPU quota in target region before creating any resources

- Windows: relax $ErrorActionPreference for attest.exe (writes INFO to stderr), widen Out-String, anchor JWT regex to 'eyJ' so interleaved Python log lines don't corrupt the token

- 10x60s retry loop around Invoke-AzVMRunCommand to absorb post-provision 409 Conflict

Docs:

- vm-samples/README.md: new 'What is Confidential OS disk encryption with CMK?' section, pre-flight checks, TDX examples, manual cross-platform attest snippets, aka.ms/accdocs links

- README.md: refreshed VM Samples entry to call out TDX + Confidential OS disk encryption + new attestation flow; linked TDX What's New row to vm-samples/README.md

- WindowsAttest.ps1: deprecation banner pointing at Azure/cvm-attestation-tools

Validated end-to-end with smoketest deploys (Ubuntu + Windows TDX in westeurope, SNP in northeurope/westeurope).
@vinfnet vinfnet merged commit 1fbb77c into Azure-Samples:main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants