def create_media_service_rg(access_token, subscription_id, rgname, location, stoname, msname):
endpoint = '<STR_LIT>'.join([get_rm_endpoint(),<EOL>'<STR_LIT>', subscription_id,<EOL>'<STR_LIT>', rgname,<EOL>'<STR_LIT>', msname,<EOL>'<STR_LIT>', MEDIA_API])<EOL>ms_body = {'<STR_LIT:name>': msname}<EOL>ms_body['<STR_LIT:location>'] = location<EOL>sub_id_str = '<STR_LIT>' + subscription_id + '<STR_LIT>' + rgname +'<STR_LIT>' + stoname<EOL>storage_account = {'<STR_LIT:id>': sub_id_str}<EOL>storage_account['<STR_LIT>'] = True<EOL>properties = {'<STR_LIT>': [storage_account]}<EOL>ms_body['<STR_LIT>'] = properties<EOL>body = json.dumps(ms_body)<EOL>return do_put(endpoint, body, access_token)<EOL>
Create a media service in a resource group.

    Args:
        access_token (str): A valid Azure authentication token.
        subscription_id (str): Azure subscription id.
        rgname (str): Azure resource group name.
        location (str): Azure data center location. E.g. westus.
        stoname (str): Azure storage account name.
        msname (str): Media service name.

    Returns:
        HTTP response. JSON body.