Azure / arm-template-whatif

A repository to track issues related to what-if noise suppression
MIT License
90 stars 14 forks source link

Microsoft.Insights/workbooks serializedData always set #244

Open mariussm opened 2 years ago

mariussm commented 2 years ago

Describe the noise

Resource type: Microsoft.Insights/workbooks

apiVersion: 2021-08-01 (For 2021-03-08, revision property is also noisy)

Client: Azure CLI - latest

Relevant code:

// Please edit name
@description('The friendly name for the workbook that is used in the Gallery or Saved List.  This name must be unique within a resource group.')
param workbookDisplayName string = 'DEMO'

// Please edit this guid, by generating a unique one
@description('The unique guid for this workbook instance')
param workbookId string = 'f03234b2-f560-4086-8763-1e66de1c35ef'

// Please update the whole variable by replacing with content from another bicep file
var workbookContent = {
  version: 'Notebook/1.0'
  items: [
    {
      type: 1
      content: {
        json: '# Header'
      }
      name: 'text - 2'
    }
    {
      type: 3
      content: {
        version: 'KqlItem/1.0'
        query: 'where type == "microsoft.logic/workflows" |\r\nproject id, resourceGroup, subscriptionId'
        size: 0
        queryType: 1
        resourceType: 'microsoft.resourcegraph/resources'
      }
      name: 'query - 3'
    }
    {
      type: 1
      content: {
        json: '# What to do with affected services?\r\n\r\nMap which services are using the database or something\r\n\r\nRun the following script:\r\n\r\n```PowerShell\r\naz roll9over key....\r\n```'
      }
      name: 'text - 3'
    }
  ]
  isLocked: false
  fallbackResourceIds: [
    '/subscriptions/cf52a112-fbee-4377-807b-cca5820bc0af/resourcegroups/kakao-d-rg-sentinel/providers/microsoft.operationalinsights/workspaces/kakao-d-log-sentinel'
  ]
  fromTemplateId: 'sentinel-UserWorkbook'
}

@description('The id of resource instance to which the workbook will be associated')
param workbookSourceId string

resource workbookId_resource 'microsoft.insights/workbooks@2021-08-01' = {
  name: workbookId
  location: resourceGroup().location
  kind: 'shared'
  properties: {
    displayName: workbookDisplayName
    serializedData: string(workbookContent)
    version: 'Notebook/1.0'
    sourceId: workbookSourceId
    category: 'sentinel'
  }
  dependsOn: []
}

output workbookId string = workbookId_resource.id

Expected response

I expect no noise on second deployment, as there are no changes in serializedData. However, I am seeing a change happening regardless of changes.

Current (noisy) response

What-If contains the same add "properties.serializedData" every time, which causes irritation in CICD pipelines with the "apply" stage always triggering, as we check for pending changes .

image

mathieugourves commented 1 year ago

Same problem

christianacca commented 7 months ago

Here too