Skip to content
Advertisement

How to create Azure Virtual machine with VM Extension using the python SDK

I want to create an Azure virtual machine with the VM extension(Custom script extension) using the python SDK. Basically, I want a python program that will create the VM with VM extension using the Azure SDK management libraries, I am able to use the Azure SDK management libraries in a Python script to create a resource group that contains a Linux virtual machine. https://learn.microsoft.com/en-us/azure/developer/python/azure-sdk-example-virtual-machines?tabs=cmd

But I need my Virtual machine with VM extension in it.

Advertisement

Answer

As of now, we don’t have proper documentation related to the creation of VM with extension.

  • Here is the SDK reference document for creating and updating the extension

    VirtualMachineExtensionsOperations(client, config, serializer, deserializer)

  • Here is the sample code to create the extension

    begin_create_or_update(resource_group_name: str, vm_name: str, vm_extension_name: str, extension_parameters: “_models.VirtualMachineExtension”, **kwargs: Any) -> LROPoller[‘_models.VirtualMachineExtension’]

  • Here is the document for creation Virtual machine using python.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement