From 387a01a3c6461659b3f9fd5b0cbacc76709a1ec6 Mon Sep 17 00:00:00 2001 From: Paul Van Eck Date: Fri, 17 Mar 2023 02:23:17 -0700 Subject: [PATCH] Move sample to notebooks directory Signed-off-by: Paul Van Eck --- sdk/monitor/azure-monitor-query/samples/README.md | 2 +- .../samples/{ => notebooks}/sample_large_query.ipynb | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) rename sdk/monitor/azure-monitor-query/samples/{ => notebooks}/sample_large_query.ipynb (97%) diff --git a/sdk/monitor/azure-monitor-query/samples/README.md b/sdk/monitor/azure-monitor-query/samples/README.md index ef6bee9a2f10b..7256329759ecf 100644 --- a/sdk/monitor/azure-monitor-query/samples/README.md +++ b/sdk/monitor/azure-monitor-query/samples/README.md @@ -25,7 +25,7 @@ The following code samples show common scenarios with the Azure Monitor Query cl #### Notebook samples -- [Split a large query into multiple smaller queries to avoid hitting service limits](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_large_query.ipynb) +- [Split a large query into multiple smaller queries to avoid hitting service limits](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/notebooks/sample_large_query.ipynb) ### Metrics query samples diff --git a/sdk/monitor/azure-monitor-query/samples/sample_large_query.ipynb b/sdk/monitor/azure-monitor-query/samples/notebooks/sample_large_query.ipynb similarity index 97% rename from sdk/monitor/azure-monitor-query/samples/sample_large_query.ipynb rename to sdk/monitor/azure-monitor-query/samples/notebooks/sample_large_query.ipynb index a90b87f7d35ec..4ca58161d4ac3 100644 --- a/sdk/monitor/azure-monitor-query/samples/sample_large_query.ipynb +++ b/sdk/monitor/azure-monitor-query/samples/notebooks/sample_large_query.ipynb @@ -69,7 +69,7 @@ "source": [ "#### Set Log Analytics workspace ID\n", "\n", - "The In some cases (e.g. when using a Sentinel notebook), a `config.json` file will have been setup for you which contains the ID of your Log Analytic workspace. If not, you will need to set the `LOGS_WORKSPACE_ID` variable below." + "Set the `LOGS_WORKSPACE_ID` variable below to the ID of your Log Analytics workspace." ] }, { @@ -78,14 +78,7 @@ "metadata": {}, "outputs": [], "source": [ - "import json \n", - "\n", - "try:\n", - " with open(\"config.json\", \"r\") as f:\n", - " LOGS_WORKSPACE_ID = json.load(f).get(\"workspace_id\", \"\")\n", - "except FileNotFoundError:\n", - " # EDIT THIS VALUE WITH YOUR WORKSPACE ID IF YOU DON'T HAVE A config.json FILE.\n", - " LOGS_WORKSPACE_ID = \"\"" + "LOGS_WORKSPACE_ID = \"\"" ] }, {