Integrations/AzureCompute_v2/AzureCompute_v2.py
def create_vm_parameters(args):
    """
    Construct the VM object

    Use the actual parameters passed to the 'azure-vm-create-instance' command
    to build a vm object that will be sent in the body of the command's associated
    API call.

    parameter: (dict) args
        Dictionary that contains the actual parameters that were passed to the
        'azure-vm-create-instance' command

    returns:
        Virtual Machine Object
    """
    # Retrieve relevant command arguments
    location = args.get('virtual_machine_location')
    vm_size = args.get('vm_size')
    image = args.get('os_image')
    sku = args.get('sku')
    publisher = args.get('publisher')
    version = args.get('version')
    offer = args.get('offer')
    vm_name = args.get('virtual_machine_name')
    resource_group = args.get('resource_group')
    admin_username = args.get('admin_username')
    admin_password = args.get('admin_password')
    nic_name = args.get('nic_name')
    full_nic_id = '/subscriptions/' + SUBSCRIPTION_ID + '/resourceGroups/'  # type: ignore
    full_nic_id += resource_group + '/providers/Microsoft.Network/networkInterfaces/' + nic_name

    if not image and not (sku and publisher and version and offer):
        err_msg = 'You must enter a value for the \'os_image\' argument '
        err_msg += 'or the group of arguments, \'sku\', \'publisher\', \'version\', and \'offer\'.'
        raise Exception(err_msg)

    if image:
        sku, publisher, offer, version = assign_image_attributes(image)

    # Construct VM object
    vm = {
        'location': location,
        'properties': {
            'hardwareProfile': {
                'vmSize': vm_size
            },
            'storageProfile': {
                'imageReference': {
                    'sku': sku,
                    'publisher': publisher,
                    'version': version,
                    'offer': offer
                },
                'osDisk': {
                    'caching': 'ReadWrite',
                    'managedDisk': {
                        'storageAccountType': 'Standard_LRS'
                    },
                    'name': vm_name,
                    'createOption': 'FromImage'
                }
            },
            'osProfile': {
                'adminUsername': admin_username,
                'computerName': vm_name,
                'adminPassword': admin_password
            },
            'networkProfile': {
                'networkInterfaces': [
                    {
                        'id': full_nic_id,
                        'properties': {
                            'primary': 'true'
                        }
                    }
                ]
            }
        },
        'name': vm_name
    }

    return vm

    Construct the VM object

    Use the actual parameters passed to the 'azure-vm-create-instance' command
    to build a vm object that will be sent in the body of the command's associated
    API call.

    parameter: (dict) args
        Dictionary that contains the actual parameters that were passed to the
        'azure-vm-create-instance' command

    returns:
        Virtual Machine Object
    
Construct the VM object
Use the actual parameters passed to the 'azure-vm-create-instance' command
to build a vm object that will be sent in the body of the command's associated
API call.

(dict) args
Dictionary that contains the actual parameters that were passed to the
'azure-vm-create-instance' command

