Azure / avdaccelerator

AVD Accelerator deployment automation to simplify the setup of AVD (Azure Virtual Desktop) based on best practices
MIT License
305 stars 198 forks source link

[Bug] AVD Monitoring - failed deployments when avdDeployMonitoring is set to false #620

Closed pazdedav closed 2 weeks ago

pazdedav commented 3 weeks ago

What happened? Provide a clear and concise description of the bug, including deployment details.

When deploying the AVD baseline using the bicep 'flavour', we are setting the following values for 'Baseline AVD module':

We don't want the accelerator to configure the environment for monitoring because we have a set of robust Azure policies that centrally takes care of both AMA extensions for session hosts and diag. settings for other resources. We don't want to provision a separate LA workspace and we dont' want to reference an existing one.

The deployment fails on 'SH-Batch-xxx' sub-deployment (session hosts) due to TemplateViolation error (see below).

Based on our troubleshooting, it seems the issue is in workload/bicep/modules/avdSessionHosts/deploy.bicep, lines 292-295, where a resourceId is parsed but since it's getting an empty string, that expression fails, but there could be other reasons.

Please provide the correlation id associated with your error or bug.

57b81c7c-9c63-4e8b-a9f1-62bd30b4a0da

What was the expected outcome?

We want to be able to skip a deployment of monitoring components completely. We have a robust policy engine that centrally takes care of both AMA extensions for session hosts and diag. settings for other resources.

Relevant log output

{
  "code": "InvalidTemplate",
  "message": "Deployment template validation failed: 'The template resource '' at line '1' and column '12588' is not valid: The language expression property array index '2' is out of bounds.. Please see https://aka.ms/arm-functions for usage details.'.",
  "additionalInfo": [
    {
      "type": "TemplateViolation",
      "info": {
        "lineNumber": 1,
        "linePosition": 12588,
        "path": "properties.template.resources.alaWorkspace"
      }
    }
  ]
}
danycontre commented 3 weeks ago

Thanks @pazdedav for the feedback, we are checking.

danycontre commented 3 weeks ago

@pazdedav we continue to troubleshoot, in the meantime, please go inside the failed deployment SH-Batch* and provide details on which internal deployment failed.

pazdedav commented 3 weeks ago

This is what I see on the 'AVD Baseline' deployment level: image

However, when I try to open the SH-Batch deployment, it doesn't show nested deployments, only this: image

danycontre commented 3 weeks ago

@pazdedav thanks for the info, we have been trying to replicate the issue but no luck so far.

Please share the parameters you are using for the deployment (please redact the credentials related ones).