Azure / bicep-registry-modules

Bicep registry modules
MIT License
452 stars 298 forks source link

[AVM Module Issue]: Availability test edit in Azure portal throws an exception if the test is provisioned with "webtest" AVM #2692

Closed guidemetothemoon closed 2 weeks ago

guidemetothemoon commented 1 month ago

Check for previous/existing GitHub issues

Issue Type?

Bug

Module Name

avm/res/insights/webtest

(Optional) Module Version

0.1.5

Description

If you provision an availability test with "webtest" AVM and attempt to edit the test in Azure portal after it's created, following exception is thrown:

Summary
Session ID
8026b790a8d4439b8097607c8bb45b8f
Resource ID
Not available
Extension
AppInsightsExtension
Content
CreateWebTestNopdlBlade
Error code
--
Details
message: Unable to process binding "ifnot: function(){return isLimitedEnvironment() }" 
Message: Unable to process binding "pcControl: function(){return accordion }" 
Message: accordion is not defined name: ReferenceError stack: 
ReferenceError: accordion is not defined at pcControl (eval at <anonymous> (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:6800), <anonymous>:3:62) 
at r (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:7336) at https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:10658 
at n (https://portal.azure.com/Content/Dynamic/T6Egc4C9B2ts.js:28:3058) at r (https://portal.azure.com/Content/Dynamic/T6Egc4C9B2ts.js:28:3297) 
at init (https://portal.azure.com/Content/Dynamic/T6Egc4C9B2ts.js:28:3731) at https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:11180 
at Object.ignore (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:11243) at p (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:11153) 
at u (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:8085) at i (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:7905) 
at Object.applyBindingsToDescendants (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:12436) at https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:22762 
at Function.evaluateImmediate_CallReadThenEndDependencyDetection (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:29272) 
at Function.evaluateImmediate_CallReadWithDependencyDetection (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:28765) 
at Function.evaluateImmediate (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:28283) 
at Object.dependentObservable (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:26425) at init (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:22484) 
at https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:11180 at Object.ignore (https://portal.azure.com/Content/Dynamic/qUqF8XzAdlSx.js:43:11243) 
at p (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:11153) at u (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:8085) 
at i (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:7905) at u (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:8154) 
at i (https://portal.azure.com/Content/Dynamic/_Uy1nDUTmXVH.js:37:7905)

I did investigation for this and identified that this is due to the fact that, if XML configuration is not provided as part of the AVM implementation (i.e. Configuration { WebTest: <webtest_xml_configuration> } the AVM will still send an empty Configuration object to the underlying Bicep resource for the webtest (i.e. Configuration: {}) which causes the exception to be thrown upon edit in the UI. If I declare a Bicep resource for webtest WITHOUT AVM and DON'T provide a Configuration object, I'm able to successfully edit the availability test after it's created.

I think that the solution here would be to not send Configuration property at all to the underlying Bicep resource for webtest if it's empty. Or a fix may be needed in the Azure portal to handle empty Configuration property on the availability test.

(Optional) Correlation Id

No response

microsoft-github-policy-service[bot] commented 1 month ago

[!IMPORTANT] The "Needs: Triage :mag:" label must be removed once the triage process is complete!

[!TIP] For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

avm-team-linter[bot] commented 1 month ago

@guidemetothemoon, thanks for submitting this issue for the avm/res/insights/webtest module!

[!IMPORTANT] A member of the @Azure/avm-res-insights-webtest-module-owners-bicep or @Azure/avm-res-insights-webtest-module-contributors-bicep team will review it soon!

microsoft-github-policy-service[bot] commented 1 month ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 1 month ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 1 month ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
microsoft-github-policy-service[bot] commented 4 weeks ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 4 weeks ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
JFolberth commented 4 weeks ago

Thanks @guidemetothemoon for the additional context! I own the module; however, I think you pose a valid question on if the AVM module should be updated or is this a bug in the Azure portal. I will reach out to someone on the core team directly to get their feedback and see if the AVM team has come across this type of scenario previously and if so what action was taken.

JFolberth commented 2 weeks ago

Just to close the thought process here out. After talking with the core team decision was to attempt to set the XML Configuration object to null by default and see if the Resource Provider would allow for this. In theory, this would work around the situation where the portal is trying to update a defined empty XML Configuration object.