Virtual Machine Object
Construct the VM object Use the actual parameters passed to the ' azure - vm - create - instance ' command to build a vm object that will be sent in the body of the command ' s associated API call . ( dict ) args Dictionary that contains the actual parameters that were passed to the ' azure - vm - create - instance ' command Virtual Machine Object
def create_vm_parameters(args):
    location = args.get('virtual_machine_location')
    vm_size = args.get('vm_size')
    image = args.get('os_image')
    sku = args.get('sku')
    publisher = args.get('publisher')
    version = args.get('version')
    offer = args.get('offer')
    vm_name = args.get('virtual_machine_name')
    resource_group = args.get('resource_group')
    admin_username = args.get('admin_username')
    admin_password = args.get('admin_password')
    nic_name = args.get('nic_name')
    full_nic_id = '/subscriptions/' + SUBSCRIPTION_ID + '/resourceGroups/'  
    full_nic_id += resource_group + '/providers/Microsoft.Network/networkInterfaces/' + nic_name
    if not image and not (sku and publisher and version and offer):
        err_msg = 'You must enter a value for the \'os_image\' argument '
        err_msg += 'or the group of arguments, \'sku\', \'publisher\', \'version\', and \'offer\'.'
        raise Exception(err_msg)
    if image:
        sku, publisher, offer, version = assign_image_attributes(image)
    vm = {
        'location': location,
        'properties': {
            'hardwareProfile': {
                'vmSize': vm_size
            },
            'storageProfile': {
                'imageReference': {
                    'sku': sku,
                    'publisher': publisher,
                    'version': version,
                    'offer': offer
                },
                'osDisk': {
                    'caching': 'ReadWrite',
                    'managedDisk': {
                        'storageAccountType': 'Standard_LRS'
                    },
                    'name': vm_name,
                    'createOption': 'FromImage'
                }
            },
            'osProfile': {
                'adminUsername': admin_username,
                'computerName': vm_name,
                'adminPassword': admin_password
            },
            'networkProfile': {
                'networkInterfaces': [
                    {
                        'id': full_nic_id,
                        'properties': {
                            'primary': 'true'
                        }
                    }
                ]
            }
        },
        'name': vm_name
    }
    return vm
def create_vm_parameters ( args ) : location = args . get ( 'virtual_machine_location' ) vm_size = args . get ( 'vm_size' ) image = args . get ( 'os_image' ) sku = args . get ( 'sku' ) publisher = args . get ( 'publisher' ) version = args . get ( 'version' ) offer = args . get ( 'offer' ) vm_name = args . get ( 'virtual_machine_name' ) resource_group = args . get ( 'resource_group' ) admin_username = args . get ( 'admin_username' ) admin_password = args . get ( 'admin_password' ) nic_name = args . get ( 'nic_name' ) full_nic_id = '/subscriptions/' + SUBSCRIPTION_ID + '/resourceGroups/' full_nic_id += resource_group + '/providers/Microsoft.Network/networkInterfaces/' + nic_name if not image and not ( sku and publisher and version and offer ) : err_msg = 'You must enter a value for the \'os_image\' argument ' err_msg += 'or the group of arguments, \'sku\', \'publisher\', \'version\', and \'offer\'.' raise Exception ( err_msg ) if image : sku , publisher , offer , version = assign_image_attributes ( image ) vm = { 'location' : location , 'properties' : { 'hardwareProfile' : { 'vmSize' : vm_size } , 'storageProfile' : { 'imageReference' : { 'sku' : sku , 'publisher' : publisher , 'version' : version , 'offer' : offer } , 'osDisk' : { 'caching' : 'ReadWrite' , 'managedDisk' : { 'storageAccountType' : 'Standard_LRS' } , 'name' : vm_name , 'createOption' : 'FromImage' } } , 'osProfile' : { 'adminUsername' : admin_username , 'computerName' : vm_name , 'adminPassword' : admin_password } , 'networkProfile' : { 'networkInterfaces' : [ { 'id' : full_nic_id , 'properties' : { 'primary' : 'true' } } ] } } , 'name' : vm_name } return vm
Construct the VM object
Use the actual parameters passed to the 'azure-vm-create-instance' command
to build a vm object that will be sent in the body of the command's associated
API call.
Construct the VM object Use the actual parameters passed to the ' azure - vm - create - instance ' command to build a vm object that will be sent in the body of the command ' s associated API call .
"""
    Construct the VM object

    Use the actual parameters passed to the 'azure-vm-create-instance' command
    to build a vm object that will be sent in the body of the command's associated
    API call.

    parameter: (dict) args
        Dictionary that contains the actual parameters that were passed to the
        'azure-vm-create-instance' command

    returns:
        Virtual Machine Object
    """ # Retrieve relevant command arguments # type: ignore # Construct VM object
args