We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.compute.getManagedDisk
Explore with Pulumi AI
Use this data source to access information about an existing Managed Disk.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const existing = azure.compute.getManagedDisk({
    name: "example-datadisk",
    resourceGroupName: "example-resources",
});
export const id = existing.then(existing => existing.id);
import pulumi
import pulumi_azure as azure
existing = azure.compute.get_managed_disk(name="example-datadisk",
    resource_group_name="example-resources")
pulumi.export("id", existing.id)
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 {
		existing, err := compute.LookupManagedDisk(ctx, &compute.LookupManagedDiskArgs{
			Name:              "example-datadisk",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", existing.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var existing = Azure.Compute.GetManagedDisk.Invoke(new()
    {
        Name = "example-datadisk",
        ResourceGroupName = "example-resources",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = existing.Apply(getManagedDiskResult => getManagedDiskResult.Id),
    };
});
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.GetManagedDiskArgs;
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 existing = ComputeFunctions.getManagedDisk(GetManagedDiskArgs.builder()
            .name("example-datadisk")
            .resourceGroupName("example-resources")
            .build());
        ctx.export("id", existing.applyValue(getManagedDiskResult -> getManagedDiskResult.id()));
    }
}
variables:
  existing:
    fn::invoke:
      function: azure:compute:getManagedDisk
      arguments:
        name: example-datadisk
        resourceGroupName: example-resources
outputs:
  id: ${existing.id}
