디스크를 업데이트(패치)합니다.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}?api-version=2024-03-02
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
diskName
|
path |
True
|
string
|
생성되는 관리 디스크의 이름입니다. 디스크를 만든 후에는 이름을 변경할 수 없습니다. 이름에 지원되는 문자는 a-z, A-Z, 0-9, _ 및 -입니다. 최대 이름 길이는 80자입니다.
|
resourceGroupName
|
path |
True
|
string
|
리소스 그룹의 이름입니다.
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 구독을 고유하게 식별하는 구독 자격 증명입니다. 구독 ID는 모든 서비스 호출에 대한 URI의 일부를 형성합니다.
|
api-version
|
query |
True
|
string
|
클라이언트 API 버전입니다.
|
요청 본문
Name |
형식 |
Description |
properties.burstingEnabled
|
boolean
|
디스크의 프로비전된 성능 목표를 초과하여 버스팅을 사용하도록 설정하려면 true로 설정합니다. 버스팅은 기본적으로 사용하지 않도록 설정됩니다. Ultra 디스크에는 적용되지 않습니다.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
디스크 또는 스냅샷을 내보내거나 업로드할 때 추가 인증 요구 사항입니다.
|
properties.diskAccessId
|
string
|
디스크에서 프라이빗 엔드포인트를 사용하기 위한 DiskAccess 리소스의 ARM ID입니다.
|
properties.diskIOPSReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 IOPS 수입니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskIOPSReadWrite
|
integer
|
이 디스크에 허용되는 IOPS 수입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskMBpsReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 처리량(MBps)입니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskMBpsReadWrite
|
integer
|
이 디스크에 허용되는 대역폭입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskSizeGB
|
integer
|
creationData.createOption이 비어 있는 경우 이 필드는 필수이며 만들 디스크의 크기를 나타냅니다. 이 필드가 다른 옵션을 사용하여 업데이트 또는 만들기에 있는 경우 크기 조정을 나타냅니다. 크기 조정은 디스크가 실행 중인 VM에 연결되지 않은 경우에만 허용되며 디스크의 크기만 늘릴 수 있습니다.
|
properties.encryption
|
Encryption
|
암호화 속성을 사용하여 고객 관리형 키 또는 플랫폼 관리 키를 사용하여 미사용 데이터를 암호화할 수 있습니다.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
Azure Disk Encryption으로 사용되는 암호화 설정 컬렉션은 디스크 또는 스냅샷당 여러 암호화 설정을 포함할 수 있습니다.
|
properties.maxShares
|
integer
|
디스크에 동시에 연결할 수 있는 최대 VM 수입니다. 1보다 큰 값은 동시에 여러 VM에 탑재할 수 있는 디스크를 나타냅니다.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
네트워크를 통해 디스크에 액세스하기 위한 정책입니다.
|
properties.optimizedForFrequentAttach
|
boolean
|
이 속성을 true로 설정하면 한 가상 머신에서 분리되고 다른 가상 머신에 연결하여 자주(하루에 5회 이상) 데이터 디스크의 안정성과 성능이 향상됩니다. 이 속성은 디스크가 가상 머신의 장애 도메인과 정렬되지 않도록 하기 때문에 자주 분리되고 연결되지 않은 디스크에 대해 설정해서는 안 됩니다.
|
properties.osType
|
OperatingSystemTypes
|
운영 체제 유형입니다.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
디스크에서 내보내기를 제어하는 정책입니다.
|
properties.purchasePlan
|
PurchasePlan
|
OS 디스크에 추가할 구매 계획 정보
|
properties.supportedCapabilities
|
SupportedCapabilities
|
OS 디스크에 추가할 지원되는 기능 목록입니다.
|
properties.supportsHibernation
|
boolean
|
디스크의 OS가 최대 절전 모드를 지원했음을 나타냅니다.
|
properties.tier
|
string
|
여기에 설명된 대로 디스크의 성능 계층(예: P4, S10) https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Ultra 디스크에는 적용되지 않습니다.
|
sku
|
DiskSku
|
디스크 sku 이름입니다. Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS 또는 PremiumV2_LRS 수 있습니다.
|
tags
|
object
|
리소스 태그
|
응답
Name |
형식 |
Description |
200 OK
|
Disk
|
그래
|
202 Accepted
|
Disk
|
허용
|
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
Create or update a bursting enabled managed disk.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"diskSizeGB": 1024,
"burstingEnabled": true
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_CreateOrUpdate_BurstingEnabled.json
*/
/**
* Sample code: Create or update a bursting enabled managed disk.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createOrUpdateABurstingEnabledManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withDiskSizeGB(1024).withBurstingEnabled(true), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_create_or_update_bursting_enabled.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"burstingEnabled": True, "diskSizeGB": 1024}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
func ExampleDisksClient_BeginUpdate_createOrUpdateABurstingEnabledManagedDisk() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
BurstingEnabled: to.Ptr(true),
DiskSizeGB: to.Ptr[int32](1024),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// BurstingEnabled: to.Ptr(true),
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](1024),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
*/
async function createOrUpdateABurstingEnabledManagedDisk() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { burstingEnabled: true, diskSizeGB: 1024 };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
DiskSizeGB = 1024,
BurstingEnabled = true,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 1024,
"provisioningState": "Updating"
},
"location": "West US",
"name": "myDisk"
}
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 1024,
"burstingEnabled": true,
"provisioningState": "Succeeded"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to add accelerated networking.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"acceleratedNetwork": false
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddAcceleratedNetworking.json
*/
/**
* Sample code: Update a managed disk to add accelerated networking.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToAddAcceleratedNetworking(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_accelerated_networking.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"acceleratedNetwork": False}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddAcceleratedNetworking() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
AcceleratedNetwork: to.Ptr(false),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// AcceleratedNetwork: to.Ptr(false),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
*/
async function updateAManagedDiskToAddAcceleratedNetworking() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
supportedCapabilities: { acceleratedNetwork: false },
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
AcceleratedNetwork = false,
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"acceleratedNetwork": false
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"acceleratedNetwork": false
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add architecture.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"architecture": "Arm64"
}
}
}
import com.azure.resourcemanager.compute.models.Architecture;
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_ToAddArchitecture.json
*/
/**
* Sample code: Update a managed disk to add architecture.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToAddArchitecture(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks()
.update("myResourceGroup", "myDisk",
new DiskUpdate()
.withSupportedCapabilities(new SupportedCapabilities().withArchitecture(Architecture.ARM64)),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_to_add_architecture.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"architecture": "Arm64"}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddArchitecture() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
Architecture: to.Ptr(armcompute.ArchitectureArm64),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// Architecture: to.Ptr(armcompute.ArchitectureArm64),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
*/
async function updateAManagedDiskToAddArchitecture() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { supportedCapabilities: { architecture: "Arm64" } };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
Architecture = ArchitectureType.Arm64,
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"architecture": "Arm64"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"architecture": "Arm64"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add purchase plan.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.PurchasePlanAutoGenerated;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddPurchasePlan.json
*/
/**
* Sample code: Update a managed disk to add purchase plan.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToAddPurchasePlan(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks()
.update("myResourceGroup", "myDisk",
new DiskUpdate().withPurchasePlan(new PurchasePlanAutoGenerated().withName("myPurchasePlanName")
.withPublisher("myPurchasePlanPublisher").withProduct("myPurchasePlanProduct")
.withPromotionCode("fakeTokenPlaceholder")),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_purchase_plan.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={
"properties": {
"purchasePlan": {
"name": "myPurchasePlanName",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode",
"publisher": "myPurchasePlanPublisher",
}
}
},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddPurchasePlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
PurchasePlan: &armcompute.DiskPurchasePlan{
Name: to.Ptr("myPurchasePlanName"),
Product: to.Ptr("myPurchasePlanProduct"),
PromotionCode: to.Ptr("myPurchasePlanPromotionCode"),
Publisher: to.Ptr("myPurchasePlanPublisher"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// PurchasePlan: &armcompute.DiskPurchasePlan{
// Name: to.Ptr("myPurchasePlanName"),
// Product: to.Ptr("myPurchasePlanProduct"),
// PromotionCode: to.Ptr("myPurchasePlanPromotionCode"),
// Publisher: to.Ptr("myPurchasePlanPublisher"),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
*/
async function updateAManagedDiskToAddPurchasePlan() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
purchasePlan: {
name: "myPurchasePlanName",
product: "myPurchasePlanProduct",
promotionCode: "myPurchasePlanPromotionCode",
publisher: "myPurchasePlanPublisher",
},
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
PurchasePlan = new DiskPurchasePlan("myPurchasePlanName", "myPurchasePlanPublisher", "myPurchasePlanProduct")
{
PromotionCode = "myPurchasePlanPromotionCode",
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add supportsHibernation.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportsHibernation": true
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddSupportsHibernation.json
*/
/**
* Sample code: Update a managed disk to add supportsHibernation.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToAddSupportsHibernation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportsHibernation(true), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_supports_hibernation.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportsHibernation": True}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddSupportsHibernation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportsHibernation: to.Ptr(true),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionImport),
// SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"),
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportsHibernation: to.Ptr(true),
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
*/
async function updateAManagedDiskToAddSupportsHibernation() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { supportsHibernation: true };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportsHibernation = true,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportsHibernation": true,
"creationData": {
"createOption": "Import",
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportsHibernation": true,
"creationData": {
"createOption": "Import",
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to change tier.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"tier": "P30"
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_ChangeTier.json
*/
/**
* Sample code: Update a managed disk to change tier.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToChangeTier(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withTier("P30"), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_change_tier.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"tier": "P30"}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToChangeTier() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
Tier: to.Ptr("P30"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// Tier: to.Ptr("P30"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
*/
async function updateAManagedDiskToChangeTier() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { tier: "P30" };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
Tier = "P30",
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Updating",
"tier": "P10",
"propertyUpdatesInProgress": {
"targetTier": "P30"
}
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Succeeded",
"tier": "P30"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to disable bursting.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"burstingEnabled": false
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_DisableBursting.json
*/
/**
* Sample code: Update a managed disk to disable bursting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToDisableBursting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withBurstingEnabled(false), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_disable_bursting.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"burstingEnabled": False}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableBursting() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
BurstingEnabled: to.Ptr(false),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
*/
async function updateAManagedDiskToDisableBursting() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { burstingEnabled: false };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
BurstingEnabled = false,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Succeeded"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to disable optimizedForFrequentAttach.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"optimizedForFrequentAttach": false
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_DisableOptimizedForFrequentAttach.json
*/
/**
* Sample code: Update a managed disk to disable optimizedForFrequentAttach.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToDisableOptimizedForFrequentAttach(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withOptimizedForFrequentAttach(false), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_disable_optimized_for_frequent_attach.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"optimizedForFrequentAttach": False}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableOptimizedForFrequentAttach() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
OptimizedForFrequentAttach: to.Ptr(false),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](200),
// OptimizedForFrequentAttach: to.Ptr(false),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
*/
async function updateAManagedDiskToDisableOptimizedForFrequentAttach() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { optimizedForFrequentAttach: false };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
IsOptimizedForFrequentAttach = false,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Updating",
"optimizedForFrequentAttach": false
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Succeeded",
"optimizedForFrequentAttach": false
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk with diskControllerTypes.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddDiskControllerTypes.json
*/
/**
* Sample code: Update a managed disk with diskControllerTypes.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskWithDiskControllerTypes(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportedCapabilities(new SupportedCapabilities().withDiskControllerTypes("SCSI")),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_disk_controller_types.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"diskControllerTypes": "SCSI"}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskWithDiskControllerTypes() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
DiskControllerTypes: to.Ptr("SCSI"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// DiskControllerTypes: to.Ptr("SCSI"),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
*/
async function updateAManagedDiskWithDiskControllerTypes() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
supportedCapabilities: { diskControllerTypes: "SCSI" },
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
DiskControllerTypes = "SCSI",
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update managed disk to remove disk access resource association.
샘플 요청
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"networkAccessPolicy": "AllowAll"
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.NetworkAccessPolicy;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_RemoveDiskAccess.json
*/
/**
* Sample code: Update managed disk to remove disk access resource association.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateManagedDiskToRemoveDiskAccessResourceAssociation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_remove_disk_access.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"networkAccessPolicy": "AllowAll"}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
func ExampleDisksClient_BeginUpdate_updateManagedDiskToRemoveDiskAccessResourceAssociation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](200),
// NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
*/
async function updateManagedDiskToRemoveDiskAccessResourceAssociation() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { networkAccessPolicy: "AllowAll" };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
NetworkAccessPolicy = NetworkAccessPolicy.AllowAll,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Updating",
"networkAccessPolicy": "AllowAll"
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Succeeded",
"networkAccessPolicy": "AllowAll"
},
"location": "West US",
"name": "myDisk"
}
정의
Architecture
OS 디스크에서 지원하는 CPU 아키텍처입니다.
Name |
형식 |
Description |
Arm64
|
string
|
|
x64
|
string
|
|
CreationData
디스크를 만들 때 사용되는 데이터입니다.
Name |
형식 |
Description |
createOption
|
DiskCreateOption
|
이렇게 하면 디스크 생성의 가능한 원본이 열거됩니다.
|
elasticSanResourceId
|
string
|
createOption이 CopyFromSanSnapshot인 경우 필요합니다. 원본 탄력적 san 볼륨 스냅샷의 ARM ID입니다.
|
galleryImageReference
|
ImageDiskReference
|
갤러리 이미지에서 만드는 경우 필수입니다. ImageDiskReference의 id/sharedGalleryImageId/communityGalleryImageId는 디스크를 만들 공유 갤리 이미지 버전의 ARM ID입니다.
|
imageReference
|
ImageDiskReference
|
PIR 또는 사용자 이미지에 대한 디스크 원본 정보입니다.
|
logicalSectorSize
|
integer
|
Ultra 디스크의 논리적 섹터 크기(바이트)입니다. 지원되는 값은 512 광고 4096입니다. 4096이 기본값입니다.
|
performancePlus
|
boolean
|
배포된 디스크의 성능 목표를 향상시키려면 이 플래그를 true로 설정합니다. 각 성능 대상은 여기를 참조하세요. 이 플래그는 디스크 생성 시간에만 설정할 수 있으며 사용하도록 설정한 후에는 사용하지 않도록 설정할 수 없습니다.
|
provisionedBandwidthCopySpeed
|
ProvisionedBandwidthCopyOption
|
이 필드가 스냅샷에 설정되어 있고 createOption이 CopyStart이면 스냅샷이 더 빠른 속도로 복사됩니다.
|
securityDataUri
|
string
|
createOption이 ImportSecure인 경우 VM 게스트 상태로 가져올 Blob의 URI입니다.
|
sourceResourceId
|
string
|
createOption이 Copy이면 원본 스냅샷 또는 디스크의 ARM ID입니다.
|
sourceUniqueId
|
string
|
이 필드를 설정하면 이 리소스의 원본을 식별하는 고유 ID입니다.
|
sourceUri
|
string
|
createOption이 가져오기인 경우 관리 디스크로 가져올 Blob의 URI입니다.
|
storageAccountId
|
string
|
createOption이 Import인 경우 필수입니다. 디스크로 가져올 Blob을 포함하는 스토리지 계정의 Azure Resource Manager 식별자입니다.
|
uploadSizeBytes
|
integer
|
createOption이 업로드인 경우 VHD 바닥글을 포함하여 업로드 내용의 크기입니다. 이 값은 20972032(VHD 바닥글의 경우 20MiB + 512바이트) 및 35183298347520 바이트(VHD 바닥글의 경우 32TiB + 512바이트) 사이여야 합니다.
|
DataAccessAuthMode
디스크 또는 스냅샷을 내보내거나 업로드할 때 추가 인증 요구 사항입니다.
Name |
형식 |
Description |
AzureActiveDirectory
|
string
|
내보내기/업로드 URL을 사용하는 경우 시스템은 사용자가 Azure Active Directory에 ID가 있고 데이터를 내보내거나 업로드하는 데 필요한 권한이 있는지 확인합니다. aka.ms/DisksAzureADAuth 참조하세요.
|
None
|
string
|
내보내기/업로드 URL에 액세스할 때 추가 인증이 수행되지 않습니다.
|
Disk
디스크 리소스입니다.
Name |
형식 |
Description |
extendedLocation
|
ExtendedLocation
|
디스크를 만들 확장된 위치입니다. 확장된 위치는 변경할 수 없습니다.
|
id
|
string
|
리소스 ID
|
location
|
string
|
리소스 위치
|
managedBy
|
string
|
디스크가 연결된 VM의 ID를 포함하는 상대 URI입니다.
|
managedByExtended
|
string[]
|
디스크가 연결된 VM의 ID를 포함하는 상대 URI 목록입니다. maxShares를 여러 VM에 연결할 수 있도록 디스크에 대해 1보다 큰 값으로 설정해야 합니다.
|
name
|
string
|
리소스 이름
|
properties.LastOwnershipUpdateTime
|
string
|
디스크의 소유권 상태가 마지막으로 변경된 UTC 시간(예: 디스크가 VM에서 마지막으로 연결되거나 분리된 시간 또는 디스크가 연결된 VM의 할당이 취소되거나 시작된 시간)입니다.
|
properties.burstingEnabled
|
boolean
|
디스크의 프로비전된 성능 목표를 초과하여 버스팅을 사용하도록 설정하려면 true로 설정합니다. 버스팅은 기본적으로 사용하지 않도록 설정됩니다. Ultra 디스크에는 적용되지 않습니다.
|
properties.burstingEnabledTime
|
string
|
디스크에서 버스팅을 마지막으로 사용하도록 설정한 최신 시간입니다.
|
properties.completionPercent
|
number
|
CopyStart 작업을 통해 리소스를 만들 때 백그라운드 복사에 대한 완료율입니다.
|
properties.creationData
|
CreationData
|
디스크 원본 정보입니다. 디스크를 만든 후에는 CreationData 정보를 변경할 수 없습니다.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
디스크 또는 스냅샷을 내보내거나 업로드할 때 추가 인증 요구 사항입니다.
|
properties.diskAccessId
|
string
|
디스크에서 프라이빗 엔드포인트를 사용하기 위한 DiskAccess 리소스의 ARM ID입니다.
|
properties.diskIOPSReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 IOPS 수입니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskIOPSReadWrite
|
integer
|
이 디스크에 허용되는 IOPS 수입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskMBpsReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 처리량(MBps)입니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskMBpsReadWrite
|
integer
|
이 디스크에 허용되는 대역폭입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskSizeBytes
|
integer
|
디스크 크기(바이트)입니다. 이 필드는 읽기 전용입니다.
|
properties.diskSizeGB
|
integer
|
creationData.createOption이 비어 있는 경우 이 필드는 필수이며 만들 디스크의 크기를 나타냅니다. 이 필드가 다른 옵션을 사용하여 업데이트 또는 만들기에 있는 경우 크기 조정을 나타냅니다. 크기 조정은 디스크가 실행 중인 VM에 연결되지 않은 경우에만 허용되며 디스크의 크기만 늘릴 수 있습니다.
|
properties.diskState
|
DiskState
|
디스크의 상태입니다.
|
properties.encryption
|
Encryption
|
암호화 속성을 사용하여 고객 관리형 키 또는 플랫폼 관리 키를 사용하여 미사용 데이터를 암호화할 수 있습니다.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
Azure Disk Encryption에 사용되는 암호화 설정 컬렉션은 디스크 또는 스냅샷당 여러 암호화 설정을 포함할 수 있습니다.
|
properties.hyperVGeneration
|
HyperVGeneration
|
Virtual Machine의 하이퍼바이저 생성입니다. OS 디스크에만 적용됩니다.
|
properties.maxShares
|
integer
|
디스크에 동시에 연결할 수 있는 최대 VM 수입니다. 1보다 큰 값은 동시에 여러 VM에 탑재할 수 있는 디스크를 나타냅니다.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
네트워크를 통해 디스크에 액세스하기 위한 정책입니다.
|
properties.optimizedForFrequentAttach
|
boolean
|
이 속성을 true로 설정하면 한 가상 머신에서 분리되고 다른 가상 머신에 연결하여 자주(하루에 5회 이상) 데이터 디스크의 안정성과 성능이 향상됩니다. 이 속성은 디스크가 가상 머신의 장애 도메인과 정렬되지 않도록 하기 때문에 자주 분리되고 연결되지 않은 디스크에 대해 설정해서는 안 됩니다.
|
properties.osType
|
OperatingSystemTypes
|
운영 체제 유형입니다.
|
properties.propertyUpdatesInProgress
|
PropertyUpdatesInProgress
|
업데이트가 보류 중인 디스크의 속성입니다.
|
properties.provisioningState
|
string
|
디스크 프로비저닝 상태입니다.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
디스크에서 내보내기를 제어하는 정책입니다.
|
properties.purchasePlan
|
PurchasePlan
|
OS 디스크를 만든 이미지에 대한 구매 계획 정보입니다. 예: - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}
|
properties.securityProfile
|
DiskSecurityProfile
|
리소스에 대한 보안 관련 정보를 포함합니다.
|
properties.shareInfo
|
ShareInfoElement[]
|
디스크가 연결된 모든 VM 목록의 세부 정보입니다. maxShares를 여러 VM에 연결할 수 있도록 디스크에 대해 1보다 큰 값으로 설정해야 합니다.
|
properties.supportedCapabilities
|
SupportedCapabilities
|
OS 디스크를 만든 이미지에 대해 지원되는 기능 목록입니다.
|
properties.supportsHibernation
|
boolean
|
디스크의 OS가 최대 절전 모드를 지원했음을 나타냅니다.
|
properties.tier
|
string
|
여기에 설명된 대로 디스크의 성능 계층(예: P4, S10) https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Ultra 디스크에는 적용되지 않습니다.
|
properties.timeCreated
|
string
|
디스크를 만든 시간입니다.
|
properties.uniqueId
|
string
|
리소스를 식별하는 고유 Guid입니다.
|
sku
|
DiskSku
|
디스크 sku 이름입니다. Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS 또는 PremiumV2_LRS 수 있습니다.
|
tags
|
object
|
리소스 태그
|
type
|
string
|
리소스 종류
|
zones
|
string[]
|
디스크의 논리 영역 목록입니다.
|
DiskCreateOption
이렇게 하면 디스크 생성의 가능한 원본이 열거됩니다.
Name |
형식 |
Description |
Attach
|
string
|
디스크가 VM에 연결됩니다.
|
Copy
|
string
|
지정된 sourceResourceId에 지정된 디스크 또는 스냅샷에서 복사하여 새 디스크 또는 스냅샷을 만듭니다.
|
CopyFromSanSnapshot
|
string
|
탄력적 san 볼륨 스냅샷에서 내보내 새 디스크 만들기
|
CopyStart
|
string
|
원본에서 모든 데이터를 복사한 후에만 리소스 만들기가 완료된 것으로 간주되는 심층 복사 프로세스를 사용하여 새 디스크를 만듭니다.
|
Empty
|
string
|
diskSizeGB에서 지정한 크기의 빈 데이터 디스크를 만듭니다.
|
FromImage
|
string
|
지정된 imageReference 또는 galleryImageReference로 지정된 플랫폼 이미지에서 새 디스크를 만듭니다.
|
Import
|
string
|
storageAccountId로 지정된 스토리지 계정의 sourceUri로 지정된 Blob에서 가져와 디스크를 만듭니다.
|
ImportSecure
|
string
|
만들기 가져오기 옵션과 유사합니다. storageAccountId로 지정된 스토리지 계정에서 securityDataUri로 지정된 VM 게스트 상태에 대한 추가 Blob을 가져와서 새 신뢰할 수 있는 시작 VM 또는 기밀 VM 지원 디스크 만들기
|
Restore
|
string
|
백업 복구 지점에서 복사하여 새 디스크를 만듭니다.
|
Upload
|
string
|
쓰기 토큰을 가져와서 디스크의 콘텐츠를 직접 업로드하는 데 사용하여 새 디스크를 만듭니다.
|
UploadPreparedSecure
|
string
|
업로드 만들기 옵션과 유사합니다. 새 신뢰할 수 있는 시작 VM 또는 기밀 VM 지원 디스크를 만들고 디스크 및 VM 게스트 상태 모두에서 쓰기 토큰을 사용하여 업로드
|
DiskSecurityProfile
리소스에 대한 보안 관련 정보를 포함합니다.
Name |
형식 |
Description |
secureVMDiskEncryptionSetId
|
string
|
고객 관리형 키로 암호화된 기밀 VM 지원 디스크에 연결된 디스크 암호화 집합의 ResourceId
|
securityType
|
DiskSecurityTypes
|
VM의 SecurityType을 지정합니다. OS 디스크에만 적용됩니다.
|
DiskSecurityTypes
VM의 SecurityType을 지정합니다. OS 디스크에만 적용됩니다.
Name |
형식 |
Description |
ConfidentialVM_DiskEncryptedWithCustomerKey
|
string
|
고객 관리형 키로 암호화된 OS 디스크 및 VM 게스트 상태가 모두 있는 기밀 VM 디스크를 나타냅니다.
|
ConfidentialVM_DiskEncryptedWithPlatformKey
|
string
|
플랫폼 관리형 키로 암호화된 OS 디스크 및 VM 게스트 상태가 모두 있는 기밀 VM 디스크를 나타냅니다.
|
ConfidentialVM_NonPersistedTPM
|
string
|
임시 vTPM이 있는 기밀 VM 디스크를 나타냅니다. vTPM 상태는 VM 재부팅에서 유지되지 않습니다.
|
ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey
|
string
|
암호화된 VM 게스트 상태만 있는 기밀 VM 디스크를 나타냅니다.
|
TrustedLaunch
|
string
|
신뢰할 수 있는 시작은 보안 부팅 및 vTPM(가상 신뢰할 수 있는 플랫폼 모듈)과 같은 보안 기능을 제공합니다.
|
DiskSku
디스크 sku 이름입니다. Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS 또는 PremiumV2_LRS 수 있습니다.
DiskState
그러면 디스크의 가능한 상태가 열거됩니다.
Name |
형식 |
Description |
ActiveSAS
|
string
|
디스크에는 현재 연결된 활성 SAS Uri가 있습니다.
|
ActiveSASFrozen
|
string
|
디스크가 최대 절전 모드 상태의 VM에 연결되고 연결된 활성 SAS URI가 있습니다.
|
ActiveUpload
|
string
|
업로드를 위해 디스크가 생성되고 업로드를 위해 쓰기 토큰이 발급되었습니다.
|
Attached
|
string
|
디스크는 현재 실행 중인 VM에 연결되어 있습니다.
|
Frozen
|
string
|
디스크가 최대 절전 모드인 VM에 연결됩니다.
|
ReadyToUpload
|
string
|
쓰기 토큰을 요청하여 업로드하여 디스크를 만들 준비가 된 것입니다.
|
Reserved
|
string
|
디스크가 중지된 할당 취소된 VM에 연결됩니다.
|
Unattached
|
string
|
디스크가 사용되지 않으며 VM에 연결할 수 있습니다.
|
DiskStorageAccountTypes
sku 이름입니다.
Name |
형식 |
Description |
PremiumV2_LRS
|
string
|
프리미엄 SSD v2 로컬 중복 스토리지. 대기 시간이 짧고 IOPS 및 처리량이 높은 프로덕션 및 성능에 민감한 워크로드에 가장 적합합니다.
|
Premium_LRS
|
string
|
프리미엄 SSD 로컬 중복 스토리지. 프로덕션 및 성능에 중요한 워크로드에 가장 적합합니다.
|
Premium_ZRS
|
string
|
프리미엄 SSD 영역 중복 스토리지. 영역 오류에 대한 스토리지 복원력이 필요한 프로덕션 워크로드에 가장 적합합니다.
|
StandardSSD_LRS
|
string
|
표준 SSD 로컬 중복 스토리지. 웹 서버, 가볍게 사용되는 엔터프라이즈 애플리케이션 및 개발/테스트에 가장 적합합니다.
|
StandardSSD_ZRS
|
string
|
표준 SSD 영역 중복 스토리지. 웹 서버, 가볍게 사용되는 엔터프라이즈 애플리케이션 및 영역 오류에 대한 스토리지 복원력이 필요한 개발/테스트에 가장 적합합니다.
|
Standard_LRS
|
string
|
표준 HDD 로컬 중복 스토리지. 백업, 중요하지 않은 액세스 및 드문 액세스에 가장 적합합니다.
|
UltraSSD_LRS
|
string
|
Ultra SSD 로컬 중복 스토리지. SAP HANA, 최상위 계층 데이터베이스(예: SQL, Oracle) 및 기타 트랜잭션이 많은 워크로드와 같은 IO 집약적 워크로드에 가장 적합합니다.
|
DiskUpdate
디스크 업데이트 리소스입니다.
Name |
형식 |
Description |
properties.burstingEnabled
|
boolean
|
디스크의 프로비전된 성능 목표를 초과하여 버스팅을 사용하도록 설정하려면 true로 설정합니다. 버스팅은 기본적으로 사용하지 않도록 설정됩니다. Ultra 디스크에는 적용되지 않습니다.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
디스크 또는 스냅샷을 내보내거나 업로드할 때 추가 인증 요구 사항입니다.
|
properties.diskAccessId
|
string
|
디스크에서 프라이빗 엔드포인트를 사용하기 위한 DiskAccess 리소스의 ARM ID입니다.
|
properties.diskIOPSReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 IOPS 수입니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskIOPSReadWrite
|
integer
|
이 디스크에 허용되는 IOPS 수입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. 하나의 작업은 4k에서 256k 바이트 사이를 전송할 수 있습니다.
|
properties.diskMBpsReadOnly
|
integer
|
공유 디스크를 ReadOnly로 탑재하는 모든 VM에서 허용되는 총 처리량(MBps)입니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskMBpsReadWrite
|
integer
|
이 디스크에 허용되는 대역폭입니다. UltraSSD 디스크에 대해서만 설정할 수 있습니다. MBps는 초당 수백만 바이트를 의미합니다. 여기서 MB는 10의 강력한 ISO 표기법을 사용합니다.
|
properties.diskSizeGB
|
integer
|
creationData.createOption이 비어 있는 경우 이 필드는 필수이며 만들 디스크의 크기를 나타냅니다. 이 필드가 다른 옵션을 사용하여 업데이트 또는 만들기에 있는 경우 크기 조정을 나타냅니다. 크기 조정은 디스크가 실행 중인 VM에 연결되지 않은 경우에만 허용되며 디스크의 크기만 늘릴 수 있습니다.
|
properties.encryption
|
Encryption
|
암호화 속성을 사용하여 고객 관리형 키 또는 플랫폼 관리 키를 사용하여 미사용 데이터를 암호화할 수 있습니다.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
Azure Disk Encryption으로 사용되는 암호화 설정 컬렉션은 디스크 또는 스냅샷당 여러 암호화 설정을 포함할 수 있습니다.
|
properties.maxShares
|
integer
|
디스크에 동시에 연결할 수 있는 최대 VM 수입니다. 1보다 큰 값은 동시에 여러 VM에 탑재할 수 있는 디스크를 나타냅니다.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
네트워크를 통해 디스크에 액세스하기 위한 정책입니다.
|
properties.optimizedForFrequentAttach
|
boolean
|
이 속성을 true로 설정하면 한 가상 머신에서 분리되고 다른 가상 머신에 연결하여 자주(하루에 5회 이상) 데이터 디스크의 안정성과 성능이 향상됩니다. 이 속성은 디스크가 가상 머신의 장애 도메인과 정렬되지 않도록 하기 때문에 자주 분리되고 연결되지 않은 디스크에 대해 설정해서는 안 됩니다.
|
properties.osType
|
OperatingSystemTypes
|
운영 체제 유형입니다.
|
properties.propertyUpdatesInProgress
|
PropertyUpdatesInProgress
|
업데이트가 보류 중인 디스크의 속성입니다.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
디스크에서 내보내기를 제어하는 정책입니다.
|
properties.purchasePlan
|
PurchasePlan
|
OS 디스크에 추가할 구매 계획 정보
|
properties.supportedCapabilities
|
SupportedCapabilities
|
OS 디스크에 추가할 지원되는 기능 목록입니다.
|
properties.supportsHibernation
|
boolean
|
디스크의 OS가 최대 절전 모드를 지원했음을 나타냅니다.
|
properties.tier
|
string
|
여기에 설명된 대로 디스크의 성능 계층(예: P4, S10) https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Ultra 디스크에는 적용되지 않습니다.
|
sku
|
DiskSku
|
디스크 sku 이름입니다. Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS 또는 PremiumV2_LRS 수 있습니다.
|
tags
|
object
|
리소스 태그
|
Encryption
디스크 또는 스냅샷에 대한 미사용 데이터 암호화 설정
Name |
형식 |
Description |
diskEncryptionSetId
|
string
|
미사용 암호화를 사용하도록 설정하는 데 사용할 디스크 암호화 집합의 ResourceId입니다.
|
type
|
EncryptionType
|
디스크의 데이터를 암호화하는 데 사용되는 키 유형입니다.
|
EncryptionSettingsCollection
디스크 또는 스냅샷에 대한 암호화 설정
Name |
형식 |
Description |
enabled
|
boolean
|
이 플래그를 true로 설정하고 DiskEncryptionKey 및 선택적 KeyEncryptionKey를 제공하여 암호화를 사용하도록 설정합니다. 이 플래그를 false로 설정하고 DiskEncryptionKey 및 KeyEncryptionKey를 제거하여 암호화를 사용하지 않도록 설정합니다. 요청 개체에서 EncryptionSettings가 null이면 기존 설정은 변경되지 않은 상태로 유지됩니다.
|
encryptionSettings
|
EncryptionSettingsElement[]
|
각 디스크 볼륨에 대해 하나씩 암호화 설정의 컬렉션입니다.
|
encryptionSettingsVersion
|
string
|
디스크에 사용되는 암호화 유형을 설명합니다. 이 필드가 설정되면 덮어쓸 수 없습니다. '1.0'은 AAD 앱을 사용하는 Azure Disk Encryption에 해당합니다.'1.1'은 Azure Disk Encryption에 해당합니다.
|
EncryptionSettingsElement
하나의 디스크 볼륨에 대한 암호화 설정입니다.
Name |
형식 |
Description |
diskEncryptionKey
|
KeyVaultAndSecretReference
|
디스크 암호화 키의 Key Vault 비밀 URL 및 자격 증명 모음 ID
|
keyEncryptionKey
|
KeyVaultAndKeyReference
|
키 암호화 키의 Key Vault 키 URL 및 자격 증명 모음 ID입니다. KeyEncryptionKey는 선택 사항이며 제공된 경우 디스크 암호화 키를 래프 해제하는 데 사용됩니다.
|
EncryptionType
디스크의 데이터를 암호화하는 데 사용되는 키 유형입니다.
Name |
형식 |
Description |
EncryptionAtRestWithCustomerKey
|
string
|
디스크는 고객이 변경하고 해지할 수 있는 고객 관리 키를 사용하여 미사용 시 암호화됩니다.
|
EncryptionAtRestWithPlatformAndCustomerKeys
|
string
|
디스크는 2개의 암호화 계층으로 미사용 시 암호화됩니다. 키 중 하나는 고객 관리이고 다른 키는 플랫폼 관리입니다.
|
EncryptionAtRestWithPlatformKey
|
string
|
디스크는 플랫폼 관리 키를 사용하여 미사용 시 암호화됩니다. 기본 암호화 유형입니다. 디스크 암호화 집합에 유효한 암호화 유형이 아닙니다.
|
ExtendedLocation
확장된 위치의 복합 형식입니다.
ExtendedLocationTypes
확장된 위치의 형식입니다.
Name |
형식 |
Description |
EdgeZone
|
string
|
|
HyperVGeneration
Virtual Machine의 하이퍼바이저 생성입니다. OS 디스크에만 적용됩니다.
Name |
형식 |
Description |
V1
|
string
|
|
V2
|
string
|
|
ImageDiskReference
디스크를 만드는 데 사용되는 원본 이미지입니다.
Name |
형식 |
Description |
communityGalleryImageId
|
string
|
커뮤니티 Azure Compute 갤러리 이미지 참조를 포함하는 상대 URI입니다.
|
id
|
string
|
플랫폼 이미지 리포지토리, 사용자 이미지 또는 Azure Compute 갤러리 이미지 참조를 포함하는 상대 URI입니다.
|
lun
|
integer
|
디스크가 이미지의 데이터 디스크에서 만들어진 경우 이 인덱스는 이미지에서 사용할 데이터 디스크를 나타내는 인덱스입니다. OS 디스크의 경우 이 필드는 null입니다.
|
sharedGalleryImageId
|
string
|
직접 공유 Azure Compute 갤러리 이미지 참조를 포함하는 상대 URI입니다.
|
KeyVaultAndKeyReference
KeK의 Key Vault 키 URL 및 자격 증명 모음 ID는 선택 사항이며 제공된 경우 encryptionKey를 래프 해제하는 데 사용됩니다.
Name |
형식 |
Description |
keyUrl
|
string
|
KeyVault에서 키 또는 비밀을 가리키는 URL
|
sourceVault
|
SourceVault
|
키 또는 비밀을 포함하는 KeyVault의 리소스 ID
|
KeyVaultAndSecretReference
암호화 키의 Key Vault 비밀 URL 및 자격 증명 모음 ID
Name |
형식 |
Description |
secretUrl
|
string
|
KeyVault에서 키 또는 비밀을 가리키는 URL
|
sourceVault
|
SourceVault
|
키 또는 비밀을 포함하는 KeyVault의 리소스 ID
|
NetworkAccessPolicy
네트워크를 통해 디스크에 액세스하기 위한 정책입니다.
Name |
형식 |
Description |
AllowAll
|
string
|
디스크는 모든 네트워크에서 내보내거나 업로드할 수 있습니다.
|
AllowPrivate
|
string
|
DiskAccess 리소스의 프라이빗 엔드포인트를 사용하여 디스크를 내보내거나 업로드할 수 있습니다.
|
DenyAll
|
string
|
디스크를 내보낼 수 없습니다.
|
OperatingSystemTypes
운영 체제 유형입니다.
Name |
형식 |
Description |
Linux
|
string
|
|
Windows
|
string
|
|
PropertyUpdatesInProgress
업데이트가 보류 중인 디스크의 속성입니다.
Name |
형식 |
Description |
targetTier
|
string
|
계층 변경 작업이 진행 중인 경우 디스크의 대상 성능 계층입니다.
|
ProvisionedBandwidthCopyOption
이 필드가 스냅샷에 설정되어 있고 createOption이 CopyStart이면 스냅샷이 더 빠른 속도로 복사됩니다.
Name |
형식 |
Description |
Enhanced
|
string
|
|
None
|
string
|
|
PublicNetworkAccess
디스크에서 내보내기를 제어하는 정책입니다.
Name |
형식 |
Description |
Disabled
|
string
|
NetworkAccessPolicy가 AllowAll로 설정된 경우에도 인터넷에서 디스크의 기본 데이터에 공개적으로 액세스할 수 없습니다. NetworkAccessPolicy가 AllowPrivate로 설정된 경우에만 신뢰할 수 있는 Azure VNET에서 SAS URI를 통해 데이터에 액세스할 수 있습니다.
|
Enabled
|
string
|
NetworkAccessPolicy가 AllowAll로 설정된 경우 SAS URI를 생성하여 인터넷에서 공개적으로 디스크의 기본 데이터에 액세스할 수 있습니다. NetworkAccessPolicy가 AllowPrivate로 설정된 경우에만 신뢰할 수 있는 Azure VNET에서 SAS URI를 통해 데이터에 액세스할 수 있습니다.
|
PurchasePlan
MarketPlace를 통해 타사 아티팩트 구매 컨텍스트를 설정하는 데 사용됩니다.
Name |
형식 |
Description |
name
|
string
|
계획 ID입니다.
|
product
|
string
|
마켓플레이스에서 이미지의 곱을 지정합니다. imageReference 요소 아래의 Offer와 동일한 값입니다.
|
promotionCode
|
string
|
제품 프로모션 코드입니다.
|
publisher
|
string
|
게시자 ID입니다.
|
ShareInfoElement
Name |
형식 |
Description |
vmUri
|
string
|
디스크가 연결된 VM의 ID를 포함하는 상대 URI입니다.
|
SourceVault
자격 증명 모음 ID는 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 형식의 Azure Resource Manager 리소스 ID입니다.
Name |
형식 |
Description |
id
|
string
|
리소스 ID
|
SupportedCapabilities
VM 사용을 위해 디스크 리소스에 유지되는 지원되는 기능 목록입니다.
Name |
형식 |
Description |
acceleratedNetwork
|
boolean
|
TRUE이면 OS 디스크를 만든 이미지가 가속화된 네트워킹을 지원합니다.
|
architecture
|
Architecture
|
OS 디스크에서 지원하는 CPU 아키텍처입니다.
|
diskControllerTypes
|
string
|
OS 디스크가 지원하는 디스크 컨트롤러입니다. 설정된 경우 SCSI 또는 SCSI, NVME 또는 NVME, SCSI일 수 있습니다.
|