Proposed Pull Request Change

title description ms.topic ms.custom ms.date
Linter rule - use stable VM image Linter rule - use stable VM image reference devx-track-bicep 10/30/2025
📄 Document Links
GitHub View on GitHub Microsoft Learn View on Microsoft Learn
⚠ Content Truncation Detected
The generated rewrite appears to be incomplete.
Original lines: -
Output lines: -
Ratio: -
Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
+0 -0
+0 -0
--- title: Linter rule - use stable VM image description: Linter rule - use stable VM image ms.topic: reference ms.custom: devx-track-bicep ms.date: 10/30/2025 --- # Linter rule - use stable VM image Virtual machines shouldn't use preview images. This rule checks the following properties under "imageReference" and fails if any of them contain the string "preview": - offer - sku - version ## Linter rule code To customize rule settings, use the following value in the [Bicep configuration file](bicep-config-linter.md) `use-stable-vm-image` ## Solution The following example fails this test. ```bicep param location string = resourceGroup().location resource vm 'Microsoft.Compute/virtualMachines@2025-04-01' = { name: 'virtualMachineName' location: location properties: { storageProfile: { imageReference: { offer: 'WindowsServer-preview' sku: '2019-Datacenter-preview' version: 'preview' } } } } ``` You can fix it by using an image that doesn't contain the string `preview` in the imageReference. ```bicep param location string = resourceGroup().location resource vm 'Microsoft.Compute/virtualMachines@2025-04-01' = { name: 'virtualMachineName' location: location properties: { storageProfile: { imageReference: { offer: 'WindowsServer' sku: '2019-Datacenter' version: 'latest' } } } } ``` ## Next steps For more information about the linter, see [Use Bicep linter](./linter.md).
Success! Branch created successfully. Create Pull Request on GitHub
Error: