I have found that azure python sdk has provided following method for running command in linux vm.
from azure.mgmt.compute import compute_management_client
from azure.common.credentials import ServicePrincipalCredentials
credentials = ServicePrincipalCrendentials(client_id, secret, tenant)
client = compute_management_client(credentials, subscription_id)
client.virtual_machines.run_command(resource_group_name,
vm_name, parameters, customheaders=None, raw=False,
**operation_config)
But how do I pass my command here? I couldn't find any sample for parameters and operation_config. Please Help