• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..30-Aug-2021-

CHANGELOG.mdH A D30-Aug-202140 42

README.mdH A D30-Aug-20213.2 KiB7649

_meta.jsonH A D30-Aug-2021678 1111

ci.ymlH A D30-Aug-2021343 1613

go.modH A D30-Aug-2021315 118

go.sumH A D30-Aug-20212.1 KiB2221

go_mod_tidy_hack.goH A D30-Aug-2021519 132

zz_generated_actiongroups_client.goH A D30-Aug-202120.4 KiB465391

zz_generated_activitylogalerts_client.goH A D30-Aug-202118.4 KiB407341

zz_generated_activitylogs_client.goH A D30-Aug-20213.5 KiB9471

zz_generated_alertruleincidents_client.goH A D30-Aug-20216.9 KiB167135

zz_generated_alertrules_client.goH A D30-Aug-202117.5 KiB407341

zz_generated_autoscalesettings_client.goH A D30-Aug-202118.7 KiB407341

zz_generated_baselines_client.goH A D30-Aug-20214 KiB11289

zz_generated_constants.goH A D30-Aug-202144 KiB1,195866

zz_generated_datacollectionendpoints_client.goH A D30-Aug-202119.4 KiB413347

zz_generated_datacollectionruleassociations_client.goH A D30-Aug-202115.8 KiB336279

zz_generated_datacollectionrules_client.goH A D30-Aug-202118.8 KiB413347

zz_generated_diagnosticsettings_client.goH A D30-Aug-202110.9 KiB266218

zz_generated_diagnosticsettingscategory_client.goH A D30-Aug-20216.3 KiB151119

zz_generated_eventcategories_client.goH A D30-Aug-20213.1 KiB8359

zz_generated_logprofiles_client.goH A D30-Aug-202113 KiB325268

zz_generated_metricalerts_client.goH A D30-Aug-202117.6 KiB407341

zz_generated_metricalertsstatus_client.goH A D30-Aug-20217.2 KiB168136

zz_generated_metricdefinitions_client.goH A D30-Aug-20213.4 KiB9168

zz_generated_metricnamespaces_client.goH A D30-Aug-20213.4 KiB9168

zz_generated_metrics_client.goH A D30-Aug-20213.9 KiB11693

zz_generated_models.goH A D30-Aug-2021216.5 KiB5,5563,284

zz_generated_operations_client.goH A D30-Aug-20212.8 KiB8158

zz_generated_pagers.goH A D30-Aug-202122.1 KiB699510

zz_generated_pollers.goH A D30-Aug-20214.7 KiB14098

zz_generated_polymorphic_helpers.goH A D30-Aug-20217.4 KiB249228

zz_generated_privateendpointconnections_client.goH A D30-Aug-202117.6 KiB381323

zz_generated_privatelinkresources_client.goH A D30-Aug-20217.4 KiB165133

zz_generated_privatelinkscopedresources_client.goH A D30-Aug-202116.5 KiB381323

zz_generated_privatelinkscopeoperationstatus_client.goH A D30-Aug-20214.1 KiB9673

zz_generated_privatelinkscopes_client.goH A D30-Aug-202119.8 KiB449376

zz_generated_response_types.goH A D30-Aug-202117.6 KiB450197

zz_generated_scheduledqueryrules_client.goH A D30-Aug-202118.2 KiB413347

zz_generated_tenantactivitylogs_client.goH A D30-Aug-20213.6 KiB9165

zz_generated_time_rfc3339.goH A D30-Aug-20211.4 KiB5840

zz_generated_vminsights_client.goH A D30-Aug-20213.5 KiB8865

README.md

1# Azure Monitor Module for Go
2
3[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/monitor/armmonitor)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/monitor/armmonitor)
4
5The `armmonitor` module provides operations for working with Azure Monitor.
6
7[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/monitor/armmonitor)
8
9# Getting started
10
11## Prerequisites
12
13- an [Azure subscription](https://azure.microsoft.com/free/)
14- Go 1.13 or above
15
16## Install the package
17
18This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
19
20Install the Azure Monitor module:
21
22```sh
23go get github.com/Azure/azure-sdk-for-go/sdk/monitor/armmonitor
24```
25
26## Authorization
27
28When creating a client, you will need to provide a credential for authenticating with Azure Monitor.  The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
29
30```go
31cred, err := azidentity.NewDefaultAzureCredential(nil)
32```
33
34For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
35
36## Connecting to Azure Monitor
37
38Once you have a credential, create a connection to the desired ARM endpoint.  The `armcore` module provides facilities for connecting with ARM endpoints including public and sovereign clouds as well as Azure Stack.
39
40```go
41con := armcore.NewDefaultConnection(cred, nil)
42```
43
44For more information on ARM connections, please see the documentation for `armcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore).
45
46## Clients
47
48Azure Monitor modules consist of one or more clients.  A client groups a set of related APIs, providing access to its functionality within the specified subscription.  Create one or more clients to access the APIs you require using your `armcore.Connection`.
49
50```go
51client := armmonitor.NewAlertRulesClient(con, "<subscription ID>")
52```
53
54## Provide Feedback
55
56If you encounter bugs or have suggestions, please
57[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Monitor` label.
58
59# Contributing
60
61This project welcomes contributions and suggestions. Most contributions require
62you to agree to a Contributor License Agreement (CLA) declaring that you have
63the right to, and actually do, grant us the rights to use your contribution.
64For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
65
66When you submit a pull request, a CLA-bot will automatically determine whether
67you need to provide a CLA and decorate the PR appropriately (e.g., label,
68comment). Simply follow the instructions provided by the bot. You will only
69need to do this once across all repos using our CLA.
70
71This project has adopted the
72[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
73For more information, see the
74[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
75or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
76additional questions or comments.