以程式設計方式部署和管理 Azure Arc 擴充安全性更新授權

本文提供透過 Azure Arc ESU ARM API 程式化配置與管理 Windows Server 擴展安全更新生命週期操作的指引。 這些說明適用於 Windows Server 2012/2012 R2 以及 Windows Server 2016。 請使用文章頂部的選擇器選擇你授權的作業系統版本。

對於本文中解釋的每個 API 指令,根據你的具體情境,輸入準確的參數資訊,包括位置、狀態、版本、類型和處理器。 將target屬性設定為您授權的作業系統:

  • Windows Server 2012
  • Windows Server 2012 R2

Important

Windows Server 2012 與 Windows Server 2012 R2 ESU 期間將於 2026 年 10 月 13 日結束。 2026 年 10 月 14 日協調世界時 (UTC) 午夜,將停用由 Azure Arc 啟用的 ESU 授權,並停止提供取得更新的資格。 停用的授權資源仍可查詢,但無法提供您 2026 年 10 月 13 日後發行之安全性更新的適用資格。

  • Windows Server 2016

附註

你需要建立一個服務主體,才能使用 Azure API 來管理 ESU。 如需詳細資訊,請參閱大規模將混合式機器連線至 Azure 和 Azure REST API 參考。

提供授權

若要佈建授權,請執行以下命令:

PUT  
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview 
{  
    "location": "ENTER-REGION",  
    "properties": {  
        "licenseDetails": {  
            "state": "Activated",  
            "target": "Windows Server 2012",  
            "Edition": "Datacenter",  
            "Type": "pCore",  
            "Processors": 12  
        }  
    }  
}
PUT  
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview 
{  
    "location": "ENTER-REGION",  
    "properties": {  
        "licenseDetails": {  
            "state": "Activated",  
            "target": "Windows Server 2016",  
            "Edition": "Datacenter",  
            "Type": "pCore",  
            "Processors": 12  
        }  
    }  
}

--volume-license-details參數僅適用於從第一年大量授權使用權利轉換。 這個過渡期已經結束。 指令語法保留與現有自動化相容的參數:

az connectedmachine license create --license-name
                                   --resource-group
                                   [--edition {Datacenter, Standard}]
                                   [--license-type {ESU}]
                                   [--location]
                                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--processors]
                                   [--state {Activated, Deactivated}]
                                   [--tags]
                                   [--target {Windows Server 2012, Windows Server 2012 R2}]
                                   [--tenant-id]
                                   [--type {pCore, vCore}]
                                   [--volume-license-details]

從大量授權轉換

Azure Arc 啟用的 Windows Server 2016 ESU 不支援從大量授權轉換。

要連結授權,請執行以下指令:

PUT  
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/machines/MACHINE_NAME/licenseProfiles/default?api-version=2023-06-20-preview 
{
   "location": "SAME_REGION_AS_MACHINE",
   "properties": {
      "esuProfile": {
         "assignedLicense": "RESOURCE_ID_OF_LICENSE"
      }
   }
}

要解除綁定授權,請執行以下指令:

PUT 
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/machines/MACHINE_NAME/licenseProfiles/default?api-version=2023-06-20-preview
{
  "location": "SAME_REGION_AS_MACHINE",
  "properties": {
    "esuProfile": {
    }
  }
}

修改授權

要修改授權,請執行以下指令:

PUT/PATCH 
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview 
{  
    "location": "ENTER-REGION",  
    "properties": {  
        "licenseDetails": {  
            "state": "Activated",  
            "target": "Windows Server 2012",  
            "Edition": "Datacenter",  
            "Type": "pCore",  
            "Processors": 12  
        }  
    }  
}
PUT/PATCH 
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview 
{  
    "location": "ENTER-REGION",  
    "properties": {  
        "licenseDetails": {  
            "state": "Activated",  
            "target": "Windows Server 2016",  
            "Edition": "Datacenter",  
            "Type": "pCore",  
            "Processors": 12  
        }  
    }  
}

要刪除授權,請執行以下指令:

DELETE  
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview