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/webtests #195

Closed slavizh closed 3 years ago

slavizh commented 3 years ago

Describe the noise

Resource type (i.e. Microsoft.Storage/storageAccounts) Microsoft.Insights/webtests

apiVersion (i.e. 2019-04-01) 2018-05-01-preview

Client (PowerShell, Azure CLI, or API) PS

Relevant ARM Template code (we only need the resource object for the above resourceType and apiVersion, but if it's easier you can include the entire template

"webTestConfigSampleString": "<WebTest         Name=\"dummyTestName\"         Id=\"dummyGUID1\"         Enabled=\"dummyEnabledValue\"         CssProjectStructure=\"\"         CssIteration=\"\"         Timeout=\"dummyTimeoutValue\"         WorkItemIds=\"\"         xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\"         Description=\"\"         CredentialUserName=\"\"         CredentialPassword=\"\"         PreAuthenticate=\"True\"         Proxy=\"default\"         StopOnError=\"False\"         RecordedResultFile=\"\"         ResultsLocale=\"\">        <Items>        <Request         Method=\"GET\"         Guid=\"dummyGUID2\"         Version=\"1.1\"         Url=\"dummyURL\"         ThinkTime=\"0\"         Timeout=\"dummyTimeoutValue\"         ParseDependentRequests=\"dummyDependentRequests\"         FollowRedirects=\"True\"         RecordResult=\"True\"         Cache=\"False\"         ResponseTimeGoal=\"0\"         Encoding=\"utf-8\"         ExpectedHttpStatusCode=\"dummyHttpStatusCode\"         ExpectedResponseUrl=\"\"         ReportingName=\"\"         IgnoreHttpStatusCode=\"dummyIgnoreHttpStatusCodeValue\" />        </Items>",
        "webTestConfigSampleValidationRulesString": "        <ValidationRules>        <ValidationRule         Classname=\"Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"         DisplayName=\"Find Text\"         Description=\"Verifies the existence of the specified text in the response.\"         Level=\"High\"         ExectuionOrder=\"BeforeDependents\">        <RuleParameters>        <RuleParameter Name=\"FindText\" Value=\"dummyContentValue\" />        <RuleParameter Name=\"IgnoreCase\" Value=\"False\" />        <RuleParameter Name=\"UseRegularExpression\" Value=\"False\" />        <RuleParameter Name=\"PassIfTextFound\" Value=\"True\" />        </RuleParameters>        </ValidationRule>        </ValidationRules>",
        "webTestConfigSampleEndString": "        </WebTest>",
        "webTestProcessedString1": "[replace(
                variables( 'webTestConfigSampleString' ),
                'dummyTestName',
                variables( 'mergedAvailabilityPingTestObject' ).name
            )]",
        "webTestProcessedString2": "[replace(
                variables( 'webTestProcessedString1' ),
                'dummyGUID1',
                parameters( 'firstGuid' )
            )]",
        "webTestProcessedString3": "[replace(
                variables( 'webTestProcessedString2' ),
                'dummyEnabledValue',
                if( variables( 'mergedAvailabilityPingTestObject' ).enabled,
                    'True',
                    'False'
                )
            )]",
        "webTestProcessedString4": "[replace(
                variables( 'webTestProcessedString3' ),
                'dummyTimeoutValue',
                string( variables( 'mergedAvailabilityPingTestObject' ).timeout )
            )]",
        "webTestProcessedString5": "[replace(
                variables( 'webTestProcessedString4' ),
                'dummyGUID2', parameters( 'secondGuid' )
            )]",
        "webTestProcessedString6": "[replace(
                variables( 'webTestProcessedString5' ),
                'dummyURL',
                variables( 'mergedAvailabilityPingTestObject' ).url
            )]",
        "webTestProcessedString7": "[replace(
                variables( 'webTestProcessedString6' ),
                'dummyDependentRequests',
                if( variables( 'mergedAvailabilityPingTestObject' ).parseDependentRequests,
                    'True',
                    'False'
                )
            )]",
        "webTestProcessedString8": "[replace(
                variables( 'webTestProcessedString7' ),
                'dummyHttpStatusCode',
                string( variables( 'mergedAvailabilityPingTestObject' ).httpStatusCode )
            )]",
        "webTestProcessedString9": "[replace(
                variables( 'webTestProcessedString8' ),
                'dummyIgnoreHttpStatusCodeValue',
                if( equals( variables( 'mergedAvailabilityPingTestObject' ).httpStatusCode, 0 ),
                    'True',
                    'False'
                )
            )]",
        "webTestProcessedString10": "[replace(
                variables( 'webTestConfigSampleValidationRulesString' ),
                'dummyContentValue',
                variables( 'mergedAvailabilityPingTestObject' ).contentMatch
            )]",
        "webTestProcessedStringFinal": "[if( empty( variables( 'mergedAvailabilityPingTestObject' ).contentMatch ),
                concat(
                    variables( 'webTestProcessedString9' ),
                    variables( 'webTestConfigSampleEndString' )
                ),
                concat(
                    variables( 'webTestProcessedString9' ),
                    variables( 'webTestProcessedString10' ),
                    variables( 'webTestConfigSampleEndString' )
                )
            )]"
    },
    "resources": [
        {
            "name": "[concat( variables( 'mergedAvailabilityPingTestObject' ).name, '-', parameters( 'applicationInsights' ).name )]",
            "type": "Microsoft.Insights/webtests",
            "apiVersion": "[variables( 'apiVersions' ).webtests]",
            "location": "[resourceGroup().location]",
            "tags": "[union( parameters( 'tags' ), variables( 'tag' ) )]",
            "properties": {
                "SyntheticMonitorId": "[concat( variables( 'mergedAvailabilityPingTestObject' ).name, '-', parameters( 'applicationInsights' ).name )]",
                "Name": "[variables( 'mergedAvailabilityPingTestObject' ).name]",
                "Description": "",
                "Enabled": "[variables( 'mergedAvailabilityPingTestObject' ).enabled]",
                "Frequency": "[mul( 60, variables( 'mergedAvailabilityPingTestObject' ).frequency )]",
                "Timeout": "[variables( 'mergedAvailabilityPingTestObject' ).timeout]",
                "Kind": "ping",
                "RetryEnabled": "[variables( 'mergedAvailabilityPingTestObject' ).retries]",
                "Locations": "[variables( 'locations' )]",
                "Configuration": {
                    "WebTest": "[variables( 'webTestProcessedStringFinal' )]"
                }
            }
        },

Expected response (i.e. "I expected no noise since the template has not been modified since the resources were deployed)

no change in the property.

Current (noisy) response (either include a screenshot of the what-if output, or copy/paste the text)

  ~ Microsoft.Insights/webtests/test1-demoappb [2018-05-01-preview]
    ~ properties.Configuration.WebTest: "<WebTest         Name="test1"         Id="031fe2c0-10e3-4095-a982-532ce0416c30"         Enabled="True"         CssProjectStructure=""         CssIteration=""         Timeout="120"         WorkItemIds=""         xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"         Description=""         CredentialUserName=""         CredentialPassword=""         PreAuthenticate="True"         Proxy="default"         StopOnError="False"         RecordedResultFile=""         ResultsLocale="">        <Items>        <Request         Method="GET"         Guid="f526746e-a32e-493c-bbae-ff5ab4db2c60"         Version="1.1"         Url="https://microsoft.com"         ThinkTime="0"         Timeout="120"         ParseDependentRequests="True"         FollowRedirects="True"         RecordResult="True"         Cache="False"         ResponseTimeGoal="0"         Encoding="utf-8"         ExpectedHttpStatusCode="200"         ExpectedResponseUrl=""         ReportingName=""         IgnoreHttpStatusCode="False" />        </Items>        <ValidationRules>        <ValidationRule         Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"         DisplayName="Find Text"         Description="Verifies the existence of the specified text in the response."         Level="High"         ExectuionOrder="BeforeDependents">        <RuleParameters>        <RuleParameter Name="FindText" Value="microsoft" />        <RuleParameter Name="IgnoreCase" Value="False" />        <RuleParameter Name="UseRegularExpression" Value="False" />        <RuleParameter Name="PassIfTextFound" Value="True" />        </RuleParameters>        </ValidationRule>        </ValidationRules>        </WebTest>" => "<WebTest         Name="test1"         Id="c3870d93-176d-43b8-82db-99f5c0c28903"         Enabled="True"         CssProjectStructure=""         CssIteration=""         Timeout="120"         WorkItemIds=""         xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"         Description=""         CredentialUserName=""         CredentialPassword=""         PreAuthenticate="True"         Proxy="default"         StopOnError="False"         RecordedResultFile=""         ResultsLocale="">        <Items>        <Request         Method="GET"         Guid="86d0c1a4-737d-43fc-ae97-124d3e174e08"         Version="1.1"         Url="https://microsoft.com"         ThinkTime="0"         Timeout="120"         ParseDependentRequests="True"         FollowRedirects="True"         RecordResult="True"         Cache="False"         ResponseTimeGoal="0"         Encoding="utf-8"         ExpectedHttpStatusCode="200"         ExpectedResponseUrl=""         ReportingName=""         IgnoreHttpStatusCode="False" />        </Items>        <ValidationRules>        <ValidationRule         Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"         DisplayName="Find Text"         Description="Verifies the existence of the specified text in the response."         Level="High"         ExectuionOrder="BeforeDependents">        <RuleParameters>        <RuleParameter Name="FindText" Value="microsoft" />        <RuleParameter Name="IgnoreCase" Value="False" />        <RuleParameter Name="UseRegularExpression" Value="False" />        <RuleParameter Name="PassIfTextFound" Value="True" />        </RuleParameters>        </ValidationRule>        </ValidationRules>        </WebTest>"

Additional context Add any other context about the problem here.

slavizh commented 3 years ago

Closing. Not relevant. Issue is within my deployment.