You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求Azure Stack资源类REST API官方文档链接指引

Hey there! Let me break down how to access and use the REST APIs for managing Azure Stack resources like resource groups, VMs, virtual networks, and subnets:

Core Azure Stack REST API Overview

Azure Stack's resource management REST APIs are closely aligned with Azure's public cloud APIs, but tailored to your on-premises/hybrid Azure Stack environment. All operations use your Azure Stack's specific management endpoint as the base URL, and follow standard REST conventions (GET for retrieval, PUT for create/update, DELETE for removal, POST for actions like starting a VM).

Resource Groups

These APIs let you manage the logical containers for your Azure Stack resources:

  • Create/Update: Use the PUT method on the endpoint /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}
  • List all resource groups in a subscription: GET on /subscriptions/{subscriptionId}/resourcegroups
  • Delete a resource group: DELETE on /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}
  • Get details of a specific resource group: GET on /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}

Virtual Machines (VMs)

Manage VM lifecycle and properties with these endpoints:

  • Deploy or update a VM: PUT on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • List all VMs in a resource group: GET on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines
  • Start/Stop/Deallocate a VM: Use POST methods on endpoints like /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start (swap start with stop or deallocate for those actions)
  • Delete a VM: DELETE on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}

Virtual Networks (VNets)

Handle VNet creation, configuration, and management:

  • Create or update a VNet: PUT on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}
  • List all VNets in a resource group: GET on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks
  • Get details of a specific VNet: GET on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}
  • Delete a VNet: DELETE on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}

Subnets

Manage subnets within your Azure Stack VNets:

  • Create or update a subnet: PUT on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • List all subnets in a VNet: GET on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets
  • Get details of a specific subnet: GET on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Delete a subnet: DELETE on /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
Key Implementation Notes
  • Authentication: You'll need to authenticate using either Azure AD or AD FS (depending on your Azure Stack setup). Use OAuth 2.0 to retrieve an access token, which you include in the Authorization header as Bearer {your-access-token}.
  • Base URL & Placeholders: Replace placeholders like {subscriptionId}, {resourceGroupName} with your actual values. Your base URL follows the format https://management.{region}.{your-azure-stack-domain}.
  • API Versions: Every resource type requires a specific API version in the query string (e.g., ?api-version=2023-07-01 for Compute resources, 2023-09-01 for Network resources). Always use the latest version compatible with your Azure Stack build.
  • Request Bodies: For create/update operations, you'll need to send a JSON request body defining the resource's properties (e.g., VM size, VNet address space, subnet CIDR range).

内容的提问来源于stack exchange,提问作者S_Anuj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 06:55:49