Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Deployment of nist80053r5 fails due to excessive deployment name length #225

Open
OutKa5t opened this issue Dec 20, 2022 · 0 comments
Open

Comments

@OutKa5t
Copy link
Contributor

OutKa5t commented Dec 20, 2022

Describe the bug
The deployment name assigned to the defaultTelemetry resource in policy-nist80053r5.bicep can break the maximum length of 64.

name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-nist-80053-r5-${uniqueString(deployment().name, parLocation)}'

See https://github.com/Azure/NoOpsAccelerator/blob/main/src/bicep/overlays/Policy/builtin/assignments/policy-nist80053r5.bicep#L33

To Reproduce
Steps to reproduce the behavior:

  1. run the following CLI (requires management groups in place and location variable set)
    az deployment mg create --name 'deploy-policy-nistr5' --template-file 'policy-nist80053r5.bicep' --parameters 'policy-nist80053r5.parameters.json' --management-group-id 'ANOA' --location $location --only-show-errors
  2. The combination of the telemetry and unique string produces a length that can break the ARM deployment name limits and an error occurs. For example:

"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"InvalidDeployment\",\r\n \"message\": \"The provided deployment name 'pid-xxxxxxxx-xxxx-xxxx-xxxx-c835c15402da-nist-80053-r5-ang7khtuipkgs' has a length of '68' which exceeds the maximum length of '64'. Please see https://aka.ms/arm-deploy for usage details.\"\r\n }\r\n}"}]}}

Expected behavior
The deployment completes successfully deploying the policy.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows
  • Browser N/A
  • Version N/A

Smartphone (please complete the following information if applicable):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Software versions used:

  • E.g. Azure CLI version [e.g. v2.23.0]
  • Azure Bicep version [e.g. v0.4.613]

Additional context
Add any other context about the problem here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant