Skip to content
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

feat: Log Analytics Workspace updates - API versions and new properties #4418

Merged
merged 11 commits into from
Feb 11, 2025
139 changes: 105 additions & 34 deletions avm/res/operational-insights/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ This module deploys a Log Analytics Workspace.
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.OperationalInsights/workspaces` | [2022-10-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2022-10-01/workspaces) |
| `Microsoft.OperationalInsights/workspaces/dataExports` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/dataExports) |
| `Microsoft.OperationalInsights/workspaces/dataSources` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/dataSources) |
| `Microsoft.OperationalInsights/workspaces/linkedServices` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/linkedServices) |
| `Microsoft.OperationalInsights/workspaces/linkedStorageAccounts` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/linkedStorageAccounts) |
| `Microsoft.OperationalInsights/workspaces/savedSearches` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/savedSearches) |
| `Microsoft.OperationalInsights/workspaces/storageInsightConfigs` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/storageInsightConfigs) |
| `Microsoft.OperationalInsights/workspaces/tables` | [2022-10-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2022-10-01/workspaces/tables) |
| `Microsoft.OperationalInsights/workspaces` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces) |
| `Microsoft.OperationalInsights/workspaces/dataExports` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/dataExports) |
| `Microsoft.OperationalInsights/workspaces/dataSources` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/dataSources) |
| `Microsoft.OperationalInsights/workspaces/linkedServices` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/linkedServices) |
| `Microsoft.OperationalInsights/workspaces/linkedStorageAccounts` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/linkedStorageAccounts) |
| `Microsoft.OperationalInsights/workspaces/savedSearches` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/savedSearches) |
| `Microsoft.OperationalInsights/workspaces/storageInsightConfigs` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/storageInsightConfigs) |
| `Microsoft.OperationalInsights/workspaces/tables` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/tables) |
| `Microsoft.OperationsManagement/solutions` | [2015-11-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationsManagement/2015-11-01-preview/solutions) |
| `Microsoft.SecurityInsights/onboardingStates` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.SecurityInsights/2024-03-01/onboardingStates) |

Expand Down Expand Up @@ -198,6 +198,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
useThisWorkspace: true
}
]
features: {
enableLogAccessUsingOnlyResourcePermissions: true
}
gallerySolutions: [
{
name: 'AzureAutomation(oiwadv001)'
Expand Down Expand Up @@ -338,7 +341,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
useResourcePermissions: true
}
}
```
Expand Down Expand Up @@ -508,6 +510,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
}
]
},
"features": {
"value": {
"enableLogAccessUsingOnlyResourcePermissions": true
}
},
"gallerySolutions": {
"value": [
{
Expand Down Expand Up @@ -669,9 +676,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
"hidden-title": "This is visible in the resource name",
"Role": "DeploymentValidation"
}
},
"useResourcePermissions": {
"value": true
}
}
}
Expand Down Expand Up @@ -830,6 +834,9 @@ param diagnosticSettings = [
useThisWorkspace: true
}
]
param features = {
enableLogAccessUsingOnlyResourcePermissions: true
}
param gallerySolutions = [
{
name: 'AzureAutomation(oiwadv001)'
Expand Down Expand Up @@ -970,7 +977,6 @@ param tags = {
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
param useResourcePermissions = true
```

</details>
Expand Down Expand Up @@ -1161,6 +1167,12 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
workspaceResourceId: '<workspaceResourceId>'
}
]
features: {
disableLocalAuth: true
enableDataExport: true
enableLogAccessUsingOnlyResourcePermissions: true
immediatePurgeDataOn30Days: true
}
gallerySolutions: [
{
name: 'AzureAutomation(oiwmax001)'
Expand Down Expand Up @@ -1348,7 +1360,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
useResourcePermissions: true
}
}
```
Expand Down Expand Up @@ -1481,6 +1492,14 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
}
]
},
"features": {
"value": {
"disableLocalAuth": true,
"enableDataExport": true,
"enableLogAccessUsingOnlyResourcePermissions": true,
"immediatePurgeDataOn30Days": true
}
},
"gallerySolutions": {
"value": [
{
Expand Down Expand Up @@ -1695,9 +1714,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
"hidden-title": "This is visible in the resource name",
"Role": "DeploymentValidation"
}
},
"useResourcePermissions": {
"value": true
}
}
}
Expand Down Expand Up @@ -1821,6 +1837,12 @@ param diagnosticSettings = [
workspaceResourceId: '<workspaceResourceId>'
}
]
param features = {
disableLocalAuth: true
enableDataExport: true
enableLogAccessUsingOnlyResourcePermissions: true
immediatePurgeDataOn30Days: true
}
param gallerySolutions = [
{
name: 'AzureAutomation(oiwmax001)'
Expand Down Expand Up @@ -2008,7 +2030,6 @@ param tags = {
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
param useResourcePermissions = true
```

</details>
Expand Down Expand Up @@ -2129,6 +2150,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
workspaceResourceId: '<workspaceResourceId>'
}
]
features: {
enableLogAccessUsingOnlyResourcePermissions: true
}
gallerySolutions: [
{
name: 'AzureAutomation(oiwwaf001)'
Expand Down Expand Up @@ -2173,7 +2197,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
useResourcePermissions: true
}
}
```
Expand Down Expand Up @@ -2300,6 +2323,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
}
]
},
"features": {
"value": {
"enableLogAccessUsingOnlyResourcePermissions": true
}
},
"gallerySolutions": {
"value": [
{
Expand Down Expand Up @@ -2361,9 +2389,6 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
"hidden-title": "This is visible in the resource name",
"Role": "DeploymentValidation"
}
},
"useResourcePermissions": {
"value": true
}
}
}
Expand Down Expand Up @@ -2481,6 +2506,9 @@ param diagnosticSettings = [
workspaceResourceId: '<workspaceResourceId>'
}
]
param features = {
enableLogAccessUsingOnlyResourcePermissions: true
}
param gallerySolutions = [
{
name: 'AzureAutomation(oiwwaf001)'
Expand Down Expand Up @@ -2525,7 +2553,6 @@ param tags = {
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
param useResourcePermissions = true
```

</details>
Expand Down Expand Up @@ -2555,6 +2582,7 @@ param useResourcePermissions = true
| [`dataSources`](#parameter-datasources) | array | LAW data sources to configure. |
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`features`](#parameter-features) | object | The workspace features. |
| [`forceCmkForQuery`](#parameter-forcecmkforquery) | bool | Indicates whether customer managed storage is mandatory for query management. |
| [`gallerySolutions`](#parameter-gallerysolutions) | array | List of gallerySolutions to be created in the log analytics workspace. |
| [`linkedServices`](#parameter-linkedservices) | array | List of services to be linked. |
Expand All @@ -2571,7 +2599,6 @@ param useResourcePermissions = true
| [`storageInsightsConfigs`](#parameter-storageinsightsconfigs) | array | List of storage accounts to be read by the workspace. |
| [`tables`](#parameter-tables) | array | LAW custom tables to be deployed. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`useResourcePermissions`](#parameter-useresourcepermissions) | bool | Set to 'true' to use resource or workspace permissions and 'false' (or leave empty) to require workspace permissions. |

### Parameter: `name`

Expand Down Expand Up @@ -3078,6 +3105,60 @@ Enable/Disable usage telemetry for module.
- MinValue: 0
- MaxValue: 730

### Parameter: `features`

The workspace features.

- Required: No
- Type: object
- MinValue: 0
- MaxValue: 730

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`disableLocalAuth`](#parameter-featuresdisablelocalauth) | bool | Disable Non-EntraID based Auth. Default is true. |
| [`enableDataExport`](#parameter-featuresenabledataexport) | bool | Flag that indicate if data should be exported. |
| [`enableLogAccessUsingOnlyResourcePermissions`](#parameter-featuresenablelogaccessusingonlyresourcepermissions) | bool | Enable log access using only resource permissions. Default is false. |
| [`immediatePurgeDataOn30Days`](#parameter-featuresimmediatepurgedataon30days) | bool | Flag that describes if we want to remove the data after 30 days. |

### Parameter: `features.disableLocalAuth`

Disable Non-EntraID based Auth. Default is true.

- Required: No
- Type: bool
- MinValue: 0
- MaxValue: 730

### Parameter: `features.enableDataExport`

Flag that indicate if data should be exported.

- Required: No
- Type: bool
- MinValue: 0
- MaxValue: 730

### Parameter: `features.enableLogAccessUsingOnlyResourcePermissions`

Enable log access using only resource permissions. Default is false.

- Required: No
- Type: bool
- MinValue: 0
- MaxValue: 730

### Parameter: `features.immediatePurgeDataOn30Days`

Flag that describes if we want to remove the data after 30 days.

- Required: No
- Type: bool
- MinValue: 0
- MaxValue: 730

### Parameter: `forceCmkForQuery`

Indicates whether customer managed storage is mandatory for query management.
Expand Down Expand Up @@ -4110,16 +4191,6 @@ Tags of the resource.
- MinValue: 100
- MaxValue: 5000

### Parameter: `useResourcePermissions`

Set to 'true' to use resource or workspace permissions and 'false' (or leave empty) to require workspace permissions.

- Required: No
- Type: bool
- Default: `False`
- MinValue: 100
- MaxValue: 5000

## Outputs

| Output | Type | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys a Log Analytics Workspace Data Export.

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.OperationalInsights/workspaces/dataExports` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/dataExports) |
| `Microsoft.OperationalInsights/workspaces/dataExports` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/dataExports) |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ param tableNames string[]
// Deployments //
// =============== //

resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = {
resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: workspaceName
}

resource dataExport 'Microsoft.OperationalInsights/workspaces/dataExports@2020-08-01' = {
resource dataExport 'Microsoft.OperationalInsights/workspaces/dataExports@2023-09-01' = {
parent: workspace
name: name
properties: {
Expand Down
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": "14977926524140126314"
"version": "0.33.93.31351",
"templateHash": "15082251740316718256"
},
"name": "Log Analytics Workspace Data Exports",
"description": "This module deploys a Log Analytics Workspace Data Export."
Expand Down Expand Up @@ -88,12 +88,12 @@
"workspace": {
"existing": true,
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2022-10-01",
"apiVersion": "2023-09-01",
"name": "[parameters('workspaceName')]"
},
"dataExport": {
"type": "Microsoft.OperationalInsights/workspaces/dataExports",
"apiVersion": "2020-08-01",
"apiVersion": "2023-09-01",
"name": "[format('{0}/{1}', parameters('workspaceName'), parameters('name'))]",
"properties": {
"destination": "[parameters('destination')]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys a Log Analytics Workspace Data Source.

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.OperationalInsights/workspaces/dataSources` | [2020-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2020-08-01/workspaces/dataSources) |
| `Microsoft.OperationalInsights/workspaces/dataSources` | [2023-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.OperationalInsights/2023-09-01/workspaces/dataSources) |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ param syslogName string?
@description('Optional. Severities to configure when kind is LinuxSyslog.')
param syslogSeverities array = []

resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = {
resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: logAnalyticsWorkspaceName
}

resource dataSource 'Microsoft.OperationalInsights/workspaces/dataSources@2020-08-01' = {
resource dataSource 'Microsoft.OperationalInsights/workspaces/dataSources@2023-09-01' = {
name: name
parent: workspace
kind: kind
Expand Down
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": "12082641043455308513"
"version": "0.33.93.31351",
"templateHash": "3186325409788999053"
},
"name": "Log Analytics Workspace Datasources",
"description": "This module deploys a Log Analytics Workspace Data Source."
Expand Down Expand Up @@ -130,12 +130,12 @@
"workspace": {
"existing": true,
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2022-10-01",
"apiVersion": "2023-09-01",
"name": "[parameters('logAnalyticsWorkspaceName')]"
},
"dataSource": {
"type": "Microsoft.OperationalInsights/workspaces/dataSources",
"apiVersion": "2020-08-01",
"apiVersion": "2023-09-01",
"name": "[format('{0}/{1}', parameters('logAnalyticsWorkspaceName'), parameters('name'))]",
"kind": "[parameters('kind')]",
"tags": "[parameters('tags')]",
Expand Down
Loading