code: def _create_network_interface(
          self, ip_config_name, nic_name, public_ip, region,
          resource_group_name, subnet, accelerated_networking=False
      ):
          
          nic_config = {
              'location': region,
              'ip_configurations': [{
                  'name': ip_config_name,
                  'private_ip_allocation_method': 'Dynamic',
                  'subnet': {
                      'id': subnet.id
                  },
                  'public_ip_address': {
                      'id': public_ip.id
                  },
              }]
          }
  
          if accelerated_networking:
              nic_config['enable_accelerated_networking'] = True
  
          try:
              nic_setup = self.network.network_interfaces.create_or_update(
                  resource_group_name, nic_name, nic_config
              )
          except Exception as error:
              raise AzureCloudException(
                  'Unable to create network interface: {0}.'.format(
                      error
                  )
              )
  
          return nic_setup.result()
docs: Create a network interface in the resource group.
  
          Attach NIC to the subnet and public IP provided.