Using getManagedDisk
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getManagedDisk(args: GetManagedDiskArgs, opts?: InvokeOptions): Promise<GetManagedDiskResult>
function getManagedDiskOutput(args: GetManagedDiskOutputArgs, opts?: InvokeOptions): Output<GetManagedDiskResult>def get_managed_disk(name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetManagedDiskResult
def get_managed_disk_output(name: Optional[pulumi.Input[str]] = None,
                     resource_group_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetManagedDiskResult]func LookupManagedDisk(ctx *Context, args *LookupManagedDiskArgs, opts ...InvokeOption) (*LookupManagedDiskResult, error)
func LookupManagedDiskOutput(ctx *Context, args *LookupManagedDiskOutputArgs, opts ...InvokeOption) LookupManagedDiskResultOutput> Note: This function is named LookupManagedDisk in the Go SDK.
public static class GetManagedDisk 
{
    public static Task<GetManagedDiskResult> InvokeAsync(GetManagedDiskArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedDiskResult> Invoke(GetManagedDiskInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedDiskResult> getManagedDisk(GetManagedDiskArgs args, InvokeOptions options)
public static Output<GetManagedDiskResult> getManagedDisk(GetManagedDiskArgs args, InvokeOptions options)
fn::invoke:
  function: azure:compute/getManagedDisk:getManagedDisk
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the Managed Disk.
- ResourceGroup stringName 
- Specifies the name of the Resource Group where this Managed Disk exists.
- Name string
- Specifies the name of the Managed Disk.
- ResourceGroup stringName 
- Specifies the name of the Resource Group where this Managed Disk exists.
- name String
- Specifies the name of the Managed Disk.
- resourceGroup StringName 
- Specifies the name of the Resource Group where this Managed Disk exists.
- name string
- Specifies the name of the Managed Disk.
- resourceGroup stringName 
- Specifies the name of the Resource Group where this Managed Disk exists.
- name str
- Specifies the name of the Managed Disk.
- resource_group_ strname 
- Specifies the name of the Resource Group where this Managed Disk exists.
- name String
- Specifies the name of the Managed Disk.
- resourceGroup StringName 
- Specifies the name of the Resource Group where this Managed Disk exists.
getManagedDisk Result
The following output properties are available:
- CreateOption string
- DiskAccess stringId 
- The ID of the disk access resource for using private endpoints on disks.
- DiskEncryption stringSet Id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- DiskIops intRead Write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- DiskMbps intRead Write 
- The bandwidth allowed for this disk.
- DiskSize intGb 
- The size of the Managed Disk in gigabytes.
- EncryptionSettings List<GetManaged Disk Encryption Setting> 
- A encryption_settingsblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageReference stringId 
- The ID of the source image used for creating this Managed Disk.
- Name string
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network.
- OsType string
- The operating system used for this Managed Disk.
- ResourceGroup stringName 
- SourceResource stringId 
- The ID of an existing Managed Disk which this Disk was created from.
- SourceUri string
- The Source URI for this Managed Disk.
- StorageAccount stringId 
- The ID of the Storage Account where the source_uriis located.
- StorageAccount stringType 
- The storage account type for the Managed Disk.
- Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Zones List<string>
- A list of Availability Zones where the Managed Disk exists.
- CreateOption string
- DiskAccess stringId 
- The ID of the disk access resource for using private endpoints on disks.
- DiskEncryption stringSet Id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- DiskIops intRead Write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- DiskMbps intRead Write 
- The bandwidth allowed for this disk.
- DiskSize intGb 
- The size of the Managed Disk in gigabytes.
- EncryptionSettings []GetManaged Disk Encryption Setting 
- A encryption_settingsblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageReference stringId 
- The ID of the source image used for creating this Managed Disk.
- Name string
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network.
- OsType string
- The operating system used for this Managed Disk.
- ResourceGroup stringName 
- SourceResource stringId 
- The ID of an existing Managed Disk which this Disk was created from.
- SourceUri string
- The Source URI for this Managed Disk.
- StorageAccount stringId 
- The ID of the Storage Account where the source_uriis located.
- StorageAccount stringType 
- The storage account type for the Managed Disk.
- map[string]string
- A mapping of tags assigned to the resource.
- Zones []string
- A list of Availability Zones where the Managed Disk exists.
- createOption String
- diskAccess StringId 
- The ID of the disk access resource for using private endpoints on disks.
- diskEncryption StringSet Id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- diskIops IntegerRead Write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- diskMbps IntegerRead Write 
- The bandwidth allowed for this disk.
- diskSize IntegerGb 
- The size of the Managed Disk in gigabytes.
- encryptionSettings List<GetManaged Disk Encryption Setting> 
- A encryption_settingsblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- imageReference StringId 
- The ID of the source image used for creating this Managed Disk.
- name String
- networkAccess StringPolicy 
- Policy for accessing the disk via network.
- osType String
- The operating system used for this Managed Disk.
- resourceGroup StringName 
- sourceResource StringId 
- The ID of an existing Managed Disk which this Disk was created from.
- sourceUri String
- The Source URI for this Managed Disk.
- storageAccount StringId 
- The ID of the Storage Account where the source_uriis located.
- storageAccount StringType 
- The storage account type for the Managed Disk.
- Map<String,String>
- A mapping of tags assigned to the resource.
- zones List<String>
- A list of Availability Zones where the Managed Disk exists.
- createOption string
- diskAccess stringId 
- The ID of the disk access resource for using private endpoints on disks.
- diskEncryption stringSet Id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- diskIops numberRead Write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- diskMbps numberRead Write 
- The bandwidth allowed for this disk.
- diskSize numberGb 
- The size of the Managed Disk in gigabytes.
- encryptionSettings GetManaged Disk Encryption Setting[] 
- A encryption_settingsblock as defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- imageReference stringId 
- The ID of the source image used for creating this Managed Disk.
- name string
- networkAccess stringPolicy 
- Policy for accessing the disk via network.
- osType string
- The operating system used for this Managed Disk.
- resourceGroup stringName 
- sourceResource stringId 
- The ID of an existing Managed Disk which this Disk was created from.
- sourceUri string
- The Source URI for this Managed Disk.
- storageAccount stringId 
- The ID of the Storage Account where the source_uriis located.
- storageAccount stringType 
- The storage account type for the Managed Disk.
- {[key: string]: string}
- A mapping of tags assigned to the resource.
- zones string[]
- A list of Availability Zones where the Managed Disk exists.
- create_option str
- disk_access_ strid 
- The ID of the disk access resource for using private endpoints on disks.
- disk_encryption_ strset_ id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- disk_iops_ intread_ write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- disk_mbps_ intread_ write 
- The bandwidth allowed for this disk.
- disk_size_ intgb 
- The size of the Managed Disk in gigabytes.
- encryption_settings Sequence[GetManaged Disk Encryption Setting] 
- A encryption_settingsblock as defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- image_reference_ strid 
- The ID of the source image used for creating this Managed Disk.
- name str
- network_access_ strpolicy 
- Policy for accessing the disk via network.
- os_type str
- The operating system used for this Managed Disk.
- resource_group_ strname 
- source_resource_ strid 
- The ID of an existing Managed Disk which this Disk was created from.
- source_uri str
- The Source URI for this Managed Disk.
- storage_account_ strid 
- The ID of the Storage Account where the source_uriis located.
- storage_account_ strtype 
- The storage account type for the Managed Disk.
- Mapping[str, str]
- A mapping of tags assigned to the resource.
- zones Sequence[str]
- A list of Availability Zones where the Managed Disk exists.
- createOption String
- diskAccess StringId 
- The ID of the disk access resource for using private endpoints on disks.
- diskEncryption StringSet Id 
- The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- diskIops NumberRead Write 
- The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- diskMbps NumberRead Write 
- The bandwidth allowed for this disk.
- diskSize NumberGb 
- The size of the Managed Disk in gigabytes.
- encryptionSettings List<Property Map>
- A encryption_settingsblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- imageReference StringId 
- The ID of the source image used for creating this Managed Disk.
- name String
- networkAccess StringPolicy 
- Policy for accessing the disk via network.
- osType String
- The operating system used for this Managed Disk.
- resourceGroup StringName 
- sourceResource StringId 
- The ID of an existing Managed Disk which this Disk was created from.
- sourceUri String
- The Source URI for this Managed Disk.
- storageAccount StringId 
- The ID of the Storage Account where the source_uriis located.
- storageAccount StringType 
- The storage account type for the Managed Disk.
- Map<String>
- A mapping of tags assigned to the resource.
- zones List<String>
- A list of Availability Zones where the Managed Disk exists.
Supporting Types
GetManagedDiskEncryptionSetting    
- DiskEncryption List<GetKeys Managed Disk Encryption Setting Disk Encryption Key> 
- A disk_encryption_keyblock as defined above.
- Enabled bool
- KeyEncryption List<GetKeys Managed Disk Encryption Setting Key Encryption Key> 
- A key_encryption_keyblock as defined below.
- DiskEncryption []GetKeys Managed Disk Encryption Setting Disk Encryption Key 
- A disk_encryption_keyblock as defined above.
- Enabled bool
- KeyEncryption []GetKeys Managed Disk Encryption Setting Key Encryption Key 
- A key_encryption_keyblock as defined below.
- diskEncryption List<GetKeys Managed Disk Encryption Setting Disk Encryption Key> 
- A disk_encryption_keyblock as defined above.
- enabled Boolean
- keyEncryption List<GetKeys Managed Disk Encryption Setting Key Encryption Key> 
- A key_encryption_keyblock as defined below.
- diskEncryption GetKeys Managed Disk Encryption Setting Disk Encryption Key[] 
- A disk_encryption_keyblock as defined above.
- enabled boolean
- keyEncryption GetKeys Managed Disk Encryption Setting Key Encryption Key[] 
- A key_encryption_keyblock as defined below.
- disk_encryption_ Sequence[Getkeys Managed Disk Encryption Setting Disk Encryption Key] 
- A disk_encryption_keyblock as defined above.
- enabled bool
- key_encryption_ Sequence[Getkeys Managed Disk Encryption Setting Key Encryption Key] 
- A key_encryption_keyblock as defined below.
- diskEncryption List<Property Map>Keys 
- A disk_encryption_keyblock as defined above.
- enabled Boolean
- keyEncryption List<Property Map>Keys 
- A key_encryption_keyblock as defined below.
GetManagedDiskEncryptionSettingDiskEncryptionKey       
- SecretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- SourceVault stringId 
- The ID of the source Key Vault.
- SecretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- SourceVault stringId 
- The ID of the source Key Vault.
- secretUrl String
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- sourceVault StringId 
- The ID of the source Key Vault.
- secretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- sourceVault stringId 
- The ID of the source Key Vault.
- secret_url str
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- source_vault_ strid 
- The ID of the source Key Vault.
- secretUrl String
- The URL to the Key Vault Secret used as the Disk Encryption Key.
- sourceVault StringId 
- The ID of the source Key Vault.
GetManagedDiskEncryptionSettingKeyEncryptionKey       
- KeyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key.
- SourceVault stringId 
- The ID of the source Key Vault.
- KeyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key.
- SourceVault stringId 
- The ID of the source Key Vault.
- keyUrl String
- The URL to the Key Vault Key used as the Key Encryption Key.
- sourceVault StringId 
- The ID of the source Key Vault.
- keyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key.
- sourceVault stringId 
- The ID of the source Key Vault.
- key_url str
- The URL to the Key Vault Key used as the Key Encryption Key.
- source_vault_ strid 
- The ID of the source Key Vault.
- keyUrl String
- The URL to the Key Vault Key used as the Key Encryption Key.
- sourceVault StringId 
- The ID of the source Key Vault.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.