Microsoft.AzureStackHCI virtualHardDisks

Bicep resource definition

The virtualHardDisks resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Usage Examples

Azure Verified Modules

The following Azure Verified Modules can be used to deploy this resource type.

Module Description
Azure Stack HCI Hard Disk AVM Resource Module for Azure Stack HCI Hard Disk

Resource format

To create a Microsoft.AzureStackHCI/virtualHardDisks resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.AzureStackHCI/virtualHardDisks@2026-07-01-preview' = {
  extendedLocation: {
    name: 'string'
    type: 'string'
  }
  location: 'string'
  name: 'string'
  properties: {
    blockSizeBytes: int
    containerId: 'string'
    createFromLocal: bool
    creationData: {
      createOption: 'string'
      sourceResourceId: 'string'
    }
    diskFileFormat: 'string'
    diskSizeGB: int
    downloadUrl: 'string'
    dynamic: bool
    hyperVGeneration: 'string'
    localVhdPath: 'string'
    logicalSectorBytes: int
    maxShares: int
    physicalSectorBytes: int
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

Microsoft.AzureStackHCI/virtualHardDisks

Name Description Value
extendedLocation The extendedLocation of the resource. ExtendedLocation
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
properties The resource-specific properties for this resource. VirtualHardDiskProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation 'Copy'
'Empty' (required)
sourceResourceId ARM ID of the source resource used for disk creation. Required when createOption is Copy string

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

TrackedResourceTags

Name Description Value

VirtualHardDiskProperties

Name Description Value
blockSizeBytes Block size in bytes int
containerId Storage ContainerID of the storage container to be used for VHD string
createFromLocal Boolean indicating whether it is an existing local hard disk or if one should be created. bool
creationData Data used when creating a virtual hard disk CreationData
diskFileFormat The format of the actual VHD file [vhd, vhdx] 'vhd'
'vhdx'
diskSizeGB Size of the disk in GB int
downloadUrl URL for downloading or accessing the virtual hard disk. This URL points to a secure link from where the VHD can be downloaded or accessed directly. string

Constraints:
Sensitive value. Pass in as a secure parameter.
dynamic Boolean for enabling dynamic sizing on the virtual hard disk bool
hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2] 'NA'
'V1'
'V2'
localVhdPath Absolute path of the VHD. This is only applicable when createFromLocal is true. string

Constraints:
Sensitive value. Pass in as a secure parameter.
logicalSectorBytes Logical sector in bytes int
maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. int
physicalSectorBytes Physical sector in bytes int

ARM template resource definition

The virtualHardDisks resource type can be deployed with operations that target:

Usage Examples

Resource format

To create a Microsoft.AzureStackHCI/virtualHardDisks resource, add the following JSON to your template.

{
  "type": "Microsoft.AzureStackHCI/virtualHardDisks",
  "apiVersion": "2026-07-01-preview",
  "name": "string",
  "extendedLocation": {
    "name": "string",
    "type": "string"
  },
  "location": "string",
  "properties": {
    "blockSizeBytes": "int",
    "containerId": "string",
    "createFromLocal": "bool",
    "creationData": {
      "createOption": "string",
      "sourceResourceId": "string"
    },
    "diskFileFormat": "string",
    "diskSizeGB": "int",
    "downloadUrl": "string",
    "dynamic": "bool",
    "hyperVGeneration": "string",
    "localVhdPath": "string",
    "logicalSectorBytes": "int",
    "maxShares": "int",
    "physicalSectorBytes": "int"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

Microsoft.AzureStackHCI/virtualHardDisks

Name Description Value
apiVersion The api version '2026-07-01-preview'
extendedLocation The extendedLocation of the resource. ExtendedLocation
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
properties The resource-specific properties for this resource. VirtualHardDiskProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.AzureStackHCI/virtualHardDisks'

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation 'Copy'
'Empty' (required)
sourceResourceId ARM ID of the source resource used for disk creation. Required when createOption is Copy string

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

TrackedResourceTags

Name Description Value

VirtualHardDiskProperties

Name Description Value
blockSizeBytes Block size in bytes int
containerId Storage ContainerID of the storage container to be used for VHD string
createFromLocal Boolean indicating whether it is an existing local hard disk or if one should be created. bool
creationData Data used when creating a virtual hard disk CreationData
diskFileFormat The format of the actual VHD file [vhd, vhdx] 'vhd'
'vhdx'
diskSizeGB Size of the disk in GB int
downloadUrl URL for downloading or accessing the virtual hard disk. This URL points to a secure link from where the VHD can be downloaded or accessed directly. string

Constraints:
Sensitive value. Pass in as a secure parameter.
dynamic Boolean for enabling dynamic sizing on the virtual hard disk bool
hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2] 'NA'
'V1'
'V2'
localVhdPath Absolute path of the VHD. This is only applicable when createFromLocal is true. string

Constraints:
Sensitive value. Pass in as a secure parameter.
logicalSectorBytes Logical sector in bytes int
maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. int
physicalSectorBytes Physical sector in bytes int

Terraform (AzAPI provider) resource definition

The virtualHardDisks resource type can be deployed with operations that target:

  • Resource groups For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AzureStackHCI/virtualHardDisks resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AzureStackHCI/virtualHardDisks@2026-07-01-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    extendedLocation = {
      name = "string"
      type = "string"
    }
    properties = {
      blockSizeBytes = int
      containerId = "string"
      createFromLocal = bool
      creationData = {
        createOption = "string"
        sourceResourceId = "string"
      }
      diskFileFormat = "string"
      diskSizeGB = int
      downloadUrl = "string"
      dynamic = bool
      hyperVGeneration = "string"
      localVhdPath = "string"
      logicalSectorBytes = int
      maxShares = int
      physicalSectorBytes = int
    }
  }
}

Property Values

Microsoft.AzureStackHCI/virtualHardDisks

Name Description Value
extendedLocation The extendedLocation of the resource. ExtendedLocation
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
properties The resource-specific properties for this resource. VirtualHardDiskProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.AzureStackHCI/virtualHardDisks@2026-07-01-preview"

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation 'Copy'
'Empty' (required)
sourceResourceId ARM ID of the source resource used for disk creation. Required when createOption is Copy string

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

TrackedResourceTags

Name Description Value

VirtualHardDiskProperties

Name Description Value
blockSizeBytes Block size in bytes int
containerId Storage ContainerID of the storage container to be used for VHD string
createFromLocal Boolean indicating whether it is an existing local hard disk or if one should be created. bool
creationData Data used when creating a virtual hard disk CreationData
diskFileFormat The format of the actual VHD file [vhd, vhdx] 'vhd'
'vhdx'
diskSizeGB Size of the disk in GB int
downloadUrl URL for downloading or accessing the virtual hard disk. This URL points to a secure link from where the VHD can be downloaded or accessed directly. string

Constraints:
Sensitive value. Pass in as a secure parameter.
dynamic Boolean for enabling dynamic sizing on the virtual hard disk bool
hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2] 'NA'
'V1'
'V2'
localVhdPath Absolute path of the VHD. This is only applicable when createFromLocal is true. string

Constraints:
Sensitive value. Pass in as a secure parameter.
logicalSectorBytes Logical sector in bytes int
maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. int
physicalSectorBytes Physical sector in bytes int