1. Packages
  2. Azure Classic
  3. API Docs
  4. compute
  5. Image

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.compute.Image

Explore with Pulumi AI

Manages a custom virtual machine image that can be used to create virtual machines.

Example Usage

Note: For a more complete example, see the examples/image directory within the GitHub Repository.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.compute.getVirtualMachine({
    name: "examplevm",
    resourceGroupName: "example-resources",
});
const exampleImage = new azure.compute.Image("example", {
    name: "exampleimage",
    location: example.then(example => example.location),
    resourceGroupName: example.then(example => example.name),
    sourceVirtualMachineId: example.then(example => example.id),
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.compute.get_virtual_machine(name="examplevm",
    resource_group_name="example-resources")
example_image = azure.compute.Image("example",
    name="exampleimage",
    location=example.location,
    resource_group_name=example.name,
    source_virtual_machine_id=example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{
			Name:              "examplevm",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		_, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
			Name:                   pulumi.String("exampleimage"),
			Location:               pulumi.String(example.Location),
			ResourceGroupName:      pulumi.String(example.Name),
			SourceVirtualMachineId: pulumi.String(example.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Compute.GetVirtualMachine.Invoke(new()
    {
        Name = "examplevm",
        ResourceGroupName = "example-resources",
    });

    var exampleImage = new Azure.Compute.Image("example", new()
    {
        Name = "exampleimage",
        Location = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Location),
        ResourceGroupName = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Name),
        SourceVirtualMachineId = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetVirtualMachineArgs;
import com.pulumi.azure.compute.Image;
import com.pulumi.azure.compute.ImageArgs;
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) {
        final var example = ComputeFunctions.getVirtualMachine(GetVirtualMachineArgs.builder()
            .name("examplevm")
            .resourceGroupName("example-resources")
            .build());

        var exampleImage = new Image("exampleImage", ImageArgs.builder()
            .name("exampleimage")
            .location(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.location()))
            .resourceGroupName(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.name()))
            .sourceVirtualMachineId(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.id()))
            .build());

    }
}
Copy
resources:
  exampleImage:
    type: azure:compute:Image
    name: example
    properties:
      name: exampleimage
      location: ${example.location}
      resourceGroupName: ${example.name}
      sourceVirtualMachineId: ${example.id}
variables:
  example:
    fn::invoke:
      function: azure:compute:getVirtualMachine
      arguments:
        name: examplevm
        resourceGroupName: example-resources
Copy

Create Image Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);
@overload
def Image(resource_name: str,
          args: ImageArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Image(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          resource_group_name: Optional[str] = None,
          data_disks: Optional[Sequence[ImageDataDiskArgs]] = None,
          hyper_v_generation: Optional[str] = None,
          location: Optional[str] = None,
          name: Optional[str] = None,
          os_disk: Optional[ImageOsDiskArgs] = None,
          source_virtual_machine_id: Optional[str] = None,
          tags: Optional[Mapping[str, str]] = None,
          zone_resilient: Optional[bool] = None)
func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)
public Image(String name, ImageArgs args)
public Image(String name, ImageArgs args, CustomResourceOptions options)
type: azure:compute:Image
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ImageArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ImageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ImageArgs
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 imageResource = new Azure.Compute.Image("imageResource", new()
{
    ResourceGroupName = "string",
    DataDisks = new[]
    {
        new Azure.Compute.Inputs.ImageDataDiskArgs
        {
            StorageType = "string",
            BlobUri = "string",
            Caching = "string",
            DiskEncryptionSetId = "string",
            Lun = 0,
            ManagedDiskId = "string",
            SizeGb = 0,
        },
    },
    HyperVGeneration = "string",
    Location = "string",
    Name = "string",
    OsDisk = new Azure.Compute.Inputs.ImageOsDiskArgs
    {
        StorageType = "string",
        BlobUri = "string",
        Caching = "string",
        DiskEncryptionSetId = "string",
        ManagedDiskId = "string",
        OsState = "string",
        OsType = "string",
        SizeGb = 0,
    },
    SourceVirtualMachineId = "string",
    Tags = 
    {
        { "string", "string" },
    },
    ZoneResilient = false,
});
Copy
example, err := compute.NewImage(ctx, "imageResource", &compute.ImageArgs{
	ResourceGroupName: pulumi.String("string"),
	DataDisks: compute.ImageDataDiskArray{
		&compute.ImageDataDiskArgs{
			StorageType:         pulumi.String("string"),
			BlobUri:             pulumi.String("string"),
			Caching:             pulumi.String("string"),
			DiskEncryptionSetId: pulumi.String("string"),
			Lun:                 pulumi.Int(0),
			ManagedDiskId:       pulumi.String("string"),
			SizeGb:              pulumi.Int(0),
		},
	},
	HyperVGeneration: pulumi.String("string"),
	Location:         pulumi.String("string"),
	Name:             pulumi.String("string"),
	OsDisk: &compute.ImageOsDiskArgs{
		StorageType:         pulumi.String("string"),
		BlobUri:             pulumi.String("string"),
		Caching:             pulumi.String("string"),
		DiskEncryptionSetId: pulumi.String("string"),
		ManagedDiskId:       pulumi.String("string"),
		OsState:             pulumi.String("string"),
		OsType:              pulumi.String("string"),
		SizeGb:              pulumi.Int(0),
	},
	SourceVirtualMachineId: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ZoneResilient: pulumi.Bool(false),
})
Copy
var imageResource = new Image("imageResource", ImageArgs.builder()
    .resourceGroupName("string")
    .dataDisks(ImageDataDiskArgs.builder()
        .storageType("string")
        .blobUri("string")
        .caching("string")
        .diskEncryptionSetId("string")
        .lun(0)
        .managedDiskId("string")
        .sizeGb(0)
        .build())
    .hyperVGeneration("string")
    .location("string")
    .name("string")
    .osDisk(ImageOsDiskArgs.builder()
        .storageType("string")
        .blobUri("string")
        .caching("string")
        .diskEncryptionSetId("string")
        .managedDiskId("string")
        .osState("string")
        .osType("string")
        .sizeGb(0)
        .build())
    .sourceVirtualMachineId("string")
    .tags(Map.of("string", "string"))
    .zoneResilient(false)
    .build());
