Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.72k stars 980 forks source link

Bug Report: Incorrect parameter type and default value for ambaAgServiceHook #1792

Closed jdrepo closed 2 weeks ago

jdrepo commented 1 month ago

Describe the bug There seems to be an incorrect parameter type and default value for ambaAgServiceHook.

Steps to reproduce

  1. Deploy reference implemenation
  2. Remediation of policy "Deploy AMBA Notification Assets" fails
  3. Error message "'Service Uri' must not be empty. (Code: BadRequest)"

Screenshots

Image

Seems to me that there is an incorrect parameter

Image

Fix

Image

Can provide pull request if needed

arjenhuitema commented 1 month ago

Hi @jdrepo, Thank you for your feedback; I will look into the issue. I believe that no changes are necessary to the type, as the parameter ambaAgServiceHookis provided as an array to the ALZWebhookServiceUriparameter within the AMBA template.

                    "ALZWebhookServiceUri": {
                        "value": "[array(parameters('ambaAgServiceHook'))]"
                    },

Thanks for offering to submit a PR, but please hold off for now while I investigate the cause of the issue.

jdrepo commented 1 month ago

Hi @arjenhuitema, thanks for the reply. May be fixing the default value is enough...

jdrepo commented 1 month ago

@arjenhuitema , did you find anything about this issue ?

arjenhuitema commented 3 weeks ago

Hi @jdrepo,

The problem occurs when no email address or service hook is specified on the Baseline alerts and monitoring tab. The empty string was converted to a malformed array, [""] instead of []. This caused the errors you mentioned.

A pull request has been submitted that resolves the issue by conditionally specifying the value that is to be passed to the policy assignment.

The issue has been linked to the PR, so it will be closed upon merging the PR.

Please feel free to reach out if you have any questions or comments.