We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Is it possible to query Log Analytics via the az cli with a saved query?

I can’t tell from the documentation, is it possible to run a saved Log Analytics Query from this CLI command?  

If not, a useful enhancement would be to enable the use a saved query in addition to the ability to execute queries in-line.  The queries get long and cumbersome to maintain outside of Log Analytics.

If it is, however, possible to run a saved query, would you mind updating the documentation here?  Thanks.


---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: f0fd6a58-ac1a-fa45-8d96-579b4af36499
* Version Independent ID: 4098ca97-1b85-eb29-18e9-e6f0495fd030
* Content: [az monitor log-analytics](https://docs.microsoft.com/en-us/cli/azure/ext/log-analytics/monitor/log-analytics?view=azure-cli-latest)
* Content Source: [latest/docs-ref-autogen/ext/log-analytics/monitor/log-analytics.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/latest/docs-ref-autogen/ext/log-analytics/monitor/log-analytics.yml)
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/log-analytics/setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 # --------------------------------------------------------------------------------------------
4 # Copyright (c) Microsoft Corporation. All rights reserved.
5 # Licensed under the MIT License. See License.txt in the project root for license information.
6 # --------------------------------------------------------------------------------------------
7 
8 from codecs import open
9 from setuptools import setup, find_packages
10 
11 VERSION = "0.2.1"
12 
13 CLASSIFIERS = [
14     'Development Status :: 4 - Beta',
15     'Intended Audience :: Developers',
16     'Intended Audience :: System Administrators',
17     'Programming Language :: Python',
18     'Programming Language :: Python :: 2',
19     'Programming Language :: Python :: 2.7',
20     'Programming Language :: Python :: 3',
21     'Programming Language :: Python :: 3.4',
22     'Programming Language :: Python :: 3.5',
23     'Programming Language :: Python :: 3.6',
24     'License :: OSI Approved :: MIT License',
25 ]
26 
27 DEPENDENCIES = []
28 
29 with open('README.rst', 'r', encoding='utf-8') as f:
30     README = f.read()
31 with open('HISTORY.rst', 'r', encoding='utf-8') as f:
32     HISTORY = f.read()
33 
34 setup(
35     name='log-analytics',
36     version=VERSION,
37     description='Support for Azure Log Analytics query capabilities.',
38     long_description=README + '\n\n' + HISTORY,
39     license='MIT',
40     author='Ace Eldeib',
41     author_email='aleldeib@microsoft.com',
42     url='https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics',
43     classifiers=CLASSIFIERS,
44     packages=find_packages(exclude=["tests"]),
45     package_data={'azext_loganalytics': ['azext_metadata.json']},
46     install_requires=DEPENDENCIES
47 )
48
```

Path: `src/log-analytics/azext_loganalytics/_help.py`
Content:
```
1 # --------------------------------------------------------------------------------------------
2 # Copyright (c) Microsoft Corporation. All rights reserved.
3 # Licensed under the MIT License. See License.txt in the project root for license information.
4 # --------------------------------------------------------------------------------------------
5 
6 from knack.help_files import helps
7 
8 # pylint: disable=line-too-long
9 
10 helps['monitor log-analytics'] = """
11     type: group
12     short-summary: Commands for querying data in Log Analytics workspaces.
13 """
14 
15 helps['monitor log-analytics query'] = """
16     type: command
17     short-summary: Query a Log Analytics workspace.
18     examples:
19       - name: Execute a simple query over past 3.5 days.
20         text: |
21           az monitor log-analytics query -w b8317023-66e4-4edc-8a5b-7c002b22f92f --analytics-query "AzureActivity | summarize count() by bin(timestamp, 1h)" -t P3DT12H
22 """
23
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/log-analytics/azext_loganalytics/_help.py b/src/log-analytics/azext_loganalytics/_help.py
--- a/src/log-analytics/azext_loganalytics/_help.py
+++ b/src/log-analytics/azext_loganalytics/_help.py
@@ -18,5 +18,9 @@
     examples:
       - name: Execute a simple query over past 3.5 days.
         text: |
-          az monitor log-analytics query -w b8317023-66e4-4edc-8a5b-7c002b22f92f --analytics-query "AzureActivity | summarize count() by bin(timestamp, 1h)" -t P3DT12H
+          az monitor log-analytics query -w workspace-customId --analytics-query "AzureActivity | summarize count() by bin(timestamp, 1h)" -t P3DT12H
+      - name: Execute a saved query in workspace
+        text: |
+          QUERY=$(az monitor log-analytics workspace saved-search show -g resource-group --workspace-name workspace-name -n query-name --query query --output tsv)
+          az monitor log-analytics query -w workspace-customId --analytics-query "$QUERY"
 """
diff --git a/src/log-analytics/setup.py b/src/log-analytics/setup.py
--- a/src/log-analytics/setup.py
+++ b/src/log-analytics/setup.py
@@ -8,7 +8,7 @@
 from codecs import open
 from setuptools import setup, find_packages
 
-VERSION = "0.2.1"
+VERSION = "0.2.2"
 
 CLASSIFIERS = [
     'Development Status :: 4 - Beta',

{"golden_diff": "diff --git a/src/log-analytics/azext_loganalytics/_help.py b/src/log-analytics/azext_loganalytics/_help.py\n--- a/src/log-analytics/azext_loganalytics/_help.py\n+++ b/src/log-analytics/azext_loganalytics/_help.py\n@@ -18,5 +18,9 @@\n     examples:\n       - name: Execute a simple query over past 3.5 days.\n         text: |\n-          az monitor log-analytics query -w b8317023-66e4-4edc-8a5b-7c002b22f92f --analytics-query \"AzureActivity | summarize count() by bin(timestamp, 1h)\" -t P3DT12H\n+          az monitor log-analytics query -w workspace-customId --analytics-query \"AzureActivity | summarize count() by bin(timestamp, 1h)\" -t P3DT12H\n+      - name: Execute a saved query in workspace\n+        text: |\n+          QUERY=$(az monitor log-analytics workspace saved-search show -g resource-group --workspace-name workspace-name -n query-name --query query --output tsv)\n+          az monitor log-analytics query -w workspace-customId --analytics-query \"$QUERY\"\n \"\"\"\ndiff --git a/src/log-analytics/setup.py b/src/log-analytics/setup.py\n--- a/src/log-analytics/setup.py\n+++ b/src/log-analytics/setup.py\n@@ -8,7 +8,7 @@\n from codecs import open\n from setuptools import setup, find_packages\n \n-VERSION = \"0.2.1\"\n+VERSION = \"0.2.2\"\n \n CLASSIFIERS = [\n     'Development Status :: 4 - Beta',\n", "issue": "Is it possible to query Log Analytics via the az cli with a saved query?\n\r\nI can\u2019t tell from the documentation, is it possible to run a saved Log Analytics Query from this CLI command?  \r\n\r\nIf not, a useful enhancement would be to enable the use a saved query in addition to the ability to execute queries in-line.  The queries get long and cumbersome to maintain outside of Log Analytics.\r\n\r\nIf it is, however, possible to run a saved query, would you mind updating the documentation here?  Thanks.\r\n\r\n\r\n---\r\n#### Document Details\r\n\r\n\u26a0 *Do not edit this section. It is required for docs.microsoft.com \u279f GitHub issue linking.*\r\n\r\n* ID: f0fd6a58-ac1a-fa45-8d96-579b4af36499\r\n* Version Independent ID: 4098ca97-1b85-eb29-18e9-e6f0495fd030\r\n* Content: [az monitor log-analytics](https://docs.microsoft.com/en-us/cli/azure/ext/log-analytics/monitor/log-analytics?view=azure-cli-latest)\r\n* Content Source: [latest/docs-ref-autogen/ext/log-analytics/monitor/log-analytics.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/latest/docs-ref-autogen/ext/log-analytics/monitor/log-analytics.yml)\r\n* GitHub Login: @rloutlaw\r\n* Microsoft Alias: **routlaw**\n", "before_files": [{"content": "#!/usr/bin/env python\n\n# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# --------------------------------------------------------------------------------------------\n\nfrom codecs import open\nfrom setuptools import setup, find_packages\n\nVERSION = \"0.2.1\"\n\nCLASSIFIERS = [\n    'Development Status :: 4 - Beta',\n    'Intended Audience :: Developers',\n    'Intended Audience :: System Administrators',\n    'Programming Language :: Python',\n    'Programming Language :: Python :: 2',\n    'Programming Language :: Python :: 2.7',\n    'Programming Language :: Python :: 3',\n    'Programming Language :: Python :: 3.4',\n    'Programming Language :: Python :: 3.5',\n    'Programming Language :: Python :: 3.6',\n    'License :: OSI Approved :: MIT License',\n]\n\nDEPENDENCIES = []\n\nwith open('README.rst', 'r', encoding='utf-8') as f:\n    README = f.read()\nwith open('HISTORY.rst', 'r', encoding='utf-8') as f:\n    HISTORY = f.read()\n\nsetup(\n    name='log-analytics',\n    version=VERSION,\n    description='Support for Azure Log Analytics query capabilities.',\n    long_description=README + '\\n\\n' + HISTORY,\n    license='MIT',\n    author='Ace Eldeib',\n    author_email='aleldeib@microsoft.com',\n    url='https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics',\n    classifiers=CLASSIFIERS,\n    packages=find_packages(exclude=[\"tests\"]),\n    package_data={'azext_loganalytics': ['azext_metadata.json']},\n    install_requires=DEPENDENCIES\n)\n", "path": "src/log-analytics/setup.py"}, {"content": "# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# --------------------------------------------------------------------------------------------\n\nfrom knack.help_files import helps\n\n# pylint: disable=line-too-long\n\nhelps['monitor log-analytics'] = \"\"\"\n    type: group\n    short-summary: Commands for querying data in Log Analytics workspaces.\n\"\"\"\n\nhelps['monitor log-analytics query'] = \"\"\"\n    type: command\n    short-summary: Query a Log Analytics workspace.\n    examples:\n      - name: Execute a simple query over past 3.5 days.\n        text: |\n          az monitor log-analytics query -w b8317023-66e4-4edc-8a5b-7c002b22f92f --analytics-query \"AzureActivity | summarize count() by bin(timestamp, 1h)\" -t P3DT12H\n\"\"\"\n", "path": "src/log-analytics/azext_loganalytics/_help.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# --------------------------------------------------------------------------------------------\n\nfrom codecs import open\nfrom setuptools import setup, find_packages\n\nVERSION = \"0.2.2\"\n\nCLASSIFIERS = [\n    'Development Status :: 4 - Beta',\n    'Intended Audience :: Developers',\n    'Intended Audience :: System Administrators',\n    'Programming Language :: Python',\n    'Programming Language :: Python :: 2',\n    'Programming Language :: Python :: 2.7',\n    'Programming Language :: Python :: 3',\n    'Programming Language :: Python :: 3.4',\n    'Programming Language :: Python :: 3.5',\n    'Programming Language :: Python :: 3.6',\n    'License :: OSI Approved :: MIT License',\n]\n\nDEPENDENCIES = []\n\nwith open('README.rst', 'r', encoding='utf-8') as f:\n    README = f.read()\nwith open('HISTORY.rst', 'r', encoding='utf-8') as f:\n    HISTORY = f.read()\n\nsetup(\n    name='log-analytics',\n    version=VERSION,\n    description='Support for Azure Log Analytics query capabilities.',\n    long_description=README + '\\n\\n' + HISTORY,\n    license='MIT',\n    author='Ace Eldeib',\n    author_email='aleldeib@microsoft.com',\n    url='https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics',\n    classifiers=CLASSIFIERS,\n    packages=find_packages(exclude=[\"tests\"]),\n    package_data={'azext_loganalytics': ['azext_metadata.json']},\n    install_requires=DEPENDENCIES\n)\n", "path": "src/log-analytics/setup.py"}, {"content": "# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# --------------------------------------------------------------------------------------------\n\nfrom knack.help_files import helps\n\n# pylint: disable=line-too-long\n\nhelps['monitor log-analytics'] = \"\"\"\n    type: group\n    short-summary: Commands for querying data in Log Analytics workspaces.\n\"\"\"\n\nhelps['monitor log-analytics query'] = \"\"\"\n    type: command\n    short-summary: Query a Log Analytics workspace.\n    examples:\n      - name: Execute a simple query over past 3.5 days.\n        text: |\n          az monitor log-analytics query -w workspace-customId --analytics-query \"AzureActivity | summarize count() by bin(timestamp, 1h)\" -t P3DT12H\n      - name: Execute a saved query in workspace\n        text: |\n          QUERY=$(az monitor log-analytics workspace saved-search show -g resource-group --workspace-name workspace-name -n query-name --query query --output tsv)\n          az monitor log-analytics query -w workspace-customId --analytics-query \"$QUERY\"\n\"\"\"\n", "path": "src/log-analytics/azext_loganalytics/_help.py"}]}