Copy
image_resource = azure.compute.Image("imageResource",
    resource_group_name="string",
    data_disks=[{
        "storage_type": "string",
        "blob_uri": "string",
        "caching": "string",
        "disk_encryption_set_id": "string",
        "lun": 0,
        "managed_disk_id": "string",
        "size_gb": 0,
    }],
    hyper_v_generation="string",
    location="string",
    name="string",
    os_disk={
        "storage_type": "string",
        "blob_uri": "string",
        "caching": "string",
        "disk_encryption_set_id": "string",
        "managed_disk_id": "string",
        "os_state": "string",
        "os_type": "string",
        "size_gb": 0,
    },
    source_virtual_machine_id="string",
    tags={
        "string": "string",
    },
    zone_resilient=False)
Copy
const imageResource = new azure.compute.Image("imageResource", {
    resourceGroupName: "string",
    dataDisks: [{
        storageType: "string",
        blobUri: "string",
        caching: "string",
        diskEncryptionSetId: "string",
        lun: 0,
        managedDiskId: "string",
        sizeGb: 0,
    }],
    hyperVGeneration: "string",
    location: "string",
    name: "string",
    osDisk: {
        storageType: "string",
        blobUri: "string",
        caching: "string",
        diskEncryptionSetId: "string",
        managedDiskId: "string",
        osState: "string",
        osType: "string",
        sizeGb: 0,
    },
    sourceVirtualMachineId: "string",
    tags: {
        string: "string",
    },
    zoneResilient: false,
});
Copy
type: azure:compute:Image
properties:
    dataDisks:
        - blobUri: string
          caching: string
          diskEncryptionSetId: string
          lun: 0
          managedDiskId: string
          sizeGb: 0
          storageType: string
    hyperVGeneration: string
    location: string
    name: string
    osDisk:
        blobUri: string
        caching: string
        diskEncryptionSetId: string
        managedDiskId: string
        osState: string
        osType: string
        sizeGb: 0
        storageType: string
    resourceGroupName: string
    sourceVirtualMachineId: string
    tags:
        string: string
    zoneResilient: false
Copy

Image 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 Image resource accepts the following input properties:

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
DataDisks List<ImageDataDisk>
One or more data_disk blocks as defined below.
HyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

Location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
OsDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
SourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
ZoneResilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
DataDisks []ImageDataDiskArgs
One or more data_disk blocks as defined below.
HyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

