diff --git a/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml b/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml new file mode 100644 index 0000000000..483f0184d5 --- /dev/null +++ b/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml @@ -0,0 +1,56 @@ +name: 'OperationsManagement - Solutions' + +parameters: + - name: removeDeployment + displayName: Remove deployed module + type: boolean + default: true + - name: prerelease + displayName: Publish prerelease module + type: boolean + default: false + +pr: none + +trigger: + batch: true + branches: + include: + - main + paths: + include: + - '/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml' + - '/.azuredevops/pipelineTemplates/*.yml' + - '/arm/Microsoft.OperationsManagement/solutions/*' + - '/arm/.global/global.module.tests.ps1' + exclude: + - '/**/*.md' + +variables: + - template: '../../global.variables.yml' + - group: 'PLATFORM_VARIABLES' + - name: modulePath + value: '/arm/Microsoft.OperationsManagement/solutions' + +stages: + - stage: Validation + displayName: Static validation + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml + + - stage: Deployment + displayName: Deployment validation + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml + parameters: + removeDeployment: '${{ parameters.removeDeployment }}' + deploymentBlocks: + - path: $(modulePath)/.parameters/min.parameters.json + - path: $(modulePath)/.parameters/nonms.parameters.json + - path: $(modulePath)/.parameters/ms.parameters.json + + - stage: Publishing + displayName: Publishing + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true'))) + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml diff --git a/.github/workflows/ms.operationsmanagement.solutions.yml b/.github/workflows/ms.operationsmanagement.solutions.yml new file mode 100644 index 0000000000..db74fec086 --- /dev/null +++ b/.github/workflows/ms.operationsmanagement.solutions.yml @@ -0,0 +1,142 @@ +name: 'OperationsManagement: Solutions' + +on: + workflow_dispatch: + inputs: + removeDeployment: + type: boolean + description: 'Remove deployed module' + required: false + default: true + prerelease: + type: boolean + description: 'Publish prerelease module' + required: false + default: false + push: + branches: + - main + paths: + - '.github/actions/templates/**' + - '.github/workflows/ms.operationsmanagement.solutions.yml' + - 'arm/Microsoft.OperationsManagement/solutions/**' + - 'arm/.global/global.module.tests.ps1' + - '!*/**/readme.md' + - 'utilities/pipelines/**' + - '!utilities/pipelines/dependencies/**' + +env: + variablesPath: 'global.variables.yml' + modulePath: 'arm/Microsoft.OperationsManagement/solutions' + workflowPath: '.github/workflows/ms.operationsmanagement.solutions.yml' + AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} + ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' + ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' + DEPLOYMENT_SP_ID: '${{ secrets.DEPLOYMENT_SP_ID }}' + +jobs: + ########################### + # Initialize pipeline # + ########################### + job_initialize_pipeline: + runs-on: ubuntu-20.04 + name: 'Initialize pipeline' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: 'Set input parameters to output variables' + id: get-workflow-param + uses: ./.github/actions/templates/getWorkflowInput + with: + workflowPath: '${{ env.workflowPath}}' + - name: 'Get parameter file paths' + id: get-parameter-file-paths + uses: ./.github/actions/templates/getParameterFiles + with: + modulePath: '${{ env.modulePath }}' + outputs: + removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} + parameterFilePaths: ${{ steps.get-parameter-file-paths.outputs.parameterFilePaths }} + + ######################### + # Static validation # + ######################### + job_module_pester_validation: + runs-on: ubuntu-20.04 + name: 'Static validation' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ env.modulePath }}' + + ############################# + # Deployment validation # + ############################# + job_module_deploy_validation: + runs-on: ubuntu-20.04 + name: 'Deployment validation' + needs: + - job_initialize_pipeline + - job_module_pester_validation + strategy: + fail-fast: false + matrix: + parameterFilePaths: ${{ fromJSON(needs.job_initialize_pipeline.outputs.parameterFilePaths) }} + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' + uses: ./.github/actions/templates/validateModuleDeployment + with: + templateFilePath: '${{ env.modulePath }}/deploy.bicep' + parameterFilePath: '${{ env.modulePath }}/${{ matrix.parameterFilePaths }}' + location: '${{ env.location }}' + resourceGroupName: '${{ env.resourceGroupName }}' + subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + removeDeployment: '${{ needs.job_initialize_pipeline.outputs.removeDeployment }}' + + ################## + # Publishing # + ################## + job_publish_module: + name: 'Publishing' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' + runs-on: ubuntu-20.04 + needs: + - job_module_deploy_validation + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Publishing' + uses: ./.github/actions/templates/publishModule + with: + templateFilePath: '${{ env.modulePath }}/deploy.bicep' + templateSpecsRGName: '${{ env.templateSpecsRGName }}' + templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' + templateSpecsDescription: '${{ env.templateSpecsDescription }}' + templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' + bicepRegistryName: '${{ env.bicepRegistryName }}' + bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' + bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' + bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' diff --git a/.github/workflows/platform.dependencies.yml b/.github/workflows/platform.dependencies.yml index 15a77c9477..400fc2281e 100644 --- a/.github/workflows/platform.dependencies.yml +++ b/.github/workflows/platform.dependencies.yml @@ -254,7 +254,7 @@ jobs: fail-fast: false matrix: parameterFilePaths: - ['appi.parameters.json', 'aut.parameters.json', 'parameters.json'] + ['appi.parameters.json', 'aut.parameters.json', 'sol.parameters.json', 'parameters.json'] steps: - name: 'Checkout' uses: actions/checkout@v2 diff --git a/arm/Microsoft.Automation/automationAccounts/.bicep/nested_solution.bicep b/arm/Microsoft.Automation/automationAccounts/.bicep/nested_solution.bicep deleted file mode 100644 index b6cbf586ea..0000000000 --- a/arm/Microsoft.Automation/automationAccounts/.bicep/nested_solution.bicep +++ /dev/null @@ -1,43 +0,0 @@ -@description('Required. Name of the solution') -param name string - -@description('Required. Name of the Log Analytics workspace') -param logAnalyticsWorkspaceName string - -@description('Optional. Location for all resources.') -param location string = resourceGroup().location - -@description('Optional. The product of the deployed solution. For gallery solution, it is OMSGallery.') -param product string = 'OMSGallery' - -@description('Optional. The publisher name of the deployed solution. For gallery solution, it is Microsoft.') -param publisher string = 'Microsoft' - -resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' existing = { - name: logAnalyticsWorkspaceName -} - -var solutionName = '${name}(${logAnalyticsWorkspace.name})' - -resource solution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = { - name: solutionName - location: location - properties: { - workspaceResourceId: logAnalyticsWorkspace.id - } - plan: { - name: solutionName - promotionCode: '' - product: '${product}/${name}' - publisher: publisher - } -} - -@description('The name of the deployed solution') -output name string = solution.name - -@description('The resource ID of the deployed solution') -output resourceId string = solution.id - -@description('The resource group where the solution is deployed') -output resourceGroupName string = resourceGroup().name diff --git a/arm/Microsoft.Automation/automationAccounts/.parameters/parameters.json b/arm/Microsoft.Automation/automationAccounts/.parameters/parameters.json index 7cd7405fd4..4b1dc95b56 100644 --- a/arm/Microsoft.Automation/automationAccounts/.parameters/parameters.json +++ b/arm/Microsoft.Automation/automationAccounts/.parameters/parameters.json @@ -84,7 +84,11 @@ }, "gallerySolutions": { "value": [ - "Updates" + { + "name": "Updates", + "product": "OMSGallery", + "publisher": "Microsoft" + } ] }, "softwareUpdateConfigurations": { diff --git a/arm/Microsoft.Automation/automationAccounts/deploy.bicep b/arm/Microsoft.Automation/automationAccounts/deploy.bicep index 9739cb433d..e9f0e43f90 100644 --- a/arm/Microsoft.Automation/automationAccounts/deploy.bicep +++ b/arm/Microsoft.Automation/automationAccounts/deploy.bicep @@ -269,12 +269,15 @@ module automationAccount_linkedService '../../Microsoft.OperationalInsights/work scope: resourceGroup(!empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[2] : subscription().subscriptionId, !empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[4] : resourceGroup().name) } -module automationAccount_solutions '.bicep/nested_solution.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) { +module automationAccount_solutions '../../Microsoft.OperationsManagement/solutions/deploy.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) { name: '${uniqueString(deployment().name, location)}-AutoAccount-Solution-${index}' params: { - name: gallerySolution + name: gallerySolution.name location: location logAnalyticsWorkspaceName: last(split(linkedWorkspaceResourceId, '/')) + product: contains(gallerySolution, 'product') ? gallerySolution.product : 'OMSGallery' + publisher: contains(gallerySolution, 'publisher') ? gallerySolution.publisher : 'Microsoft' + enableDefaultTelemetry: enableReferencedModulesTelemetry } // This is to support solution to law in different subscription and resource group than the automation account. // The current scope is used by default if no linked service is intended to be created. diff --git a/arm/Microsoft.Automation/automationAccounts/readme.md b/arm/Microsoft.Automation/automationAccounts/readme.md index d5afbe6103..dedda461e6 100644 --- a/arm/Microsoft.Automation/automationAccounts/readme.md +++ b/arm/Microsoft.Automation/automationAccounts/readme.md @@ -538,7 +538,11 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice }, "gallerySolutions": { "value": [ - "Updates" + { + "name": "Updates", + "product": "OMSGallery", + "publisher": "Microsoft" + } ] }, "softwareUpdateConfigurations": { @@ -725,7 +729,11 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice ] linkedWorkspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-aut-001' gallerySolutions: [ - 'Updates' + { + name: 'Updates' + product: 'OMSGallery' + publisher: 'Microsoft' + } ] softwareUpdateConfigurations: [ { diff --git a/arm/Microsoft.OperationalInsights/workspaces/.bicep/nested_solutions.bicep b/arm/Microsoft.OperationalInsights/workspaces/.bicep/nested_solutions.bicep deleted file mode 100644 index 341438497c..0000000000 --- a/arm/Microsoft.OperationalInsights/workspaces/.bicep/nested_solutions.bicep +++ /dev/null @@ -1,32 +0,0 @@ -param gallerySolution string -param logAnalyticsWorkspaceName string -param location string -param product string = 'OMSGallery' -param publisher string = 'Microsoft' - -resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' existing = { - name: logAnalyticsWorkspaceName -} - -resource solution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = { - name: '${gallerySolution}(${logAnalyticsWorkspace.name})' - location: location - properties: { - workspaceResourceId: logAnalyticsWorkspace.id - } - plan: { - name: '${gallerySolution}(${logAnalyticsWorkspace.name})' - product: '${product}/${gallerySolution}' - promotionCode: '' - publisher: publisher - } -} - -@description('The resource ID of the deployed solution') -output resourceId string = solution.id - -@description('The resource group where the solution will be deployed') -output resourceGroupName string = resourceGroup().name - -@description('The name of the deployed solution') -output name string = solution.name diff --git a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep index 2bfde8f314..6c4f19a79d 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep @@ -25,7 +25,7 @@ param savedSearches array = [] @description('Optional. LAW data sources to configure.') param dataSources array = [] -@description('Optional. LAW gallerySolutions from the gallery.') +@description('Optional. List of gallerySolutions to be created in the log analytics workspace.') param gallerySolutions array = [] @description('Optional. Number of days data will be retained for.') @@ -235,14 +235,15 @@ module logAnalyticsWorkspace_dataSources 'dataSources/deploy.bicep' = [for (data } }] -module logAnalyticsWorkspace_solutions '.bicep/nested_solutions.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(gallerySolutions)) { +module logAnalyticsWorkspace_solutions '../../Microsoft.OperationsManagement/solutions/deploy.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(gallerySolutions)) { name: '${uniqueString(deployment().name, location)}-LAW-Solution-${index}' params: { - gallerySolution: gallerySolution.name + name: gallerySolution.name location: location logAnalyticsWorkspaceName: logAnalyticsWorkspace.name - product: gallerySolution.product - publisher: gallerySolution.publisher + product: contains(gallerySolution, 'product') ? gallerySolution.product : 'OMSGallery' + publisher: contains(gallerySolution, 'publisher') ? gallerySolution.publisher : 'Microsoft' + enableDefaultTelemetry: enableReferencedModulesTelemetry } }] diff --git a/arm/Microsoft.OperationalInsights/workspaces/readme.md b/arm/Microsoft.OperationalInsights/workspaces/readme.md index 41aa525520..ca794e10bd 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/readme.md +++ b/arm/Microsoft.OperationalInsights/workspaces/readme.md @@ -45,7 +45,7 @@ This template deploys a log analytics workspace. | `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. | | `diagnosticWorkspaceId` | string | `''` | | Resource ID of a log analytics workspace. | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). | -| `gallerySolutions` | array | `[]` | | LAW gallerySolutions from the gallery. | +| `gallerySolutions` | array | `[]` | | List of gallerySolutions to be created in the log analytics workspace. | | `linkedServices` | _[linkedServices](linkedServices/readme.md)_ array | `[]` | | List of services to be linked. | | `location` | string | `[resourceGroup().location]` | | Location for all resources. | | `lock` | string | `''` | `[, CanNotDelete, ReadOnly]` | Specify the type of lock. | @@ -61,6 +61,8 @@ This template deploys a log analytics workspace. ### Parameter Usage: `gallerySolutions` +Ref cross-referenced _[solutions](../../Microsoft.OperationsManagement/solutions/readme.md)_ +
Parameter JSON format @@ -70,122 +72,122 @@ This template deploys a log analytics workspace. "value": [ { "name": "AgentHealthAssessment", - "product": "OMSGallery/AgentHealthAssessment", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AlertManagement", - "product": "OMSGallery/AlertManagement", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AntiMalware", - "product": "OMSGallery/AntiMalware", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureActivity", - "product": "OMSGallery/AzureActivity", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureAutomation", - "product": "OMSGallery/AzureAutomation", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureCdnCoreAnalytics", - "product": "OMSGallery/AzureCdnCoreAnalytics", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureDataFactoryAnalytics", - "product": "OMSGallery/AzureDataFactoryAnalytics", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureNSGAnalytics", - "product": "OMSGallery/AzureNSGAnalytics", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "AzureSQLAnalytics", - "product": "OMSGallery/AzureSQLAnalytics", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "ChangeTracking", - "product": "OMSGallery/ChangeTracking", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "Containers", - "product": "OMSGallery/Containers", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "InfrastructureInsights", - "product": "OMSGallery/InfrastructureInsights", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "KeyVaultAnalytics", - "product": "OMSGallery/KeyVaultAnalytics", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "LogicAppsManagement", - "product": "OMSGallery/LogicAppsManagement", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "NetworkMonitoring", - "product": "OMSGallery/NetworkMonitoring", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "Security", - "product": "OMSGallery/Security", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "SecurityCenterFree", - "product": "OMSGallery/SecurityCenterFree", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "ServiceFabric", - "product": "OMSGallery/ServiceFabric", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "ServiceMap", - "product": "OMSGallery/ServiceMap", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "SQLAssessment", - "product": "OMSGallery/SQLAssessment", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "Updates", - "product": "OMSGallery/Updates", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "VMInsights", - "product": "OMSGallery/VMInsights", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "WireData2", - "product": "OMSGallery/WireData2", + "product": "OMSGallery", "publisher": "Microsoft" }, { "name": "WaaSUpdateInsights", - "product": "OMSGallery/WaaSUpdateInsights", + "product": "OMSGallery", "publisher": "Microsoft" } ] @@ -202,122 +204,122 @@ This template deploys a log analytics workspace. gallerySolutions: [ { name: 'AgentHealthAssessment' - product: 'OMSGallery/AgentHealthAssessment' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AlertManagement' - product: 'OMSGallery/AlertManagement' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AntiMalware' - product: 'OMSGallery/AntiMalware' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureActivity' - product: 'OMSGallery/AzureActivity' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureAutomation' - product: 'OMSGallery/AzureAutomation' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureCdnCoreAnalytics' - product: 'OMSGallery/AzureCdnCoreAnalytics' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureDataFactoryAnalytics' - product: 'OMSGallery/AzureDataFactoryAnalytics' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureNSGAnalytics' - product: 'OMSGallery/AzureNSGAnalytics' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'AzureSQLAnalytics' - product: 'OMSGallery/AzureSQLAnalytics' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'ChangeTracking' - product: 'OMSGallery/ChangeTracking' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'Containers' - product: 'OMSGallery/Containers' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'InfrastructureInsights' - product: 'OMSGallery/InfrastructureInsights' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'KeyVaultAnalytics' - product: 'OMSGallery/KeyVaultAnalytics' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'LogicAppsManagement' - product: 'OMSGallery/LogicAppsManagement' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'NetworkMonitoring' - product: 'OMSGallery/NetworkMonitoring' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'Security' - product: 'OMSGallery/Security' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'SecurityCenterFree' - product: 'OMSGallery/SecurityCenterFree' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'ServiceFabric' - product: 'OMSGallery/ServiceFabric' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'ServiceMap' - product: 'OMSGallery/ServiceMap' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'SQLAssessment' - product: 'OMSGallery/SQLAssessment' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'Updates' - product: 'OMSGallery/Updates' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'VMInsights' - product: 'OMSGallery/VMInsights' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'WireData2' - product: 'OMSGallery/WireData2' + product: 'OMSGallery' publisher: 'Microsoft' } { name: 'WaaSUpdateInsights' - product: 'OMSGallery/WaaSUpdateInsights' + product: 'OMSGallery' publisher: 'Microsoft' } ] diff --git a/arm/Microsoft.OperationsManagement/solutions/.parameters/min.parameters.json b/arm/Microsoft.OperationsManagement/solutions/.parameters/min.parameters.json new file mode 100644 index 0000000000..6844bb4688 --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/.parameters/min.parameters.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "Updates" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + } + } +} diff --git a/arm/Microsoft.OperationsManagement/solutions/.parameters/ms.parameters.json b/arm/Microsoft.OperationsManagement/solutions/.parameters/ms.parameters.json new file mode 100644 index 0000000000..c7dcb66400 --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/.parameters/ms.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": "AzureAutomation" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "product": { + "value": "OMSGallery" + }, + "publisher": { + "value": "Microsoft" + } + } +} diff --git a/arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.parameters.json b/arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.parameters.json new file mode 100644 index 0000000000..a040bf8d2f --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/.parameters/nonms.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": "nonmsTestSolution" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "product": { + "value": "nonmsTestSolutionProduct" + }, + "publisher": { + "value": "nonmsTestSolutionPublisher" + } + } +} diff --git a/arm/Microsoft.OperationsManagement/solutions/deploy.bicep b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep new file mode 100644 index 0000000000..3438041ddd --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/deploy.bicep @@ -0,0 +1,63 @@ +@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.') +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` 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 Microsoft published gallery solution, it is `Microsoft`.') +param publisher string = 'Microsoft' + +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + +resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' existing = { + name: logAnalyticsWorkspaceName +} + +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 + location: location + properties: { + workspaceResourceId: logAnalyticsWorkspace.id + } + plan: { + name: solutionName + promotionCode: '' + product: solutionProduct + publisher: publisher + } +} + +@description('The name of the deployed solution.') +output name string = solution.name + +@description('The resource ID of the deployed solution.') +output resourceId string = solution.id + +@description('The resource group where the solution is deployed.') +output resourceGroupName string = resourceGroup().name + +@description('The location the resource was deployed into.') +output location string = solution.location diff --git a/arm/Microsoft.OperationsManagement/solutions/readme.md b/arm/Microsoft.OperationsManagement/solutions/readme.md new file mode 100644 index 0000000000..421b0fcfc8 --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/readme.md @@ -0,0 +1,180 @@ +# OperationsManagement Solutions `[Microsoft.OperationsManagement/solutions]` + +This module deploys OperationsManagement Solutions. + +## Navigation + +- [Resource Types](#Resource-Types) +- [Parameters](#Parameters) +- [Outputs](#Outputs) +- [Deployment examples](#Deployment-examples) + +## Resource Types + +| Resource Type | API Version | +| :-- | :-- | +| `Microsoft.OperationsManagement/solutions` | [2015-11-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.OperationsManagement/2015-11-01-preview/solutions) | + +## Parameters + +**Required parameters** +| 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. 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` 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 + +| Output Name | Type | Description | +| :-- | :-- | :-- | +| `location` | string | The location the resource was deployed into. | +| `name` | string | The name of the deployed solution. | +| `resourceGroupName` | string | The resource group where the solution is deployed. | +| `resourceId` | string | The resource ID of the deployed solution. | + +## Deployment examples + +

Example 1

+ +
+ +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": "Updates" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + } + } +} + +``` + +
+ +
+ +via Bicep module + +```bicep +module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-solutions' + params: { + name: 'Updates' + logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + } +``` + +
+

+ +

Example 2

+ +
+ +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": "AzureAutomation" + }, + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "product": { + "value": "OMSGallery" + }, + "publisher": { + "value": "Microsoft" + } + } +} + +``` + +
+ +
+ +via Bicep module + +```bicep +module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-solutions' + params: { + name: 'AzureAutomation' + logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + product: 'OMSGallery' + publisher: 'Microsoft' + } +``` + +
+

+ +

Example 3

+ +
+ +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' + } +``` + +
+

diff --git a/arm/Microsoft.OperationsManagement/solutions/version.json b/arm/Microsoft.OperationsManagement/solutions/version.json new file mode 100644 index 0000000000..41f66cc990 --- /dev/null +++ b/arm/Microsoft.OperationsManagement/solutions/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "0.1" +} diff --git a/utilities/pipelines/dependencies/Microsoft.OperationalInsights/workspaces/parameters/sol.parameters.json b/utilities/pipelines/dependencies/Microsoft.OperationalInsights/workspaces/parameters/sol.parameters.json new file mode 100644 index 0000000000..d8e7e24346 --- /dev/null +++ b/utilities/pipelines/dependencies/Microsoft.OperationalInsights/workspaces/parameters/sol.parameters.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "adp-<>-az-law-sol-001" + } + } +}