Blog
IT infrastructure automation: how to manage infrastructure as code
Learn how to manage IT infrastructure as code for Windows 365, Intune, and Azure Virtual Desktop with Bicep and Terraform pipelines.
Nerdio is Microsoft’s 2026 Americas ISV Partner of the Year Get the story
Blog
Learn how to manage IT infrastructure as code for Windows 365, Intune, and Azure Virtual Desktop with Bicep and Terraform pipelines.
Table of Contents
Someone changed a scaling plan in the Azure Portal at 6 PM on Friday. Monday's login storm hits a host pool with half last week's capacity, and with infrastructure as code (IaC) the answer to what changed sits in a commit log.
Generic IaC playbooks assume every resource is disposable. A desktop estate carries state in its session hosts, images, and profiles. The host management model you choose decides which tools work at all, and the work between deployments needs an operator layer alongside the pipeline.
This guide is for platform owners and IT operations managers who run Windows 365, Microsoft Intune, and Azure Virtual Desktop and want desktop infrastructure defined in version-controlled code, with a pipeline between every change and production.
For Windows Cloud (the umbrella term for Windows 365 and Azure Virtual Desktop), IT infrastructure automation means defining Windows 365, Intune, and Azure Virtual Desktop in code and changing them only through a pipeline.
IaC manages infrastructure through code, and infrastructure automation is the broader practice that also covers configuration management and workflow orchestration. Microsoft's Well-Architected Framework favors declarative IaC tools that define the desired state of the environment.
Red Hat describes artificial intelligence for IT operations (AIOps) as "an approach to automating IT operations with machine learning and other advanced AI techniques," and IaC can supply the centralized data layer that kind of automation runs on.
Declarative IaC gives more predictable results on repeat runs than imperative scripts. A Bicep or Terraform file is declarative. It declares the end state, and the engine reconciles toward it.
Azure CLI and PowerShell scripts are imperative, and Microsoft's Cloud Adoption Framework notes imperative scripts depend on the environment's current state.
Human error and rising cloud waste are both problems a code-defined estate helps you control. Uptime Institute's Annual Outage Analysis 2025, a data center survey, found 85% of human-error incidents stem from staff failing to follow procedures or from flawed procedures. Nearly 40% of organizations in that survey had a major human-error outage in the past three years.
Flexera's 2026 State of the Cloud Report found wasted spend on infrastructure as a service (IaaS) and platform as a service (PaaS) rose to 29%, the first increase in five years.
For a desktop team, those numbers show up as the Friday portal change from the opening and session hosts that keep running after users sign off. Fixing either one starts with knowing which parts of the estate code can manage.
A desktop estate breaks the generic playbook because its session hosts, and the images and profiles behind them, carry live user sessions and state. The tooling to manage them as code is also incomplete.
An Azure Virtual Desktop host pool, application group, workspace, and scaling plan behave like disposable resources. They are Azure Resource Manager (ARM) objects with Bicep references and matching resources in the azurerm Terraform provider. Replace a session host mid-shift and every user signed in to it gets disconnected.
The azurerm provider, at 5.9.0, still has no session host configuration resource because the underlying REST application programming interfaces (APIs) remain in preview. The documented workaround is an azurerm_windows_virtual_machine plus a PowerShell azurerm_virtual_machine_extension. Both Azure Verified Modules for host pools and scaling plans pin azurerm below 5.0.
Check module and provider versions against each other before you design a pipeline. Some management platforms ship their own Terraform providers to cover host lifecycle. The host management model you pick for Azure Virtual Desktop decides which tooling works at all.
Microsoft documents a choice between letting the service manage hosts and managing them yourself:
Outside of session hosts, each layer of a Windows Cloud estate has its own configuration path:
A working practice therefore layers several toolchains in one repository.
Windows 365 operations also require Intune management and an ongoing app lifecycle, with license reclamation as part of routine review. Azure Virtual Desktop is managed through the Azure Portal, PowerShell, and Intune.
Define each layer in a declarative tool, keep every definition in source control, and let a gated pipeline make every change.
That pipeline handles change. Runtime operations build on Microsoft's native services within their documented limits.
An operator layer adds to native Microsoft automation in scaling, host patching, and Intune app delivery. Nerdio Manager for Enterprise is one such layer, with CPU and RAM scaling triggers, image updates, and Intune policy recovery.
Native autoscale runs on schedules and a capacity threshold, and Microsoft's autoscale documentation describes no CPU or memory triggers. In Microsoft's documented example, two hosts at 20 sessions each give a capacity of 40, and with a 75% threshold the 31st session turns on a third host.
Hosts under maintenance need the scaling plan's exclusion tag (Microsoft's example is excludeFromScaling), because pooled multi-session autoscale overwrites drain mode.
Microsoft's update methodology guidance recommends session host update for Windows multi-session hosts and marks Azure Update Manager as unsupported there. Session host update replaces VMs in batches, and manual files and registry keys on the old VMs are lost. Microsoft also states you can't use it when you manage hosts with your own tools, which is the model a pipeline requires.
Native Intune application delivery can take up to 3 hours because Intune does not poll continuously, and Intune has no native backup and restore for deleted policies. For these workflows, Nerdio Manager extends and enhances Intune with application delivery and policy backup and restore.
Automation that reaches every host can break every host. Google Cloud's June 12, 2025 incident was triggered by a policy change containing blank fields that replicated globally within seconds and had no feature-flag protection. Some customers' monitoring ran on Google Cloud and failed with it.
For desktops, the equivalent is a canary host pool with health gates before each expansion, plus monitoring that lives outside the pipeline being changed.
Nerdio Manager fits as a runtime operator for scaling and app delivery, working alongside the pipeline that owns every change. It deploys from Microsoft Marketplace into your Azure subscription, and Microsoft infrastructure remains in place.
Carvana's Cloud Support Team Lead Brandon Holliday said, "When we saw Nerdio, I recognized immediately that they had put real thought into usability."
In a benchmark white paper from Dr. Benny Tritsch, a custom image update took 5:09 and 146 clicks natively versus 0:37 and 13 clicks in Nerdio Manager. That's 88% less time and 91% fewer clicks, which means fewer manual steps where a configuration error can slip in. Nerdio's Unified Application Management delivers apps to Cloud PCs in about 30 seconds.
Patented auto-scaling adds CPU and RAM triggers to session counts and can save enterprise customers on Azure compute. TechTarget's Enterprise Strategy Group found up to a 55% reduction in Azure Virtual Desktop costs with Nerdio Manager compared to running Azure Virtual Desktop alone in its economic validation report.
For a total-cost comparison, account for compute and Microsoft OS/access licensing alongside the third-party management layer. Your pipeline keeps ownership of every change, and the operator handles the scaling, patching, and app delivery that happen between commits.
Start with one non-production host pool and put it, along with its image build, behind a gated pipeline.
Get a demo to see how Nerdio Manager works across your Windows 365 and Azure Virtual Desktop environment, or try it free in your Azure tenant.
No, infrastructure as code is one practice inside infrastructure automation. In practice, runtime work such as scaling and self-healing happens outside any static template.
Nearly every layer. Windows 365 provisioning policies and device images go through Microsoft Graph, Intune settings travel as exported settings catalog JSON, and Azure Virtual Desktop host pools, application groups, workspaces, and scaling plans deploy from Bicep or Terraform. FSLogix is the exception, since it's configured through registry keys and Group Policy and has no IaC resource.
Use Bicep for an Azure-only estate and Terraform if your team standardizes on one tool across platforms. Microsoft recommends Bicep over ARM JSON templates, and Bicep exposes session host configuration through a preview ARM resource.
Partly. Provisioning policies and device images can be managed as code through Microsoft Graph. For Windows 365, Nerdio Manager's strongest value is Intune management after provisioning.
Learn more about Nerdio Manager