diff --git a/quickstarts/sdk/csharp-sdk-sample.cs b/quickstarts/sdk/csharp-sdk-sample.cs index 21080c9..b5bed3c 100644 --- a/quickstarts/sdk/csharp-sdk-sample.cs +++ b/quickstarts/sdk/csharp-sdk-sample.cs @@ -31,9 +31,8 @@ class Program{ // static void Main(string[] args){ - string location = "westus2"; - string endpoint = $"https://{location}.api.cognitive.microsoft.com"; - //This sample assumes you have created an environment variable for your key, named ANOMALY_DETECTOR_KEY + //This sample assumes you have created an environment variable for your key and endpoint + string endpoint = Environment.GetEnvironmentVariable(ANOMALY_DETECTOR_ENDPOINT); string key = Environment.GetEnvironmentVariable("ANOMALY_DETECTOR_KEY"); string datapath = "request-data.csv"; diff --git a/quickstarts/sdk/python-sdk-sample.py b/quickstarts/sdk/python-sdk-sample.py index 8518394..86c8b2e 100644 --- a/quickstarts/sdk/python-sdk-sample.py +++ b/quickstarts/sdk/python-sdk-sample.py @@ -22,18 +22,17 @@ # # -# Set the COGSRV_ACCOUNT_KEY environment variable on your local machine using the -# appropriate method for your preferred shell (Bash, PowerShell, Command Prompt, etc.) +# This sample assumes you have created an environment variable for your key and endpoint SUBSCRIPTION_KEY = os.environ["ANOMALY_DETECTOR_KEY"] -ANOMALY_DETECTION_LOCATION = "westus2" +ANOMALY_DETECTOR_ENDPOINT = os.environ["ANOMALY_DETECTOR_ENDPOINT"] + TIME_SERIES_DATA_PATH = "request-data.csv" # # Create an Anomaly Detector client and add the # -base_url = "https://{}.api.cognitive.microsoft.com".format(ANOMALY_DETECTION_LOCATION) -client = AnomalyDetectorClient(base_url, CognitiveServicesCredentials(SUBSCRIPTION_KEY)) +client = AnomalyDetectorClient(ANOMALY_DETECTOR_ENDPOINT, CognitiveServicesCredentials(SUBSCRIPTION_KEY)) # # Load in the time series data file