寻求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:
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
PUTmethod on the endpoint/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} - List all resource groups in a subscription:
GETon/subscriptions/{subscriptionId}/resourcegroups - Delete a resource group:
DELETEon/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} - Get details of a specific resource group:
GETon/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}
Virtual Machines (VMs)
Manage VM lifecycle and properties with these endpoints:
- Deploy or update a VM:
PUTon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName} - List all VMs in a resource group:
GETon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines - Start/Stop/Deallocate a VM: Use
POSTmethods on endpoints like/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start(swapstartwithstopordeallocatefor those actions) - Delete a VM:
DELETEon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
Virtual Networks (VNets)
Handle VNet creation, configuration, and management:
- Create or update a VNet:
PUTon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName} - List all VNets in a resource group:
GETon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks - Get details of a specific VNet:
GETon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName} - Delete a VNet:
DELETEon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}
Subnets
Manage subnets within your Azure Stack VNets:
- Create or update a subnet:
PUTon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} - List all subnets in a VNet:
GETon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets - Get details of a specific subnet:
GETon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} - Delete a subnet:
DELETEon/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
- 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
Authorizationheader asBearer {your-access-token}. - Base URL & Placeholders: Replace placeholders like
{subscriptionId},{resourceGroupName}with your actual values. Your base URL follows the formathttps://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-01for Compute resources,2023-09-01for 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

