Azure-sdk-for-net: Blueprint module does not accept ResourceGroup.Name values with long computed expressions

Created on 12 Apr 2020  路  7Comments  路  Source: Azure/azure-sdk-for-net

Describe the bug
Receiving a validation error through the Az.BluePrint powershell module regarding the importing of a Blueprint with a computed ResourceGroup.name value. The error indicates only 90 characters are supported in the resource group name. However, this is not actually true as the value allows [] expansion values exceeding 90 characters.

Expected behavior
The computable value should be accepted.

Actual behavior (include Exception or Stack Trace)
Import-AzBlueprintWithArtifact : 'Name' exceeds maximum length of '90'.

To Reproduce

    "resourceGroups": {
            "ApplicationResourceGroup": {
                "location": "[parameters('l')]",
                "name": "[concat(parameters('u'),'-',parameters('e'),'-',parameters('d'),'-',parameters('a'),'-rg')]"
            }
        }

Attempt to import the Blueprint, and receive the error.

Blueprint Service Attention customer-reported question

All 7 comments

azure/azure-powershell#11552 Is the associated Az Powershell issue.

The error is in blueprint/Microsoft.Azure.Management.Blueprint/src/Generated/Models/ResourceGroupDefinition.cs:Validate. I would love to fix it, but since the file is generated, I'm not sure of the best way to approach it. I do not know how it was generated, or what the proper procedure to override it is.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @alex-frankel, @filizt.

closing this issue as it is not related to the SDK

I'm running into the same issue while running Az.Blueprint module version 0.2.13. I didn't try every older version of the module/cmdlet, but I did install these older versions and ran into the same problem with each attempt:

  • 0.2.10
  • 0.2.6
  • 0.2.0

The cmdlet doesn't exist in versions 0.1.1 nor 0.1.0, so, no point in trying them 鈽癸笍

This is an issue with our APIs, not with the SDK. With the planned changes to move blueprint definitions to template specs, this is not likely something we are going to fix. We just announced templateSpecs at build, so details are a bit scarce, but we should have more info to share in 1-2 months.

Thanks for the information @alex-frankel; I caught that announcement and look forward to template specs!

As a workaround, I simply shortened some parameter names to get the string value of the function at or below 90 characters in length.. works fine otherwise.

Was this page helpful?
0 / 5 - 0 ratings