Skip to content

Commit

Permalink
feat: Add new params to avm/res/insights/component (#4388)
Browse files Browse the repository at this point in the history
## Description

Add new parameters to the `avm/res/insights/component` module to support
the `Flow_Type` and `Request_Source` properties.

Resolves #4383 

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.insights.component](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.insights.component.yml/badge.svg?branch=users%2Fkrbar%2FappInsightsParams)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.insights.component.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [x] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
krbar authored Feb 6, 2025
1 parent 0c33ee9 commit 3f90989
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 8 deletions.
26 changes: 26 additions & 0 deletions avm/res/insights/component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ module component 'br/public:avm/res/insights/component:<version>' = {
]
disableIpMasking: false
disableLocalAuth: true
flowType: 'Redfield'
forceCustomerStorageForProfiler: true
linkedStorageAccountResourceId: '<linkedStorageAccountResourceId>'
location: '<location>'
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
requestSource: 'Azure'
roleAssignments: [
{
name: '8aacced3-3fce-41bc-a416-959df1acec57'
Expand Down Expand Up @@ -212,6 +214,9 @@ module component 'br/public:avm/res/insights/component:<version>' = {
"disableLocalAuth": {
"value": true
},
"flowType": {
"value": "Redfield"
},
"forceCustomerStorageForProfiler": {
"value": true
},
Expand All @@ -227,6 +232,9 @@ module component 'br/public:avm/res/insights/component:<version>' = {
"name": "myCustomLockName"
}
},
"requestSource": {
"value": "Azure"
},
"roleAssignments": {
"value": [
{
Expand Down Expand Up @@ -289,13 +297,15 @@ param diagnosticSettings = [
]
param disableIpMasking = false
param disableLocalAuth = true
param flowType = 'Redfield'
param forceCustomerStorageForProfiler = true
param linkedStorageAccountResourceId = '<linkedStorageAccountResourceId>'
param location = '<location>'
param lock = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
param requestSource = 'Azure'
param roleAssignments = [
{
name: '8aacced3-3fce-41bc-a416-959df1acec57'
Expand Down Expand Up @@ -473,13 +483,15 @@ param tags = {
| [`disableIpMasking`](#parameter-disableipmasking) | bool | Disable IP masking. Default value is set to true. |
| [`disableLocalAuth`](#parameter-disablelocalauth) | bool | Disable Non-AAD based Auth. Default value is set to false. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`flowType`](#parameter-flowtype) | string | Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. |
| [`forceCustomerStorageForProfiler`](#parameter-forcecustomerstorageforprofiler) | bool | Force users to create their own storage account for profiler and debugger. |
| [`kind`](#parameter-kind) | string | The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. |
| [`linkedStorageAccountResourceId`](#parameter-linkedstorageaccountresourceid) | string | Linked storage account resource ID. |
| [`location`](#parameter-location) | string | Location for all Resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`publicNetworkAccessForIngestion`](#parameter-publicnetworkaccessforingestion) | string | The network access type for accessing Application Insights ingestion. - Enabled or Disabled. |
| [`publicNetworkAccessForQuery`](#parameter-publicnetworkaccessforquery) | string | The network access type for accessing Application Insights query. - Enabled or Disabled. |
| [`requestSource`](#parameter-requestsource) | string | Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. |
| [`retentionInDays`](#parameter-retentionindays) | int | Retention period in days. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`samplingPercentage`](#parameter-samplingpercentage) | int | Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. |
Expand Down Expand Up @@ -684,6 +696,13 @@ Enable/Disable usage telemetry for module.
- Type: bool
- Default: `True`

### Parameter: `flowType`

Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

- Required: No
- Type: string

### Parameter: `forceCustomerStorageForProfiler`

Force users to create their own storage account for profiler and debugger.
Expand Down Expand Up @@ -781,6 +800,13 @@ The network access type for accessing Application Insights query. - Enabled or D
]
```

### Parameter: `requestSource`

Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

- Required: No
- Type: string

### Parameter: `retentionInDays`

Retention period in days.
Expand Down
4 changes: 2 additions & 2 deletions avm/res/insights/component/linkedStorageAccounts/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3603934328068593686"
"version": "0.33.93.31351",
"templateHash": "10861379689695100897"
},
"name": "Application Insights Linked Storage Account",
"description": "This component deploys an Application Insights Linked Storage Account."
Expand Down
8 changes: 8 additions & 0 deletions avm/res/insights/component/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ param retentionInDays int = 365
@maxValue(100)
param samplingPercentage int = 100

@description('Optional. Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to \'Bluefield\' when creating/updating a component via the REST API.')
param flowType string?

@description('Optional. Describes what tool created this Application Insights component. Customers using this API should set this to the default \'rest\'.')
param requestSource string?

@description('Optional. The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.')
param kind string = ''

Expand Down Expand Up @@ -158,6 +164,8 @@ resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
publicNetworkAccessForQuery: publicNetworkAccessForQuery
RetentionInDays: retentionInDays
SamplingPercentage: samplingPercentage
Flow_Type: flowType
Request_Source: requestSource
}
}

Expand Down
26 changes: 21 additions & 5 deletions avm/res/insights/component/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "8234774084915355769"
"version": "0.33.93.31351",
"templateHash": "10160470062491934963"
},
"name": "Application Insights",
"description": "This component deploys an Application Insights instance."
Expand Down Expand Up @@ -341,6 +341,20 @@
"description": "Optional. Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry."
}
},
"flowType": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API."
}
},
"requestSource": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'."
}
},
"kind": {
"type": "string",
"defaultValue": "",
Expand Down Expand Up @@ -454,7 +468,9 @@
"publicNetworkAccessForIngestion": "[parameters('publicNetworkAccessForIngestion')]",
"publicNetworkAccessForQuery": "[parameters('publicNetworkAccessForQuery')]",
"RetentionInDays": "[parameters('retentionInDays')]",
"SamplingPercentage": "[parameters('samplingPercentage')]"
"SamplingPercentage": "[parameters('samplingPercentage')]",
"Flow_Type": "[parameters('flowType')]",
"Request_Source": "[parameters('requestSource')]"
}
},
"appInsights_roleAssignments": {
Expand Down Expand Up @@ -558,8 +574,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3603934328068593686"
"version": "0.33.93.31351",
"templateHash": "10861379689695100897"
},
"name": "Application Insights Linked Storage Account",
"description": "This component deploys an Application Insights Linked Storage Account."
Expand Down
2 changes: 2 additions & 0 deletions avm/res/insights/component/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ module testDeployment '../../../main.bicep' = {
forceCustomerStorageForProfiler: true
linkedStorageAccountResourceId: nestedDependencies.outputs.storageAccountResourceId
workspaceResourceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
flowType: 'Redfield'
requestSource: 'Azure'
diagnosticSettings: [
{
name: 'customSetting'
Expand Down
2 changes: 1 addition & 1 deletion avm/res/insights/component/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.5",
"version": "0.6",
"pathFilters": [
"./main.json"
]
Expand Down

0 comments on commit 3f90989

Please sign in to comment.