Azure virtual machine libraries
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.
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Azure SDK for Python