Share via

ARM template deployment error: missing subnetId parameter when creating Windows VM

SilverSurfer 25 Reputation points
2026-02-10T22:42:03.92+00:00

Hi!

I'm attempting to deploy a Windows VM in Azure (free services) and encountering the following validation error:

Deployment template validation failed: 'The value for the template parameter 'subnetId' at line '1' and column '1549' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.'. (código: InvalidTemplate)

The deployment fails because the subnetId parameter is not being provided to the template. The form doesn't ask for this parameter either User's image

Has anyone encountered this issue? What's the correct way to pass the subnet ID parameter to resolve this validation error?

Any guidance would be appreciated. Thank you!

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


Answer accepted by question author

TP 156.6K Reputation points Volunteer Moderator
2026-02-11T04:19:02.85+00:00

Hi,

There is a bug in the Marketplace Free VM offer that causes this error. What you can do is manually create VM using correct parameters to qualify for free. To start the process you may use link below (this is for Windows with notes for Linux VM after):

https://portal.azure.com/#create/Microsoft.VirtualMachine

For Windows, when creating, set

  • Size: Standard_B2ats_v2
  • Image: [smalldisk] Windows Server 2022 Datacenter: Azure Edition Core - x64 Gen2
  • OS disk size: 64 GiB (P6)
  • OS disk type: Premium SSD (locally-redundant storage)
  • Monitoring tab: Boot diagnostics: Disable

NOTE: Above is for core edition of Windows Server, so no graphical interface. If you want GUI you may choose [smalldisk] Windows Server 2022 Datacenter: Azure Edition - x64 Gen2 instead.

Don't enable any of the options if you want to avoid charges, for example, if you turned on Backup that has a charge associated with it.

After creating VM, please monitor costs (at least daily) by navigating to your subscription. If you used correct parameters for the VM you should not see any charges accrue related to it, except for the public IP address. Charges are delayed, so it will take typically several hours (after creation) before any would show up.

If you associate Public IP address with the VM you will be charged for this (about $3.65/month each). You can minimize the charges by dissociating it from the VM's network interface and deleting it when you are not using the VM.

When you want to use VM again you would create Public IP and associate it with VM's network interface.

For Linux you would use Ubuntu Server 22.04 LTS - x64 Gen2 or other free Linux image with P6 LRS disk.

After creating Windows VM you should expand disk so you are using full 64 GiB:

https://learn.microsoft.com/en-us/azure/virtual-machines/windows/expand-disks

After creating Linux VM you should expand the partition so you are using the full 64 GiB:

https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=ubuntu#expand-a-disk-partition-and-filesystem

Please click Accept Answer and upvote if the above was helpful.

Thanks.

-TP

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Himanshu Shekhar 6,145 Reputation points Microsoft External Staff Moderator
    2026-02-10T23:38:49.7633333+00:00

    SilverSurfer

    This error is not something you can fix from that “Free VM / Marketplace offer” blade. There’s currently a bug in the Marketplace Free VM offer where the underlying deployment is triggered without supplying the required subnetId parameter, so ARM validation fails with InvalidTemplate.

    Workaround (recommended):

    create the VM manually from the standard VM creation page instead of the Free VM offer. Start here: https://portal.azure.com/#create/Microsoft.VirtualMachine

    Then for Windows, use the same values mentioned in the accepted answer (to stay within the free offer configuration), e.g. VM size Standard_B2ats_v2, [smalldisk] Windows Server 2022..., OS disk 64 GiB (P6) with Premium SSD (LRS), and disable Boot diagnostics (and avoid add-ons like Backup to prevent charges). [learn.microsoft.com]

    If you are deploying your own ARM template (Custom deployment/CLI/PowerShell): then yes, you must pass subnetId via a parameter file (or inline parameters). Parameter files are the supported approach to provide required parameters during deployment.

    Example parameter file:

    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "subnetId": {
          "value": "/subscriptions/<subId>/resourceGroups/<vnetRg>/providers/Microsoft.Network/virtualNetworks/<vnetName>/subnets/<subnetName>"
        }
      }
    }
    
    
    

    Microsoft docs:

    1. Parameter files for ARM deployments: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-tutorial-use-parameter-file
    2. Troubleshooting ARM template deployment errors: https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/quickstart-troubleshoot-arm-deployment

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.