Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- virtual_machine = compute.VirtualMachine('my-vm',
- resource_group_name=resource_group.name,
- network_interface_ids=[network_interface.id],
- vm_size='Standard_B2s',
- storage_image_reference={
- 'publisher': 'Canonical',
- 'offer': 'UbuntuServer',
- 'sku': '20.04-LTS',
- 'version': 'latest',
- },
- storage_os_disk={
- 'name': 'myosdisk',
- 'caching': 'ReadWrite',
- 'create_option': 'FromImage',
- 'managed_disk_type': 'Standard_LRS',
- },
- os_profile={
- 'computer_name': 'myvm',
- 'admin_username': 'azuser',
- 'linux_configuration': {
- 'disable_password_authentication': True,
- 'ssh': {
- 'public_keys': [{
- 'path': '/home/azuser/.ssh/authorized_keys',
- 'key_data': open('/path/to/.ssh/id_rsa.pub').read()
- }]
- }
- }
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement