Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Overview
On-demand, scalable computing resources running Linux or Windows.
To get started with Azure Virtual Machines, see Create a Linux virtual machine with the Azure portal.
Management API
Create, configure, manage and scale Windows and Linux virtual machines in Azure from your code with the management API.
Install the library via pip.
pip install azure-mgmt-compute
Example
Create a new Linux virtual machine in an existing Azure resource group with Managed Service Identity(MSI) authentication.
VM_PARAMETERS={
'location': 'LOCATION',
'os_profile': {
'computer_name': 'VM_NAME',
'admin_username': 'USERNAME',
'admin_password': 'PASSWORD'
},
'hardware_profile': {
'vm_size': 'Standard_DS1_v2'
},
'storage_profile': {
'image_reference': {
'publisher': 'Canonical',
'offer': 'UbuntuServer',
'sku': '16.04.0-LTS',
'version': 'latest'
},
},
'network_profile': {
'network_interfaces': [{
'id': 'NIC_ID',
}]
},
}
def create_vm()
compute_client.virtual_machines.create_or_update(
'RESOURCE_GROUP_NAME', 'VM_NAME', VM_PARAMETERS)
Samples
- Manage virtual machines
- Create a virtual machine with Managed Service Identity Extension
- Manage a load balancer
- Create and configure managed disks
- Monitor virtual machines
View the complete list of virtual machine samples.
Azure SDK for Python