We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
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.getManagedDisks({
resourceGroupName: "example-resources",
});
export const firstDiskId = existingAzurermManagedDisk.disk[0].id;
import pulumi
import pulumi_azure as azure
existing = azure.compute.get_managed_disks(resource_group_name="example-resources")
pulumi.export("firstDiskId", existing_azurerm_managed_disk["disk"][0]["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 {
_, err := compute.GetManagedDisks(ctx, &compute.GetManagedDisksArgs{
ResourceGroupName: "example-resources",
}, nil)
if err != nil {
return err
}
ctx.Export("firstDiskId", existingAzurermManagedDisk.Disk[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var existing = Azure.Compute.GetManagedDisks.Invoke(new()
{
ResourceGroupName = "example-resources",
});
return new Dictionary<string, object?>
{
["firstDiskId"] = existingAzurermManagedDisk.Disk[0].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.GetManagedDisksArgs;
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.getManagedDisks(GetManagedDisksArgs.builder()
.resourceGroupName("example-resources")
.build());
ctx.export("firstDiskId", existingAzurermManagedDisk.disk()[0].id());
}
}
variables:
existing:
fn::invoke:
function: azure:compute:getManagedDisks
arguments:
resourceGroupName: example-resources
outputs:
firstDiskId: ${existingAzurermManagedDisk.disk[0].id}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Compute- 2023-04-02
Using getManagedDisks
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 getManagedDisks(args: GetManagedDisksArgs, opts?: InvokeOptions): Promise<GetManagedDisksResult>
function getManagedDisksOutput(args: GetManagedDisksOutputArgs, opts?: InvokeOptions): Output<GetManagedDisksResult>def get_managed_disks(resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetManagedDisksResult
def get_managed_disks_output(resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetManagedDisksResult]func GetManagedDisks(ctx *Context, args *GetManagedDisksArgs, opts ...InvokeOption) (*GetManagedDisksResult, error)
func GetManagedDisksOutput(ctx *Context, args *GetManagedDisksOutputArgs, opts ...InvokeOption) GetManagedDisksResultOutput> Note: This function is named GetManagedDisks in the Go SDK.
public static class GetManagedDisks
{
public static Task<GetManagedDisksResult> InvokeAsync(GetManagedDisksArgs args, InvokeOptions? opts = null)
public static Output<GetManagedDisksResult> Invoke(GetManagedDisksInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedDisksResult> getManagedDisks(GetManagedDisksArgs args, InvokeOptions options)
public static Output<GetManagedDisksResult> getManagedDisks(GetManagedDisksArgs args, InvokeOptions options)
fn::invoke:
function: azure:compute/getManagedDisks:getManagedDisks
arguments:
# arguments dictionaryThe following arguments are supported:
- Resource
Group stringName - Specifies the name of the Resource Group where this Managed Disk exists.
- Resource
Group stringName - Specifies the name of the Resource Group where this Managed Disk exists.
- resource
Group StringName - Specifies the name of the Resource Group where this Managed Disk exists.
- resource
Group stringName - Specifies the name of the Resource Group where this Managed Disk exists.
- resource_
group_ strname - Specifies the name of the Resource Group where this Managed Disk exists.
- resource
Group StringName - Specifies the name of the Resource Group where this Managed Disk exists.
getManagedDisks Result
The following output properties are available:
- Disks
List<Get
Managed Disks Disk> - a
diskblock as detailed below. - Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Group stringName
- Disks
[]Get
Managed Disks Disk - a
diskblock as detailed below. - Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Group stringName
- disks
List<Get
Managed Disks Disk> - a
diskblock as detailed below. - id String
- The provider-assigned unique ID for this managed resource.
- resource
Group StringName
- disks
Get
Managed Disks Disk[] - a
diskblock as detailed below. - id string
- The provider-assigned unique ID for this managed resource.
- resource
Group stringName
- disks
Sequence[Get
Managed Disks Disk] - a
diskblock as detailed below. - id str
- The provider-assigned unique ID for this managed resource.
- resource_
group_ strname
- disks List<Property Map>
- a
diskblock as detailed below. - id String
- The provider-assigned unique ID for this managed resource.
- resource
Group StringName
Supporting Types
GetManagedDisksDisk
- Create
Option string - Disk
Access stringId - The ID of the disk access resource for using private endpoints on disks.
- Disk
Encryption stringSet 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 intIn Gb - The size of the Managed Disk in gigabytes.
- Encryption
Settings List<GetManaged Disks Disk Encryption Setting> - An
encryption_settingsblock as defined below. - Id string
- Image
Reference stringId - The ID of the source image used for creating this Managed Disk.
- Location string
- The Azure location of the Managed Disk.
- Name string
- The name of the Managed Disk.
- Network
Access stringPolicy - Policy for accessing the disk via network.
- Os
Type string - The operating system used for this Managed Disk.
- Source
Resource stringId - The ID of an existing Managed Disk which this Disk was created from.
- Source
Uri string - The Source URI for this Managed Disk.
- Storage
Account stringId - The ID of the Storage Account where the
source_uriis located. - Storage
Account 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.
- Create
Option string - Disk
Access stringId - The ID of the disk access resource for using private endpoints on disks.
- Disk
Encryption stringSet 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 intIn Gb - The size of the Managed Disk in gigabytes.
- Encryption
Settings []GetManaged Disks Disk Encryption Setting - An
encryption_settingsblock as defined below. - Id string
- Image
Reference stringId - The ID of the source image used for creating this Managed Disk.
- Location string
- The Azure location of the Managed Disk.
- Name string
- The name of the Managed Disk.
- Network
Access stringPolicy - Policy for accessing the disk via network.
- Os
Type string - The operating system used for this Managed Disk.
- Source
Resource stringId - The ID of an existing Managed Disk which this Disk was created from.
- Source
Uri string - The Source URI for this Managed Disk.
- Storage
Account stringId - The ID of the Storage Account where the
source_uriis located. - Storage
Account 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.
- create
Option String - disk
Access StringId - The ID of the disk access resource for using private endpoints on disks.
- disk
Encryption StringSet Id - The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- disk
Iops IntegerRead Write - The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- disk
Mbps IntegerRead Write - The bandwidth allowed for this disk.
- disk
Size IntegerIn Gb - The size of the Managed Disk in gigabytes.
- encryption
Settings List<GetManaged Disks Disk Encryption Setting> - An
encryption_settingsblock as defined below. - id String
- image
Reference StringId - The ID of the source image used for creating this Managed Disk.
- location String
- The Azure location of the Managed Disk.
- name String
- The name of the Managed Disk.
- network
Access StringPolicy - Policy for accessing the disk via network.
- os
Type String - The operating system used for this Managed Disk.
- source
Resource StringId - The ID of an existing Managed Disk which this Disk was created from.
- source
Uri String - The Source URI for this Managed Disk.
- storage
Account StringId - The ID of the Storage Account where the
source_uriis located. - storage
Account 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.
- create
Option string - disk
Access stringId - The ID of the disk access resource for using private endpoints on disks.
- disk
Encryption stringSet Id - The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- disk
Iops numberRead Write - The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- disk
Mbps numberRead Write - The bandwidth allowed for this disk.
- disk
Size numberIn Gb - The size of the Managed Disk in gigabytes.
- encryption
Settings GetManaged Disks Disk Encryption Setting[] - An
encryption_settingsblock as defined below. - id string
- image
Reference stringId - The ID of the source image used for creating this Managed Disk.
- location string
- The Azure location of the Managed Disk.
- name string
- The name of the Managed Disk.
- network
Access stringPolicy - Policy for accessing the disk via network.
- os
Type string - The operating system used for this Managed Disk.
- source
Resource stringId - The ID of an existing Managed Disk which this Disk was created from.
- source
Uri string - The Source URI for this Managed Disk.
- storage
Account stringId - The ID of the Storage Account where the
source_uriis located. - storage
Account 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_ intin_ gb - The size of the Managed Disk in gigabytes.
- encryption_
settings Sequence[GetManaged Disks Disk Encryption Setting] - An
encryption_settingsblock as defined below. - id str
- image_
reference_ strid - The ID of the source image used for creating this Managed Disk.
- location str
- The Azure location of the Managed Disk.
- name str
- The name of the Managed Disk.
- network_
access_ strpolicy - Policy for accessing the disk via network.
- os_
type str - The operating system used for this Managed Disk.
- 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.
- create
Option String - disk
Access StringId - The ID of the disk access resource for using private endpoints on disks.
- disk
Encryption StringSet Id - The ID of the Disk Encryption Set used to encrypt this Managed Disk.
- disk
Iops NumberRead Write - The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.
- disk
Mbps NumberRead Write - The bandwidth allowed for this disk.
- disk
Size NumberIn Gb - The size of the Managed Disk in gigabytes.
- encryption
Settings List<Property Map> - An
encryption_settingsblock as defined below. - id String
- image
Reference StringId - The ID of the source image used for creating this Managed Disk.
- location String
- The Azure location of the Managed Disk.
- name String
- The name of the Managed Disk.
- network
Access StringPolicy - Policy for accessing the disk via network.
- os
Type String - The operating system used for this Managed Disk.
- source
Resource StringId - The ID of an existing Managed Disk which this Disk was created from.
- source
Uri String - The Source URI for this Managed Disk.
- storage
Account StringId - The ID of the Storage Account where the
source_uriis located. - storage
Account 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.
GetManagedDisksDiskEncryptionSetting
- Disk
Encryption List<GetKeys Managed Disks Disk Encryption Setting Disk Encryption Key> - A
disk_encryption_keyblock as defined above. - Enabled bool
- Key
Encryption List<GetKeys Managed Disks Disk Encryption Setting Key Encryption Key> - A
key_encryption_keyblock as defined below.
- Disk
Encryption []GetKeys Managed Disks Disk Encryption Setting Disk Encryption Key - A
disk_encryption_keyblock as defined above. - Enabled bool
- Key
Encryption []GetKeys Managed Disks Disk Encryption Setting Key Encryption Key - A
key_encryption_keyblock as defined below.
- disk
Encryption List<GetKeys Managed Disks Disk Encryption Setting Disk Encryption Key> - A
disk_encryption_keyblock as defined above. - enabled Boolean
- key
Encryption List<GetKeys Managed Disks Disk Encryption Setting Key Encryption Key> - A
key_encryption_keyblock as defined below.
- disk
Encryption GetKeys Managed Disks Disk Encryption Setting Disk Encryption Key[] - A
disk_encryption_keyblock as defined above. - enabled boolean
- key
Encryption GetKeys Managed Disks Disk Encryption Setting Key Encryption Key[] - A
key_encryption_keyblock as defined below.
- disk_
encryption_ Sequence[Getkeys Managed Disks Disk Encryption Setting Disk Encryption Key] - A
disk_encryption_keyblock as defined above. - enabled bool
- key_
encryption_ Sequence[Getkeys Managed Disks Disk Encryption Setting Key Encryption Key] - A
key_encryption_keyblock as defined below.
- disk
Encryption List<Property Map>Keys - A
disk_encryption_keyblock as defined above. - enabled Boolean
- key
Encryption List<Property Map>Keys - A
key_encryption_keyblock as defined below.
GetManagedDisksDiskEncryptionSettingDiskEncryptionKey
- Secret
Url string - The URL to the Key Vault Secret used as the Disk Encryption Key.
- Source
Vault stringId - The ID of the source Key Vault.
- Secret
Url string - The URL to the Key Vault Secret used as the Disk Encryption Key.
- Source
Vault stringId - The ID of the source Key Vault.
- secret
Url String - The URL to the Key Vault Secret used as the Disk Encryption Key.
- source
Vault StringId - The ID of the source Key Vault.
- secret
Url string - The URL to the Key Vault Secret used as the Disk Encryption Key.
- source
Vault 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.
- secret
Url String - The URL to the Key Vault Secret used as the Disk Encryption Key.
- source
Vault StringId - The ID of the source Key Vault.
GetManagedDisksDiskEncryptionSettingKeyEncryptionKey
- Key
Url string - The URL to the Key Vault Key used as the Key Encryption Key.
- Source
Vault stringId - The ID of the source Key Vault.
- Key
Url string - The URL to the Key Vault Key used as the Key Encryption Key.
- Source
Vault stringId - The ID of the source Key Vault.
- key
Url String - The URL to the Key Vault Key used as the Key Encryption Key.
- source
Vault StringId - The ID of the source Key Vault.
- key
Url string - The URL to the Key Vault Key used as the Key Encryption Key.
- source
Vault 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.
- key
Url String - The URL to the Key Vault Key used as the Key Encryption Key.
- source
Vault 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.
We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