Location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
OsDisk Changes to this property will trigger replacement. ImageOsDiskArgs
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
SourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
Tags map[string]string
A mapping of tags to assign to the resource.
ZoneResilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
dataDisks List<ImageDataDisk>
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. String

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. String
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
sourceVirtualMachineId String
The Virtual Machine ID from which to create the image.
tags Map<String,String>
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. Boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
dataDisks ImageDataDisk[]
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
sourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
data_disks Sequence[ImageDataDiskArgs]
One or more data_disk blocks as defined below.
hyper_v_generation Changes to this property will trigger replacement. str

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. str
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
Specifies the name of the image. Changing this forces a new resource to be created.
os_disk Changes to this property will trigger replacement. ImageOsDiskArgs
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
source_virtual_machine_id str
The Virtual Machine ID from which to create the image.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
zone_resilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
dataDisks List<Property Map>
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. String

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. String
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. Property Map
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
sourceVirtualMachineId String
The Virtual Machine ID from which to create the image.
tags Map<String>
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. Boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Image resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Image Resource

Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ImageState, opts?: CustomResourceOptions): Image
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        data_disks: Optional[Sequence[ImageDataDiskArgs]] = None,
        hyper_v_generation: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        os_disk: Optional[ImageOsDiskArgs] = None,
        resource_group_name: Optional[str] = None,
        source_virtual_machine_id: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        zone_resilient: Optional[bool] = None) -> Image
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)
resources:  _:    type: azure:compute:Image    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DataDisks List<ImageDataDisk>
One or more data_disk blocks as defined below.
HyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

Location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
OsDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
SourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
ZoneResilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
DataDisks []ImageDataDiskArgs
One or more data_disk blocks as defined below.
HyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

Location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
OsDisk Changes to this property will trigger replacement. ImageOsDiskArgs
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
SourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
Tags map[string]string
A mapping of tags to assign to the resource.
ZoneResilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
dataDisks List<ImageDataDisk>
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. String

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. String
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
sourceVirtualMachineId String
The Virtual Machine ID from which to create the image.
tags Map<String,String>
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. Boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
dataDisks ImageDataDisk[]
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. string

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. string
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. ImageOsDisk
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
sourceVirtualMachineId string
The Virtual Machine ID from which to create the image.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
data_disks Sequence[ImageDataDiskArgs]
One or more data_disk blocks as defined below.
hyper_v_generation Changes to this property will trigger replacement. str

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. str
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
Specifies the name of the image. Changing this forces a new resource to be created.
os_disk Changes to this property will trigger replacement. ImageOsDiskArgs
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
resource_group_name Changes to this property will trigger replacement. str
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
source_virtual_machine_id str
The Virtual Machine ID from which to create the image.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
zone_resilient Changes to this property will trigger replacement. bool
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.
dataDisks List<Property Map>
One or more data_disk blocks as defined below.
hyperVGeneration Changes to this property will trigger replacement. String

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Note: zone_resilient can only be set to true if the image is stored in a region that supports availability zones.

location Changes to this property will trigger replacement. String
Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of the image. Changing this forces a new resource to be created.
osDisk Changes to this property will trigger replacement. Property Map
One or more os_disk blocks as defined below. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the resource group in which to create the image. Changing this forces a new resource to be created.
sourceVirtualMachineId String
The Virtual Machine ID from which to create the image.
tags Map<String>
A mapping of tags to assign to the resource.
zoneResilient Changes to this property will trigger replacement. Boolean
Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.

Supporting Types

ImageDataDisk
, ImageDataDiskArgs

StorageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
BlobUri string
Specifies the URI in Azure storage of the blob that you want to use to create the image.
Caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
DiskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
Lun int
Specifies the logical unit number of the data disk.
ManagedDiskId Changes to this property will trigger replacement. string
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
SizeGb int
Specifies the size of the image to be created. The target size can't be smaller than the source size.
StorageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
BlobUri string
Specifies the URI in Azure storage of the blob that you want to use to create the image.
Caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
DiskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
Lun int
Specifies the logical unit number of the data disk.
ManagedDiskId Changes to this property will trigger replacement. string
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
SizeGb int
Specifies the size of the image to be created. The target size can't be smaller than the source size.
storageType
This property is required.
Changes to this property will trigger replacement.
String
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri String
Specifies the URI in Azure storage of the blob that you want to use to create the image.
caching String
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
diskEncryptionSetId Changes to this property will trigger replacement. String
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
lun Integer
Specifies the logical unit number of the data disk.
managedDiskId Changes to this property will trigger replacement. String
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
sizeGb Integer
Specifies the size of the image to be created. The target size can't be smaller than the source size.
storageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri string
Specifies the URI in Azure storage of the blob that you want to use to create the image.
caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
diskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
lun number
Specifies the logical unit number of the data disk.
managedDiskId Changes to this property will trigger replacement. string
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
sizeGb number
Specifies the size of the image to be created. The target size can't be smaller than the source size.
storage_type
This property is required.
Changes to this property will trigger replacement.
str
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blob_uri str
Specifies the URI in Azure storage of the blob that you want to use to create the image.
caching str
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
disk_encryption_set_id Changes to this property will trigger replacement. str
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
lun int
Specifies the logical unit number of the data disk.
managed_disk_id Changes to this property will trigger replacement. str
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
size_gb int
Specifies the size of the image to be created. The target size can't be smaller than the source size.
storageType
This property is required.
Changes to this property will trigger replacement.
String
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri String
Specifies the URI in Azure storage of the blob that you want to use to create the image.
caching String
Specifies the caching mode as ReadWrite, ReadOnly, or None. Defaults to None.
diskEncryptionSetId Changes to this property will trigger replacement. String
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
lun Number
Specifies the logical unit number of the data disk.
managedDiskId Changes to this property will trigger replacement. String
Specifies the ID of the managed disk resource that you want to use to create the image. Changing this forces a new resource to be created.
sizeGb Number
Specifies the size of the image to be created. The target size can't be smaller than the source size.

