From e4b85e3767907611f42ea94520016a345bc9698f Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Wed, 8 Jun 2022 20:53:59 +0200 Subject: [PATCH 1/4] third party --- arm/Microsoft.OperationsManagement/solutions/deploy.bicep | 6 ++++-- settings.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arm/Microsoft.OperationsManagement/solutions/deploy.bicep b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep index 6a810b2fb2..69ac620137 100644 --- a/arm/Microsoft.OperationsManagement/solutions/deploy.bicep +++ b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep @@ -32,7 +32,9 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-08 name: logAnalyticsWorkspaceName } -var solutionName = '${name}(${logAnalyticsWorkspace.name})' +var solutionName = publisher == 'Microsoft' ? '${name}(${logAnalyticsWorkspace.name})' : name + +var solutionProduct = publisher == 'Microsoft' ? 'OMSGallery/${name}' : product resource solution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = { name: solutionName @@ -43,7 +45,7 @@ resource solution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' plan: { name: solutionName promotionCode: '' - product: '${product}/${name}' + product: solutionProduct publisher: publisher } } diff --git a/settings.json b/settings.json index 9198a0f7d0..6146e07c81 100644 --- a/settings.json +++ b/settings.json @@ -5,7 +5,7 @@ "localTokens": [ { "name": "namePrefix", - "value": "carml", + "value": "rke", "metadata": { "description": "A 3-5 character length string, included in the resources names" } From cf2a042be8bf13d477ded02bb98a5a0ce3002406 Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Wed, 8 Jun 2022 20:55:02 +0200 Subject: [PATCH 2/4] third party param --- .../solutions/.parameters/test.parameters.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json diff --git a/arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json b/arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json new file mode 100644 index 0000000000..05ebfd457b --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "Test" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "product": { + "value": "testProduct" + }, + "publisher": { + "value": "testPublisher" + } + } +} From 676fe523f822269300176d4ade96f462f390772b Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Wed, 8 Jun 2022 20:57:38 +0200 Subject: [PATCH 3/4] disable test --- .github/workflows/ms.operationsmanagement.solutions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ms.operationsmanagement.solutions.yml b/.github/workflows/ms.operationsmanagement.solutions.yml index db74fec086..be58dc9621 100644 --- a/.github/workflows/ms.operationsmanagement.solutions.yml +++ b/.github/workflows/ms.operationsmanagement.solutions.yml @@ -72,10 +72,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' + # - name: 'Run tests' + # uses: ./.github/actions/templates/validateModulePester + # with: + # modulePath: '${{ env.modulePath }}' ############################# # Deployment validation # From 0dd6f95b66028c3b4bd0567f4894eec33c3b0d70 Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Wed, 8 Jun 2022 21:18:27 +0200 Subject: [PATCH 4/4] test third party --- .../ms.operationsmanagement.solutions.yml | 1 + .../ms.operationsmanagement.solutions.yml | 8 +-- ....parameters.json => nonms.parameters.json} | 6 +-- .../solutions/deploy.bicep | 6 +-- .../solutions/readme.md | 54 +++++++++++++++++-- 5 files changed, 62 insertions(+), 13 deletions(-) rename arm/Microsoft.OperationsManagement/solutions/.parameters/{test.parameters.json => nonms.parameters.json} (72%) diff --git a/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml b/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml index fe230cfca9..5dc2588d47 100644 --- a/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml +++ b/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml @@ -46,6 +46,7 @@ stages: removeDeployment: '${{ parameters.removeDeployment }}' deploymentBlocks: - path: $(modulePath)/.parameters/min.parameters.json + - path: $(modulePath)/.parameters/nonms.parameters.json - path: $(modulePath)/.parameters/parameters.json - stage: Publishing diff --git a/.github/workflows/ms.operationsmanagement.solutions.yml b/.github/workflows/ms.operationsmanagement.solutions.yml index be58dc9621..db74fec086 100644 --- a/.github/workflows/ms.operationsmanagement.solutions.yml +++ b/.github/workflows/ms.operationsmanagement.solutions.yml @@ -72,10 +72,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - # - name: 'Run tests' - # uses: ./.github/actions/templates/validateModulePester - # with: - # modulePath: '${{ env.modulePath }}' + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ env.modulePath }}' ############################# # Deployment validation # diff --git a/arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json b/arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.parameters.json similarity index 72% rename from arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json rename to arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.parameters.json index 05ebfd457b..a040bf8d2f 100644 --- a/arm/Microsoft.OperationsManagement/solutions/.parameters/test.parameters.json +++ b/arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.parameters.json @@ -3,16 +3,16 @@ "contentVersion": "1.0.0.0", "parameters": { "name": { - "value": "Test" + "value": "nonmsTestSolution" }, "logAnalyticsWorkspaceName": { "value": "adp-<>-az-law-sol-001" }, "product": { - "value": "testProduct" + "value": "nonmsTestSolutionProduct" }, "publisher": { - "value": "testPublisher" + "value": "nonmsTestSolutionPublisher" } } } diff --git a/arm/Microsoft.OperationsManagement/solutions/deploy.bicep b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep index 69ac620137..3438041ddd 100644 --- a/arm/Microsoft.OperationsManagement/solutions/deploy.bicep +++ b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep @@ -1,4 +1,4 @@ -@description('Required. Name of the solution.') +@description('Required. Name of the solution. For Microsoft published gallery solution the target solution resource name will be composed as `{name}({logAnalyticsWorkspaceName})`.') param name string @description('Required. Name of the Log Analytics workspace where the solution will be deployed/enabled.') @@ -7,10 +7,10 @@ param logAnalyticsWorkspaceName string @description('Optional. Location for all resources.') param location string = resourceGroup().location -@description('Optional. The product of the deployed solution. For Microsoft published gallery solution it should be OMSGallery. This is case sensitive.') +@description('Optional. The product of the deployed solution. For Microsoft published gallery solution it should be `OMSGallery` and the target solution resource product will be composed as `OMSGallery/{name}`. For third party solution, it can be anything. This is case sensitive.') param product string = 'OMSGallery' -@description('Optional. The publisher name of the deployed solution. For gallery solution, it is Microsoft.') +@description('Optional. The publisher name of the deployed solution. For Microsoft published gallery solution, it is `Microsoft`.') param publisher string = 'Microsoft' @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') diff --git a/arm/Microsoft.OperationsManagement/solutions/readme.md b/arm/Microsoft.OperationsManagement/solutions/readme.md index e811889681..9ab3a6f332 100644 --- a/arm/Microsoft.OperationsManagement/solutions/readme.md +++ b/arm/Microsoft.OperationsManagement/solutions/readme.md @@ -21,15 +21,15 @@ This module deploys OperationsManagement Solutions. | Parameter Name | Type | Description | | :-- | :-- | :-- | | `logAnalyticsWorkspaceName` | string | Name of the Log Analytics workspace where the solution will be deployed/enabled. | -| `name` | string | Name of the solution. | +| `name` | string | Name of the solution. For Microsoft published gallery solution the target solution resource name will be composed as `{name}({logAnalyticsWorkspaceName})`. | **Optional parameters** | Parameter Name | Type | Default Value | Description | | :-- | :-- | :-- | :-- | | `enableDefaultTelemetry` | bool | `True` | Enable telemetry via the Customer Usage Attribution ID (GUID). | | `location` | string | `[resourceGroup().location]` | Location for all resources. | -| `product` | string | `'OMSGallery'` | The product of the deployed solution. For Microsoft published gallery solution it should be OMSGallery. This is case sensitive. | -| `publisher` | string | `'Microsoft'` | The publisher name of the deployed solution. For gallery solution, it is Microsoft. | +| `product` | string | `'OMSGallery'` | The product of the deployed solution. For Microsoft published gallery solution it should be `OMSGallery` and the target solution resource product will be composed as `OMSGallery/{name}`. For third party solution, it can be anything. This is case sensitive. | +| `publisher` | string | `'Microsoft'` | The publisher name of the deployed solution. For Microsoft published gallery solution, it is `Microsoft`. | ## Outputs @@ -89,6 +89,54 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { via JSON Parameter file +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "nonmsTestSolution" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "product": { + "value": "nonmsTestSolutionProduct" + }, + "publisher": { + "value": "nonmsTestSolutionPublisher" + } + } +} + +``` + + + +
+ +via Bicep module + +```bicep +module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-solutions' + params: { + name: 'nonmsTestSolution' + logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + product: 'nonmsTestSolutionProduct' + publisher: 'nonmsTestSolutionPublisher' + } +``` + +
+

+ +

Example 3

+ +
+ +via JSON Parameter file + ```json { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",