def fetch_job_schema()

in modules/azure-identity/azure-id-lifecycle/scripts/azad_sync_job_schema_modify.py [0:0]


def fetch_job_schema(service_principal_id, job_id, headers):
    job_schema_url = "https://graph.microsoft.com/v1.0/servicePrincipals/{}/synchronization/jobs/{}/schema".format(
        service_principal_id, job_id)
    try:
        get_response = requests.get(job_schema_url, headers=headers)
        get_response.raise_for_status()
    except requests.exceptions.HTTPError as e:
        print(e.args[0])
    job_schema_json = get_response.json()
    return job_schema_json