Starts one or more virtual machines in a VM scale set.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start?api-version=2023-03-01
URI Parameters
Name
In
Required
Type
Description
resourceGroupName
path
True
string
The name of the resource group.
subscriptionId
path
True
string
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
vmScaleSetName
path
True
string
The name of the VM scale set.
api-version
query
True
string
Client Api Version.
Request Body
Name
Type
Description
instanceIds
string[]
The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set.
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python virtual_machine_scale_set_start_maximum_set_gen.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.virtual_machine_scale_sets.begin_start(
resource_group_name="rgcompute",
vm_scale_set_name="aaaaaaaaaaaaaaaaaaaaaaaa",
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json
if __name__ == "__main__":
main()
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/aaaaaaaaaaaaaaaaaaa/start?api-version=2023-03-01
/** Samples for VirtualMachineScaleSets Start. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json
*/
/**
* Sample code: VirtualMachineScaleSet_Start_MinimumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineScaleSetStartMinimumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getVirtualMachineScaleSets()
.start("rgcompute", "aaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python virtual_machine_scale_set_start_minimum_set_gen.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.virtual_machine_scale_sets.begin_start(
resource_group_name="rgcompute",
vm_scale_set_name="aaaaaaaaaaaaaaaaaaa",
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json
if __name__ == "__main__":
main()
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Starts one or more virtual machines in a VM scale set.
*
* @summary Starts one or more virtual machines in a VM scale set.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json
*/
async function virtualMachineScaleSetStartMinimumSetGen() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute";
const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.virtualMachineScaleSets.beginStartAndWait(
resourceGroupName,
vmScaleSetName
);
console.log(result);
}
Specifies a list of virtual machine instance IDs from the VM scale set.
Name
Type
Description
instanceIds
string[]
The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set.