published on Friday, Mar 20, 2026 by Pulumi
published on Friday, Mar 20, 2026 by Pulumi
A Disk.
Uses Azure REST API version 2018-09-15. In version 2.x of the Azure Native provider, it used API version 2018-09-15.
Example Usage
Disks_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var disk = new AzureNative.DevTestLab.Disk("disk", new()
{
DiskSizeGiB = 1023,
DiskType = AzureNative.DevTestLab.StorageType.Standard,
LabName = "{labName}",
LeasedByLabVmId = "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName",
Name = "{diskName}",
ResourceGroupName = "resourceGroupName",
UserName = "{userId}",
});
});
package main
import (
devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devtestlab.NewDisk(ctx, "disk", &devtestlab.DiskArgs{
DiskSizeGiB: pulumi.Int(1023),
DiskType: pulumi.String(devtestlab.StorageTypeStandard),
LabName: pulumi.String("{labName}"),
LeasedByLabVmId: pulumi.String("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
Name: pulumi.String("{diskName}"),
ResourceGroupName: pulumi.String("resourceGroupName"),
UserName: pulumi.String("{userId}"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.devtestlab.Disk;
import com.pulumi.azurenative.devtestlab.DiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var disk = new Disk("disk", DiskArgs.builder()
.diskSizeGiB(1023)
.diskType("Standard")
.labName("{labName}")
.leasedByLabVmId("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName")
.name("{diskName}")
.resourceGroupName("resourceGroupName")
.userName("{userId}")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const disk = new azure_native.devtestlab.Disk("disk", {
diskSizeGiB: 1023,
diskType: azure_native.devtestlab.StorageType.Standard,
labName: "{labName}",
leasedByLabVmId: "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName",
name: "{diskName}",
resourceGroupName: "resourceGroupName",
userName: "{userId}",
});
import pulumi
import pulumi_azure_native as azure_native
disk = azure_native.devtestlab.Disk("disk",
disk_size_gi_b=1023,
disk_type=azure_native.devtestlab.StorageType.STANDARD,
lab_name="{labName}",
leased_by_lab_vm_id="/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName",
name="{diskName}",
resource_group_name="resourceGroupName",
user_name="{userId}")
resources:
disk:
type: azure-native:devtestlab:Disk
properties:
diskSizeGiB: 1023
diskType: Standard
labName: '{labName}'
leasedByLabVmId: /subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName
name: '{diskName}'
resourceGroupName: resourceGroupName
userName: '{userId}'
Create Disk Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Disk(name: string, args: DiskArgs, opts?: CustomResourceOptions);@overload
def Disk(resource_name: str,
args: DiskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Disk(resource_name: str,
opts: Optional[ResourceOptions] = None,
lab_name: Optional[str] = None,
user_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
leased_by_lab_vm_id: Optional[str] = None,
host_caching: Optional[str] = None,
disk_uri: Optional[str] = None,
disk_blob_name: Optional[str] = None,
location: Optional[str] = None,
managed_disk_id: Optional[str] = None,
name: Optional[str] = None,
disk_type: Optional[Union[str, StorageType]] = None,
storage_account_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
disk_size_gi_b: Optional[int] = None)func NewDisk(ctx *Context, name string, args DiskArgs, opts ...ResourceOption) (*Disk, error)public Disk(string name, DiskArgs args, CustomResourceOptions? opts = null)type: azure-native:devtestlab:Disk
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var azure_nativeDiskResource = new AzureNative.DevTestLab.Disk("azure-nativeDiskResource", new()
{
LabName = "string",
UserName = "string",
ResourceGroupName = "string",
LeasedByLabVmId = "string",
HostCaching = "string",
DiskUri = "string",
DiskBlobName = "string",
Location = "string",
ManagedDiskId = "string",
Name = "string",
DiskType = "string",
StorageAccountId = "string",
Tags =
{
{ "string", "string" },
},
DiskSizeGiB = 0,
});
example, err := devtestlab.NewDisk(ctx, "azure-nativeDiskResource", &devtestlab.DiskArgs{
LabName: pulumi.String("string"),
UserName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
LeasedByLabVmId: pulumi.String("string"),
HostCaching: pulumi.String("string"),
DiskUri: pulumi.String("string"),
DiskBlobName: pulumi.String("string"),
Location: pulumi.String("string"),
ManagedDiskId: pulumi.String("string"),
Name: pulumi.String("string"),
DiskType: pulumi.String("string"),
StorageAccountId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
DiskSizeGiB: pulumi.Int(0),
})
var azure_nativeDiskResource = new com.pulumi.azurenative.devtestlab.Disk("azure-nativeDiskResource", com.pulumi.azurenative.devtestlab.DiskArgs.builder()
.labName("string")
.userName("string")
.resourceGroupName("string")
.leasedByLabVmId("string")
.hostCaching("string")
.diskUri("string")
.diskBlobName("string")
.location("string")
.managedDiskId("string")
.name("string")
.diskType("string")
.storageAccountId("string")
.tags(Map.of("string", "string"))
.diskSizeGiB(0)
.build());
azure_native_disk_resource = azure_native.devtestlab.Disk("azure-nativeDiskResource",
lab_name="string",
user_name="string",
resource_group_name="string",
leased_by_lab_vm_id="string",
host_caching="string",
disk_uri="string",
disk_blob_name="string",
location="string",
managed_disk_id="string",
name="string",
disk_type="string",
storage_account_id="string",
tags={
"string": "string",
},
disk_size_gi_b=0)
const azure_nativeDiskResource = new azure_native.devtestlab.Disk("azure-nativeDiskResource", {
labName: "string",
userName: "string",
resourceGroupName: "string",
leasedByLabVmId: "string",
hostCaching: "string",
diskUri: "string",
diskBlobName: "string",
location: "string",
managedDiskId: "string",
name: "string",
diskType: "string",
storageAccountId: "string",
tags: {
string: "string",
},
diskSizeGiB: 0,
});
type: azure-native:devtestlab:Disk
properties:
diskBlobName: string
diskSizeGiB: 0
diskType: string
diskUri: string
hostCaching: string
labName: string
leasedByLabVmId: string
location: string
managedDiskId: string
name: string
resourceGroupName: string
storageAccountId: string
tags:
string: string
userName: string
Disk Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Disk resource accepts the following input properties:
- Lab
Name string - The name of the lab.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- User
Name string - The name of the user profile.
- Disk
Blob stringName - When backed by a blob, the name of the VHD blob without extension.
- Disk
Size intGi B - The size of the disk in Gibibytes.
- Disk
Type string | Pulumi.Azure Native. Dev Test Lab. Storage Type - The storage type for the disk (i.e. Standard, Premium).
- Disk
Uri string - When backed by a blob, the URI of underlying blob.
- Host
Caching string - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- Leased
By stringLab Vm Id - The resource ID of the VM to which this disk is leased.
- Location string
- The geo-location where the resource lives
- Managed
Disk stringId - When backed by managed disk, this is the ID of the compute disk resource.
- Name string
- The name of the disk.
- Storage
Account stringId - When backed by a blob, the storage account where the blob is.
- Dictionary<string, string>
- Resource tags.
- Lab
Name string - The name of the lab.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- User
Name string - The name of the user profile.
- Disk
Blob stringName - When backed by a blob, the name of the VHD blob without extension.
- Disk
Size intGi B - The size of the disk in Gibibytes.
- Disk
Type string | StorageType - The storage type for the disk (i.e. Standard, Premium).
- Disk
Uri string - When backed by a blob, the URI of underlying blob.
- Host
Caching string - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- Leased
By stringLab Vm Id - The resource ID of the VM to which this disk is leased.
- Location string
- The geo-location where the resource lives
- Managed
Disk stringId - When backed by managed disk, this is the ID of the compute disk resource.
- Name string
- The name of the disk.
- Storage
Account stringId - When backed by a blob, the storage account where the blob is.
- map[string]string
- Resource tags.
- lab
Name String - The name of the lab.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- user
Name String - The name of the user profile.
- disk
Blob StringName - When backed by a blob, the name of the VHD blob without extension.
- disk
Size IntegerGi B - The size of the disk in Gibibytes.
- disk
Type String | StorageType - The storage type for the disk (i.e. Standard, Premium).
- disk
Uri String - When backed by a blob, the URI of underlying blob.
- host
Caching String - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- leased
By StringLab Vm Id - The resource ID of the VM to which this disk is leased.
- location String
- The geo-location where the resource lives
- managed
Disk StringId - When backed by managed disk, this is the ID of the compute disk resource.
- name String
- The name of the disk.
- storage
Account StringId - When backed by a blob, the storage account where the blob is.
- Map<String,String>
- Resource tags.
- lab
Name string - The name of the lab.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- user
Name string - The name of the user profile.
- disk
Blob stringName - When backed by a blob, the name of the VHD blob without extension.
- disk
Size numberGi B - The size of the disk in Gibibytes.
- disk
Type string | StorageType - The storage type for the disk (i.e. Standard, Premium).
- disk
Uri string - When backed by a blob, the URI of underlying blob.
- host
Caching string - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- leased
By stringLab Vm Id - The resource ID of the VM to which this disk is leased.
- location string
- The geo-location where the resource lives
- managed
Disk stringId - When backed by managed disk, this is the ID of the compute disk resource.
- name string
- The name of the disk.
- storage
Account stringId - When backed by a blob, the storage account where the blob is.
- {[key: string]: string}
- Resource tags.
- lab_
name str - The name of the lab.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- user_
name str - The name of the user profile.
- disk_
blob_ strname - When backed by a blob, the name of the VHD blob without extension.
- disk_
size_ intgi_ b - The size of the disk in Gibibytes.
- disk_
type str | StorageType - The storage type for the disk (i.e. Standard, Premium).
- disk_
uri str - When backed by a blob, the URI of underlying blob.
- host_
caching str - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- leased_
by_ strlab_ vm_ id - The resource ID of the VM to which this disk is leased.
- location str
- The geo-location where the resource lives
- managed_
disk_ strid - When backed by managed disk, this is the ID of the compute disk resource.
- name str
- The name of the disk.
- storage_
account_ strid - When backed by a blob, the storage account where the blob is.
- Mapping[str, str]
- Resource tags.
- lab
Name String - The name of the lab.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- user
Name String - The name of the user profile.
- disk
Blob StringName - When backed by a blob, the name of the VHD blob without extension.
- disk
Size NumberGi B - The size of the disk in Gibibytes.
- disk
Type String | "Standard" | "Premium" | "StandardSSD" - The storage type for the disk (i.e. Standard, Premium).
- disk
Uri String - When backed by a blob, the URI of underlying blob.
- host
Caching String - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
- leased
By StringLab Vm Id - The resource ID of the VM to which this disk is leased.
- location String
- The geo-location where the resource lives
- managed
Disk StringId - When backed by managed disk, this is the ID of the compute disk resource.
- name String
- The name of the disk.
- storage
Account StringId - When backed by a blob, the storage account where the blob is.
- Map<String>
- Resource tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the Disk resource produces the following output properties:
- Azure
Api stringVersion - The Azure API version of the resource.
- Created
Date string - The creation date of the disk.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning status of the resource.
- System
Data Pulumi.Azure Native. Dev Test Lab. Outputs. System Data Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Unique
Identifier string - The unique immutable identifier of a resource (Guid).
- Azure
Api stringVersion - The Azure API version of the resource.
- Created
Date string - The creation date of the disk.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning status of the resource.
- System
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Unique
Identifier string - The unique immutable identifier of a resource (Guid).
- azure
Api StringVersion - The Azure API version of the resource.
- created
Date String - The creation date of the disk.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning status of the resource.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- unique
Identifier String - The unique immutable identifier of a resource (Guid).
- azure
Api stringVersion - The Azure API version of the resource.
- created
Date string - The creation date of the disk.
- id string
- The provider-assigned unique ID for this managed resource.
- provisioning
State string - The provisioning status of the resource.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- unique
Identifier string - The unique immutable identifier of a resource (Guid).
- azure_
api_ strversion - The Azure API version of the resource.
- created_
date str - The creation date of the disk.
- id str
- The provider-assigned unique ID for this managed resource.
- provisioning_
state str - The provisioning status of the resource.
- system_
data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- unique_
identifier str - The unique immutable identifier of a resource (Guid).
- azure
Api StringVersion - The Azure API version of the resource.
- created
Date String - The creation date of the disk.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning status of the resource.
- system
Data Property Map - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- unique
Identifier String - The unique immutable identifier of a resource (Guid).
Supporting Types
StorageType, StorageTypeArgs
- Standard
Standard- Premium
Premium- Standard
SSD StandardSSD
- Storage
Type Standard Standard- Storage
Type Premium Premium- Storage
Type Standard SSD StandardSSD
- Standard
Standard- Premium
Premium- Standard
SSD StandardSSD
- Standard
Standard- Premium
Premium- Standard
SSD StandardSSD
- STANDARD
Standard- PREMIUM
Premium- STANDARD_SSD
StandardSSD
- "Standard"
Standard- "Premium"
Premium- "Standard
SSD" StandardSSD
SystemDataResponse, SystemDataResponseArgs
Metadata pertaining to creation and last modification of the resource.- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:devtestlab:Disk {diskName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
published on Friday, Mar 20, 2026 by Pulumi
