def METHOD_NAME(test):
    backup_vault = test.cmd('az dataprotection backup-vault create '
        '-g "{rg}" --vault-name "{vaultName}" -l {location} '
        '--storage-settings datastore-type="VaultStore" type="LocallyRedundant" --type SystemAssigned '
        '--soft-delete-state Off',
        checks=[
            test.exists('identity.principalId')
        ]).get_output_in_json()
    # Fix for 'Cannot find user or service principal in graph database' error. Confirming sp is created for the backup vault.
    sp_list = []
    while backup_vault['identity']['principalId'] not in sp_list:
        sp_list = test.cmd('az ad sp list --display-name "{vaultName}" --query [].id').get_output_in_json()
        time.sleep(10)
    policy_json = test.cmd('az dataprotection backup-policy get-default-policy-template --datasource-type "{dataSourceType}"').get_output_in_json()
    test.kwargs.update({"policy": policy_json})
    policy = test.cmd('az dataprotection backup-policy create -n "{policyName}" --policy "{policy}" -g "{rg}" --vault-name "{vaultName}"').get_output_in_json()
    test.kwargs.update({"policyId": policy['id']})