Azure PowerShell command to list all Azure VM SKU Sizes enabled for Confidential Computing Azure ACC - Stack Overflow

Get-AzVMSize -Location "West US"The command above returns a list of all Azure VM SKU sizes in

Get-AzVMSize -Location "West US"

The command above returns a list of all Azure VM SKU sizes in this format.

Name                      NumberOfCores MemoryInMB MaxDataDiskCount OSDiskSizeInMB ResourceDiskSizeInMB
----                      ------------- ---------- ---------------- -------------- --------------------
Standard_L8as_v3                      8      65536               16        1047552                81920
Standard_L16as_v3                    16     131072               32        1047552               163840
Standard_L32as_v3                    32     262144               32        1047552               327680
Standard_L48as_v3                    48     393216               32        1047552               491520
Standard_L64as_v3                    64     524288               32        1047552               655360

Is there an Azure PowerShell command, C# SDK API or REST API call that can give me a list of all available SKUs that are enabled for confidential computing? There is some document list, but I would like a way to pull this programmatically. I do not see a documented way so far to this in PowerShell either, any suggestions?

Get-AzVMSize -Location "West US"

The command above returns a list of all Azure VM SKU sizes in this format.

Name                      NumberOfCores MemoryInMB MaxDataDiskCount OSDiskSizeInMB ResourceDiskSizeInMB
----                      ------------- ---------- ---------------- -------------- --------------------
Standard_L8as_v3                      8      65536               16        1047552                81920
Standard_L16as_v3                    16     131072               32        1047552               163840
Standard_L32as_v3                    32     262144               32        1047552               327680
Standard_L48as_v3                    48     393216               32        1047552               491520
Standard_L64as_v3                    64     524288               32        1047552               655360

Is there an Azure PowerShell command, C# SDK API or REST API call that can give me a list of all available SKUs that are enabled for confidential computing? There is some document list, but I would like a way to pull this programmatically. I do not see a documented way so far to this in PowerShell either, any suggestions?

Share Improve this question edited Nov 21, 2024 at 19:59 greg asked Nov 15, 2024 at 20:11 greggreg 1,2142 gold badges24 silver badges52 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

The Azure management API has an endpoint that allows you to list resource skus.

https://management.azure/subscriptions/{subscription-id}/providers/Microsoft.Compute/skus?api-version=2021-07-01&$filter=location eq 'westus'

The response contains skus for all types of compute resources, including virtual machines (filtering by region is recommended as the response will otherwise be close to 60MB).

The capabilities array contains detailed information on what the sku can be used for. You can filter the response using Powershell.

$apiResponse = Invoke-WebRequest -Method Get `
    -Uri "https://management.azure/subscriptions/{subscription-id}/providers/Microsoft.Compute/skus?api-version=2021-07-01&`$filter=location eq 'westus'" `
    -Headers @{
        "Authorization" = "Bearer $($accessToken)"
        "Content-Type" = "application/json"
    }

($apiResponse.Content | ConvertFrom-Json -Depth 99).value | Where-Object {
    $_.ResourceType -eq "VirtualMachines" -and
    $_.Capabilities.Name -contains "ConfidentialComputingType"
} | Select-Object Name, Tier, Family, Size, @{ 
    Name = "ConfidentialComputingType"; 
    Expression = { ($_.capabilities | Where-Object {$_.Name -contains "ConfidentialComputingType"}).value -join "," } 
} | Format-Table

This will output a table containing the VM sizes and the confidential compute type.

Name                 Tier     Family                 Size        ConfidentialComputingType
----                 ----     ------                 ----        -------------------------
Standard_DC16ads_v5  Standard standardDCADSv5Family  DC16ads_v5  SNP
Standard_DC16as_v5   Standard standardDCASv5Family   DC16as_v5   SNP
Standard_DC2ads_v5   Standard standardDCADSv5Family  DC2ads_v5   SNP
Standard_DC2as_v5    Standard standardDCASv5Family   DC2as_v5    SNP
... more results

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745672679a4639501.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信