-
Notifications
You must be signed in to change notification settings - Fork 32
add Azure Monitor service doc #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+315
−11
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
382b5da
add Azure Monitor service doc
HarshCasper 62924ae
Update src/content/docs/azure/services/monitor.mdx
HarshCasper b0d0e23
Update src/content/docs/azure/services/monitor.mdx
HarshCasper 98f5889
Update src/content/docs/azure/services/monitor.mdx
HarshCasper b970369
Update src/content/docs/azure/services/monitor.mdx
HarshCasper 9f22781
Update src/content/docs/azure/services/monitor.mdx
HarshCasper fbdbfca
Update src/content/docs/azure/services/monitor.mdx
HarshCasper 2d79cf6
Update src/content/docs/azure/services/monitor.mdx
HarshCasper c088c5d
Update src/content/docs/azure/services/monitor.mdx
HarshCasper 103e70b
Update src/content/docs/azure/services/monitor.mdx
HarshCasper 99ec395
Update src/content/docs/azure/services/monitor.mdx
HarshCasper d7ef57c
Apply suggestions from code review
HarshCasper be17203
final fixes
HarshCasper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,220 @@ | ||
| --- | ||
| title: "Monitor" | ||
| description: Get started with Azure Monitor on LocalStack | ||
| template: doc | ||
| --- | ||
|
|
||
| import AzureFeatureCoverage from "../../../../components/feature-coverage/AzureFeatureCoverage"; | ||
|
|
||
| ## Introduction | ||
|
|
||
| Azure Monitor is a platform service for collecting, analyzing, and acting on telemetry from Azure resources and applications. | ||
| It helps you inspect activity logs and configure diagnostic settings for operational visibility. | ||
| These capabilities are useful for troubleshooting, auditing, and observability workflows. | ||
|
|
||
| LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Monitor. | ||
| The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of Monitor's integration with LocalStack. | ||
|
|
||
| ## Getting started | ||
|
|
||
| This guide is designed for users new to Azure Monitor and assumes basic knowledge of the Azure CLI and our `azlocal` wrapper script. | ||
|
|
||
| Start your LocalStack container using your preferred method. For more information, see [Introduction to LocalStack for Azure](/azure/getting-started/). | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| :::note | ||
| As an alternative to using the `azlocal` CLI, users can run: | ||
|
|
||
| `azlocal start-interception` | ||
|
|
||
| This command points the `az` CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API. | ||
| To revert this configuration, run: | ||
|
|
||
| `azlocal stop-interception` | ||
|
|
||
| This reconfigures the `az` CLI to send commands to the official Azure management REST API. At this time, there is no full parity between `azlocal` and `az` commands after running `az start-interception`. Therefore, this technique is not fully interchangeable. | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: | ||
|
|
||
| ### Create a resource group | ||
|
|
||
| Create a resource group to contain your Monitor demo resources: | ||
|
|
||
| ```bash | ||
| azlocal group create \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
| --location westeurope | ||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| { | ||
| "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor-demo", | ||
| "location": "westeurope", | ||
| "managedBy": null, | ||
| "name": "rg-monitor-demo", | ||
| "properties": { | ||
| "provisioningState": "Succeeded" | ||
| }, | ||
| "tags": null, | ||
| "type": "Microsoft.Resources/resourceGroups" | ||
| } | ||
| ``` | ||
|
|
||
| ### Create a storage account | ||
|
|
||
| Create a storage account to use as a diagnostic settings destination: | ||
|
|
||
| ```bash | ||
| azlocal storage account create \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name stmonitordoc79 \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --resource-group rg-monitor-demo \ | ||
| --location westeurope \ | ||
| --sku Standard_LRS | ||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| { | ||
| ... | ||
| "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor-demo/providers/Microsoft.Storage/storageAccounts/stmonitordoc79", | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ... | ||
| "name": "stmonitordoc79", | ||
| ... | ||
| "primaryEndpoints": { | ||
| "blob": "https://stmonitordoc79blob.localhost.localstack.cloud:4566", | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ... | ||
| "table": "https://stmonitordoc79table.localhost.localstack.cloud:4566", | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ... | ||
| }, | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| ### List activity logs | ||
|
|
||
| List recent activity logs from the subscription: | ||
|
|
||
| ```bash | ||
| azlocal monitor activity-log list --max-events 5 | ||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| [ | ||
| { | ||
| "caller": "00000000-0000-0000-0000-000000000000", | ||
| "category": { | ||
| "value": "Administrative", | ||
| ... | ||
| }, | ||
| "eventName": { | ||
| "value": "EndRequest", | ||
| ... | ||
| }, | ||
| "eventTimestamp": "2026-03-17T07:34:43.230050", | ||
| "resourceGroupName": "rg-monitor-demo", | ||
| "resourceProviderName": { | ||
| "value": "Microsoft.Resources", | ||
| ... | ||
| }, | ||
| ... | ||
| }, | ||
| ... | ||
| ] | ||
| ``` | ||
|
|
||
| ### Create and inspect diagnostic settings | ||
|
|
||
| Get the resource group resource ID: | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| RESOURCE_ID=$(azlocal group show \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --query id \ | ||
| --output tsv) | ||
| ``` | ||
|
|
||
| Create diagnostic settings for the resource group: | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| azlocal monitor diagnostic-settings create \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
| --resource "$RESOURCE_ID" \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --storage-account stmonitordoc79 \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --logs '[{"category":"Administrative","enabled":true}]' | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor-demo/providers/microsoft.insights/diagnosticSettings/rg-monitor-demo", | ||
| "name": "rg-monitor-demo", | ||
| "logs": [ | ||
| { | ||
| "category": "Administrative", | ||
| "enabled": true | ||
| } | ||
| ], | ||
| "metrics": [], | ||
| "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor-demo/providers/microsoft.Storage/storageAccounts/stmonitordoc79", | ||
| "type": "microsoft.insights/diagnosticSettings" | ||
| } | ||
| ``` | ||
|
|
||
| Get the diagnostic setting: | ||
|
|
||
| ```bash | ||
| azlocal monitor diagnostic-settings show \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
| --resource "$RESOURCE_ID" | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor-demo/providers/microsoft.insights/diagnosticSettings/rg-monitor-demo", | ||
| "name": "rg-monitor-demo", | ||
| "logs": [ | ||
| { | ||
| "category": "Administrative", | ||
| "enabled": true | ||
| } | ||
| ], | ||
| "metrics": [], | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| ### Update and delete diagnostic settings | ||
|
|
||
| Update diagnostic settings to include an additional category: | ||
|
|
||
| ```bash | ||
| azlocal monitor diagnostic-settings update \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
| --resource "$RESOURCE_ID" \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --logs '[{"category":"Administrative","enabled":true},{"category":"Security","enabled":false}]' | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ```bash title="Output" | ||
| { | ||
| "name": "rg-monitor-demo", | ||
| "logs": [ | ||
| { | ||
| "category": "Administrative", | ||
| "enabled": true | ||
| }, | ||
| { | ||
| "category": "Security", | ||
| "enabled": false | ||
| } | ||
| ], | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| Delete the diagnostic setting: | ||
|
|
||
| ```bash | ||
| azlocal monitor diagnostic-settings delete \ | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --name rg-monitor-demo \ | ||
| --resource "$RESOURCE_ID" | ||
HarshCasper marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## API Coverage | ||
|
|
||
| <AzureFeatureCoverage service="Microsoft.Insights" client:load /> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.