def METHOD_NAME():
    client = ComputeManagementClient(
        credential=DefaultAzureCredential(),
        subscription_id="{subscription-id}",
    )
    response = client.virtual_machines.begin_create_or_update(
        resource_group_name="myResourceGroup",
        vm_name="myVM",
        parameters={
            "location": "westus",
            "properties": {
                "hardwareProfile": {"vmSize": "Standard_D1_v2"},
                "networkProfile": {
                    "networkApiVersion": "2020-11-01",
                    "networkInterfaceConfigurations": [
                        {
                            "name": "{nic-config-name}",
                            "properties": {
                                "deleteOption": "Delete",
                                "ipConfigurations": [
                                    {
                                        "name": "{ip-config-name}",
                                        "properties": {
                                            "primary": True,
                                            "publicIPAddressConfiguration": {
                                                "name": "{publicIP-config-name}",
                                                "properties": {
                                                    "deleteOption": "Detach",
                                                    "publicIPAllocationMethod": "Static",
                                                },
                                                "sku": {"name": "Basic", "tier": "Global"},
                                            },
                                        },
                                    }
                                ],
                                "primary": True,
                            },
                        }
                    ],
                },
                "osProfile": {
                    "adminPassword": "{your-password}",
                    "adminUsername": "{your-username}",
                    "computerName": "myVM",
                },
                "storageProfile": {
                    "imageReference": {
                        "offer": "WindowsServer",
                        "publisher": "MicrosoftWindowsServer",
                        "sku": "2016-Datacenter",
                        "version": "latest",
                    },
                    "osDisk": {
                        "caching": "ReadWrite",
                        "createOption": "FromImage",
                        "managedDisk": {"storageAccountType": "Standard_LRS"},
                        "name": "myVMosdisk",
                    },
                },
            },
        },
    ).result()
    print(response)