def METHOD_NAME():
    # [START create_datasource_credential]
    from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient
    from azure.ai.metricsadvisor.models import DatasourceSqlConnectionString
    service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT")
    subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY")
    api_key = os.getenv("METRICS_ADVISOR_API_KEY")
    connection_string = os.getenv("SQL_SERVER_CONNECTION_STRING")
    client = MetricsAdvisorAdministrationClient(service_endpoint,
                                  MetricsAdvisorKeyCredential(subscription_key, api_key))
    credential = client.create_datasource_credential(
        datasource_credential=DatasourceSqlConnectionString(
            name="sql datasource credential",
            connection_string=connection_string,
            description="my datasource credential",
        )
    )
    return credential
    # [END create_datasource_credential]