Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ example-test:
# Run the sync-reference-doc tool to transform examples into the reference docs structure
# Usage:
# make sync-reference-doc
# make sync-reference-doc INDIR=examples OUTDIR=../bicep-refdocs-generator/settings/remarks RESOURCETYPES=tools/generator-example-doc/resource_types.json
# make sync-reference-doc INDIR=examples OUTDIR=../template-reference-generator/settings/remarks RESOURCETYPES=tools/generator-example-doc/resource_types.json
INDIR ?= examples
OUTDIR ?= ../bicep-refdocs-generator/settings/remarks
OUTDIR ?= ../template-reference-generator/settings/remarks
RESOURCETYPES ?= tools/generator-example-doc/resource_types.json

sync-reference-doc:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
subcategory: "microsoft.alertsManagement - Azure Monitor"
subcategory: "Microsoft.AlertsManagement - Azure Monitor"
page_title: "smartDetectorAlertRules"
description: |-
Manages a Monitor Smart Detector Alert Rule.
---

# microsoft.alertsManagement/smartDetectorAlertRules - Monitor Smart Detector Alert Rule
# Microsoft.AlertsManagement/smartDetectorAlertRules - Monitor Smart Detector Alert Rule

This article demonstrates how to use `azapi` provider to manage the Monitor Smart Detector Alert Rule resource in Azure.

Expand Down Expand Up @@ -140,23 +140,23 @@ resource "azapi_resource" "smartDetectorAlertRule" {

The following arguments are supported:

* `type` - (Required) The type of the resource. This should be set to `microsoft.alertsManagement/smartDetectorAlertRules@api-version`. The available api-versions for this resource are: [`2019-03-01`, `2019-06-01`, `2021-04-01`].
* `type` - (Required) The type of the resource. This should be set to `Microsoft.AlertsManagement/smartDetectorAlertRules@api-version`. The available api-versions for this resource are: [`2019-03-01`, `2019-06-01`, `2021-04-01`].

* `parent_id` - (Required) The ID of the azure resource in which this resource is created. The allowed values are:
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}`

* `name` - (Required) Specifies the name of the azure resource. Changing this forces a new resource to be created.

* `body` - (Required) Specifies the configuration of the resource. More information about the arguments in `body` can be found in the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/templates/microsoft.alertsManagement/smartDetectorAlertRules?pivots=deployment-language-terraform).
* `body` - (Required) Specifies the configuration of the resource. More information about the arguments in `body` can be found in the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/templates/Microsoft.AlertsManagement/smartDetectorAlertRules?pivots=deployment-language-terraform).

For other arguments, please refer to the [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) documentation.

## Import

```shell
# Azure resource can be imported using the resource id, e.g.
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{resourceName}
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/{resourceName}

# It also supports specifying API version by using the resource id with api-version as a query parameter, e.g.
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{resourceName}?api-version=2021-04-01
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/{resourceName}?api-version=2021-04-01
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
subcategory: "microsoft.insights - Azure Monitor"
subcategory: "Microsoft.Insights - Azure Monitor"
page_title: "components/analyticsItems"
description: |-
Manages a Application Insights Analytics Item component.
---

# microsoft.insights/components/analyticsItems - Application Insights Analytics Item component
# Microsoft.Insights/components/analyticsItems - Application Insights Analytics Item component

This article demonstrates how to use `azapi` provider to manage the Application Insights Analytics Item component resource in Azure.

Expand Down Expand Up @@ -91,23 +91,23 @@ resource "azapi_resource_action" "analyticsItem" {

The following arguments are supported:

* `type` - (Required) The type of the resource. This should be set to `microsoft.insights/components/analyticsItems@api-version`. The available api-versions for this resource are: [`2015-05-01`].
* `type` - (Required) The type of the resource. This should be set to `Microsoft.Insights/components/analyticsItems@api-version`. The available api-versions for this resource are: [`2015-05-01`].

* `parent_id` - (Required) The ID of the azure resource in which this resource is created. The allowed values are:
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}`
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}`

* `name` - (Required) Specifies the name of the azure resource. Changing this forces a new resource to be created.

* `body` - (Required) Specifies the configuration of the resource. More information about the arguments in `body` can be found in the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/components/analyticsItems?pivots=deployment-language-terraform).
* `body` - (Required) Specifies the configuration of the resource. More information about the arguments in `body` can be found in the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/components/analyticsItems?pivots=deployment-language-terraform).

For other arguments, please refer to the [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) documentation.

## Import

```shell
# Azure resource can be imported using the resource id, e.g.
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/analyticsItems/{resourceName}
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/analyticsItems/{resourceName}

# It also supports specifying API version by using the resource id with api-version as a query parameter, e.g.
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/analyticsItems/{resourceName}?api-version=2015-05-01
terraform import azapi_resource.example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/analyticsItems/{resourceName}?api-version=2015-05-01
```
8 changes: 4 additions & 4 deletions tools/sync-reference-doc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import (
// and generates/updates a remarks.json file per namespace next to the samples folder.

// Default CLI values are determined dynamically based on where the tool is executed from.
// - If run from repo root: inDir = "examples", outDir = "../bicep-refdocs-generator/settings/remarks"
// - If run from tools/sync-reference-doc: inDir = "../../examples", outDir = "../../../bicep-refdocs-generator/settings/remarks"
// - If run from repo root: inDir = "examples", outDir = "../template-reference-generator/settings/remarks"
// - If run from tools/sync-reference-doc: inDir = "../../examples", outDir = "../../../template-reference-generator/settings/remarks"

type sampleInfo struct {
Namespace string // e.g. Microsoft.AlertsManagement
Expand Down Expand Up @@ -89,11 +89,11 @@ func main() {
switch filepath.Base(wd) {
case "sync-reference-doc":
defIn = filepath.Join(wd, "..", "..", "examples")
defOut = filepath.Join(wd, "..", "..", "..", "bicep-refdocs-generator", "settings", "remarks")
defOut = filepath.Join(wd, "..", "..", "..", "template-reference-generator", "settings", "remarks")
resourceTypeJsonFile = filepath.Join(wd, "..", "generator-example-doc", "resource_types.json")
case "terraform-provider-azapi":
defIn = filepath.Join(wd, "examples")
defOut = filepath.Join(wd, "..", "bicep-refdocs-generator", "settings", "remarks")
defOut = filepath.Join(wd, "..", "template-reference-generator", "settings", "remarks")
resourceTypeJsonFile = filepath.Join(wd, "tools", "generator-example-doc", "resource_types.json")
default:
}
Expand Down
Loading