[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EK81MJ51D0GAZ8YM0TDPRM":3,"skill-same:01M7EK81MJ51D0GAZ8YM0TDPRM":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EK81MJ51D0GAZ8YM0TDPRM","azure-monitor-query-py",null,"Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fcloud\u002Fazure-monitor-query-py\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: azure-monitor-query-py\ndescription: Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.\nrisk: critical\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure Monitor Query SDK for Python\n\nQuery logs and metrics from Azure Monitor and Log Analytics workspaces.\n\n## Installation\n\n```bash\npip install azure-monitor-query\n```\n\n## Environment Variables\n\n```bash\n# Log Analytics\nAZURE_LOG_ANALYTICS_WORKSPACE_ID=\u003Cworkspace-id>\n\n# Metrics\nAZURE_METRICS_RESOURCE_URI=\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002F\u003Cprovider>\u002F\u003Ctype>\u002F\u003Cname>\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\n\ncredential = DefaultAzureCredential()\n```\n\n## Logs Query Client\n\n### Basic Query\n\n```python\nfrom azure.monitor.query import LogsQueryClient\nfrom datetime import timedelta\n\nclient = LogsQueryClient(credential)\n\nquery = \"\"\"\nAppRequests\n| where TimeGenerated > ago(1h)\n| summarize count() by bin(TimeGenerated, 5m), ResultCode\n| order by TimeGenerated desc\n\"\"\"\n\nresponse = client.query_workspace(\n    workspace_id=os.environ[\"AZURE_LOG_ANALYTICS_WORKSPACE_ID\"],\n    query=query,\n    timespan=timedelta(hours=1)\n)\n\nfor table in response.tables:\n    for row in table.rows:\n        print(row)\n```\n\n### Query with Time Range\n\n```python\nfrom datetime import datetime, timezone\n\nresponse = client.query_workspace(\n    workspace_id=workspace_id,\n    query=\"AppRequests | take 10\",\n    timespan=(\n        datetime(2024, 1, 1, tzinfo=timezone.utc),\n        datetime(2024, 1, 2, tzinfo=timezone.utc)\n    )\n)\n```\n\n### Convert to DataFrame\n\n```python\nimport pandas as pd\n\nresponse = client.query_workspace(workspace_id, query, timespan=timedelta(hours=1))\n\nif response.tables:\n    table = response.tables[0]\n    df = pd.DataFrame(data=table.rows, columns=[col.name for col in table.columns])\n    print(df.head())\n```\n\n### Batch Query\n\n```python\nfrom azure.monitor.query import LogsBatchQuery\n\nqueries = [\n    LogsBatchQuery(workspace_id=workspace_id, query=\"AppRequests | take 5\", timespan=timedelta(hours=1)),\n    LogsBatchQuery(workspace_id=workspace_id, query=\"AppExceptions | take 5\", timespan=timedelta(hours=1))\n]\n\nresponses = client.query_batch(queries)\n\nfor response in responses:\n    if response.tables:\n        print(f\"Rows: {len(response.tables[0].rows)}\")\n```\n\n### Handle Partial Results\n\n```python\nfrom azure.monitor.query import LogsQueryStatus\n\nresponse = client.query_workspace(workspace_id, query, timespan=timedelta(hours=24))\n\nif response.status == LogsQueryStatus.PARTIAL:\n    print(f\"Partial results: {response.partial_error}\")\nelif response.status == LogsQueryStatus.FAILURE:\n    print(f\"Query failed: {response.partial_error}\")\n```\n\n## Metrics Query Client\n\n### Query Resource Metrics\n\n```python\nfrom azure.monitor.query import MetricsQueryClient\nfrom datetime import timedelta\n\nmetrics_client = MetricsQueryClient(credential)\n\nresponse = metrics_client.query_resource(\n    resource_uri=os.environ[\"AZURE_METRICS_RESOURCE_URI\"],\n    metric_names=[\"Percentage CPU\", \"Network In Total\"],\n    timespan=timedelta(hours=1),\n    granularity=timedelta(minutes=5)\n)\n\nfor metric in response.metrics:\n    print(f\"{metric.name}:\")\n    for time_series in metric.timeseries:\n        for data in time_series.data:\n            print(f\"  {data.timestamp}: {data.average}\")\n```\n\n### Aggregations\n\n```python\nfrom azure.monitor.query import MetricAggregationType\n\nresponse = metrics_client.query_resource(\n    resource_uri=resource_uri,\n    metric_names=[\"Requests\"],\n    timespan=timedelta(hours=1),\n    aggregations=[\n        MetricAggregationType.AVERAGE,\n        MetricAggregationType.MAXIMUM,\n        MetricAggregationType.MINIMUM,\n        MetricAggregationType.COUNT\n    ]\n)\n```\n\n### Filter by Dimension\n\n```python\nresponse = metrics_client.query_resource(\n    resource_uri=resource_uri,\n    metric_names=[\"Requests\"],\n    timespan=timedelta(hours=1),\n    filter=\"ApiName eq 'GetBlob'\"\n)\n```\n\n### List Metric Definitions\n\n```python\ndefinitions = metrics_client.list_metric_definitions(resource_uri)\nfor definition in definitions:\n    print(f\"{definition.name}: {definition.unit}\")\n```\n\n### List Metric Namespaces\n\n```python\nnamespaces = metrics_client.list_metric_namespaces(resource_uri)\nfor ns in namespaces:\n    print(ns.fully_qualified_namespace)\n```\n\n## Async Clients\n\n```python\nfrom azure.monitor.query.aio import LogsQueryClient, MetricsQueryClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def query_logs():\n    credential = DefaultAzureCredential()\n    client = LogsQueryClient(credential)\n    \n    response = await client.query_workspace(\n        workspace_id=workspace_id,\n        query=\"AppRequests | take 10\",\n        timespan=timedelta(hours=1)\n    )\n    \n    await client.close()\n    await credential.close()\n    return response\n```\n\n## Common Kusto Queries\n\n```kusto\n\u002F\u002F Requests by status code\nAppRequests\n| summarize count() by ResultCode\n| order by count_ desc\n\n\u002F\u002F Exceptions over time\nAppExceptions\n| summarize count() by bin(TimeGenerated, 1h)\n\n\u002F\u002F Slow requests\nAppRequests\n| where DurationMs > 1000\n| project TimeGenerated, Name, DurationMs\n| order by DurationMs desc\n\n\u002F\u002F Top errors\nAppExceptions\n| summarize count() by ExceptionType\n| top 10 by count_\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `LogsQueryClient` | Query Log Analytics workspaces |\n| `MetricsQueryClient` | Query Azure Monitor metrics |\n\n## Best Practices\n\n1. **Use timedelta** for relative time ranges\n2. **Handle partial results** for large queries\n3. **Use batch queries** when running multiple queries\n4. **Set appropriate granularity** for metrics to reduce data points\n5. **Convert to DataFrame** for easier data analysis\n6. **Use aggregations** to summarize metric data\n7. **Filter by dimensions** to narrow metric results\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","# Azure Monitor Query SDK for Python\n\nQuery logs and metrics from Azure Monitor and Log Analytics workspaces.\n\n## Installation\n\n```bash\npip install azure-monitor-query\n```\n\n## Environment Variables\n\n```bash\n# Log Analytics\nAZURE_LOG_ANALYTICS_WORKSPACE_ID=\u003Cworkspace-id>\n\n# Metrics\nAZURE_METRICS_RESOURCE_URI=\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002F\u003Cprovider>\u002F\u003Ctype>\u002F\u003Cname>\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\n\ncredential = DefaultAzureCredential()\n```\n\n## Logs Query Client\n\n### Basic Query\n\n```python\nfrom azure.monitor.query import LogsQueryClient\nfrom datetime import timedelta\n\nclient = LogsQueryClient(credential)\n\nquery = \"\"\"\nAppRequests\n| where TimeGenerated > ago(1h)\n| summarize count() by bin(TimeGenerated, 5m), ResultCode\n| order by TimeGenerated desc\n\"\"\"\n\nresponse = client.query_workspace(\n    workspace_id=os.environ[\"AZURE_LOG_ANALYTICS_WORKSPACE_ID\"],\n    query=query,\n    timespan=timedelta(hours=1)\n)\n\nfor table in response.tables:\n    for row in table.rows:\n        print(row)\n```\n\n### Query with Time Range\n\n```python\nfrom datetime import datetime, timezone\n\nresponse = client.query_workspace(\n    workspace_id=workspace_id,\n    query=\"AppRequests | take 10\",\n    timespan=(\n        datetime(2024, 1, 1, tzinfo=timezone.utc),\n        datetime(2024, 1, 2, tzinfo=timezone.utc)\n    )\n)\n```\n\n### Convert to DataFrame\n\n```python\nimport pandas as pd\n\nresponse = client.query_workspace(workspace_id, query, timespan=timedelta(hours=1))\n\nif response.tables:\n    table = response.tables[0]\n    df = pd.DataFrame(data=table.rows, columns=[col.name for col in table.columns])\n    print(df.head())\n```\n\n### Batch Query\n\n```python\nfrom azure.monitor.query import LogsBatchQuery\n\nqueries = [\n    LogsBatchQuery(workspace_id=workspace_id, query=\"AppRequests | take 5\", timespan=timedelta(hours=1)),\n    LogsBatchQuery(workspace_id=workspace_id, query=\"AppExceptions | take 5\", timespan=timedelta(hours=1))\n]\n\nresponses = client.query_batch(queries)\n\nfor response in responses:\n    if response.tables:\n        print(f\"Rows: {len(response.tables[0].rows)}\")\n```\n\n### Handle Partial Results\n\n```python\nfrom azure.monitor.query import LogsQueryStatus\n\nresponse = client.query_workspace(workspace_id, query, timespan=timedelta(hours=24))\n\nif response.status == LogsQueryStatus.PARTIAL:\n    print(f\"Partial results: {response.partial_error}\")\nelif response.status == LogsQueryStatus.FAILURE:\n    print(f\"Query failed: {response.partial_error}\")\n```\n\n## Metrics Query Client\n\n### Query Resource Metrics\n\n```python\nfrom azure.monitor.query import MetricsQueryClient\nfrom datetime import timedelta\n\nmetrics_client = MetricsQueryClient(credential)\n\nresponse = metrics_client.query_resource(\n    resource_uri=os.environ[\"AZURE_METRICS_RESOURCE_URI\"],\n    metric_names=[\"Percentage CPU\", \"Network In Total\"],\n    timespan=timedelta(hours=1),\n    granularity=timedelta(minutes=5)\n)\n\nfor metric in response.metrics:\n    print(f\"{metric.name}:\")\n    for time_series in metric.timeseries:\n        for data in time_series.data:\n            print(f\"  {data.timestamp}: {data.average}\")\n```\n\n### Aggregations\n\n```python\nfrom azure.monitor.query import MetricAggregationType\n\nresponse = metrics_client.query_resource(\n    resource_uri=resource_uri,\n    metric_names=[\"Requests\"],\n    timespan=timedelta(hours=1),\n    aggregations=[\n        MetricAggregationType.AVERAGE,\n        MetricAggregationType.MAXIMUM,\n        MetricAggregationType.MINIMUM,\n        MetricAggregationType.COUNT\n    ]\n)\n```\n\n### Filter by Dimension\n\n```python\nresponse = metrics_client.query_resource(\n    resource_uri=resource_uri,\n    metric_names=[\"Requests\"],\n    timespan=timedelta(hours=1),\n    filter=\"ApiName eq 'GetBlob'\"\n)\n```\n\n### List Metric Definitions\n\n```python\ndefinitions = metrics_client.list_metric_definitions(resource_uri)\nfor definition in definitions:\n    print(f\"{definition.name}: {definition.unit}\")\n```\n\n### List Metric Namespaces\n\n```python\nnamespaces = metrics_client.list_metric_namespaces(resource_uri)\nfor ns in namespaces:\n    print(ns.fully_qualified_namespace)\n```\n\n## Async Clients\n\n```python\nfrom azure.monitor.query.aio import LogsQueryClient, MetricsQueryClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def query_logs():\n    credential = DefaultAzureCredential()\n    client = LogsQueryClient(credential)\n    \n    response = await client.query_workspace(\n        workspace_id=workspace_id,\n        query=\"AppRequests | take 10\",\n        timespan=timedelta(hours=1)\n    )\n    \n    await client.close()\n    await credential.close()\n    return response\n```\n\n## Common Kusto Queries\n\n```kusto\n\u002F\u002F Requests by status code\nAppRequests\n| summarize count() by ResultCode\n| order by count_ desc\n\n\u002F\u002F Exceptions over time\nAppExceptions\n| summarize count() by bin(TimeGenerated, 1h)\n\n\u002F\u002F Slow requests\nAppRequests\n| where DurationMs > 1000\n| project TimeGenerated, Name, DurationMs\n| order by DurationMs desc\n\n\u002F\u002F Top errors\nAppExceptions\n| summarize count() by ExceptionType\n| top 10 by count_\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `LogsQueryClient` | Query Log Analytics workspaces |\n| `MetricsQueryClient` | Query Azure Monitor metrics |\n\n## Best Practices\n\n1. **Use timedelta** for relative time ranges\n2. **Handle partial results** for large queries\n3. **Use batch queries** when running multiple queries\n4. **Set appropriate granularity** for metrics to reduce data points\n5. **Convert to DataFrame** for easier data analysis\n6. **Use aggregations** to summarize metric data\n7. **Filter by dimensions** to narrow metric results\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n",{"name":5,"risk":24,"source":25,"date_added":26,"description":7},"critical","community","2026-02-27","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fcloud\u002Fazure-monitor-query-py","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill azure-monitor-query-py",{"tool":39,"command":40},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill azure-monitor-query-py",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill azure-monitor-query-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fcloud\u002Fazure-monitor-query-py\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]