ImageOsDisk
, ImageOsDiskArgs

StorageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
BlobUri Changes to this property will trigger replacement. string
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
Caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
DiskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
ManagedDiskId string
Specifies the ID of the managed disk resource that you want to use to create the image.
OsState string
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
OsType string
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
SizeGb Changes to this property will trigger replacement. int
Specifies the size of the image to be created. Changing this forces a new resource to be created.
StorageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
BlobUri Changes to this property will trigger replacement. string
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
Caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
DiskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
ManagedDiskId string
Specifies the ID of the managed disk resource that you want to use to create the image.
OsState string
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
OsType string
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
SizeGb Changes to this property will trigger replacement. int
Specifies the size of the image to be created. Changing this forces a new resource to be created.
storageType
This property is required.
Changes to this property will trigger replacement.
String
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri Changes to this property will trigger replacement. String
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
caching String
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
diskEncryptionSetId Changes to this property will trigger replacement. String
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
managedDiskId String
Specifies the ID of the managed disk resource that you want to use to create the image.
osState String
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
osType String
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
sizeGb Changes to this property will trigger replacement. Integer
Specifies the size of the image to be created. Changing this forces a new resource to be created.
storageType
This property is required.
Changes to this property will trigger replacement.
string
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri Changes to this property will trigger replacement. string
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
caching string
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
diskEncryptionSetId Changes to this property will trigger replacement. string
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
managedDiskId string
Specifies the ID of the managed disk resource that you want to use to create the image.
osState string
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
osType string
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
sizeGb Changes to this property will trigger replacement. number
Specifies the size of the image to be created. Changing this forces a new resource to be created.
storage_type
This property is required.
Changes to this property will trigger replacement.
str
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blob_uri Changes to this property will trigger replacement. str
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
caching str
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
disk_encryption_set_id Changes to this property will trigger replacement. str
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
managed_disk_id str
Specifies the ID of the managed disk resource that you want to use to create the image.
os_state str
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
os_type str
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
size_gb Changes to this property will trigger replacement. int
Specifies the size of the image to be created. Changing this forces a new resource to be created.
storageType
This property is required.
Changes to this property will trigger replacement.
String
The type of Storage Disk to use. Possible values are Premium_LRS, PremiumV2_LRS, Premium_ZRS, Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS and UltraSSD_LRS. Changing this forces a new resource to be created.
blobUri Changes to this property will trigger replacement. String
Specifies the URI in Azure storage of the blob that you want to use to create the image. Changing this forces a new resource to be created.
caching String
Specifies the caching mode as ReadWrite, ReadOnly, or None. The default is None.
diskEncryptionSetId Changes to this property will trigger replacement. String
The ID of the Disk Encryption Set which should be used to encrypt this disk. Changing this forces a new resource to be created.
managedDiskId String
Specifies the ID of the managed disk resource that you want to use to create the image.
osState String
Specifies the state of the operating system contained in the blob. Currently, the only value is Generalized. Possible values are Generalized and Specialized.
osType String
Specifies the type of operating system contained in the virtual machine image. Possible values are: Windows or Linux.
sizeGb Changes to this property will trigger replacement. Number
Specifies the size of the image to be created. Changing this forces a new resource to be created.

Import

Images can be imported using the resource id, e.g.

$ pulumi import azure:compute/image:Image example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/images/image1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.