Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BICEP: Autogenerated deployment name in NewWorkload template exceeds max length #393

Closed
timothysprock opened this issue Sep 3, 2021 · 2 comments · Fixed by #572
Closed
Assignees
Labels
bug Something isn't working

Comments

@timothysprock
Copy link

Goal: Deploy the NewWorkload template using the .json file.

Issue: Autogenerated deployment name in NewWorkload template exceed max length, so it fails to deploy the virtual peerings to the hub

Template Input: a new workload name that is less than 24 characters (aisSharedServices)

Error Output:
The provided deployment name 'aisSharedServicesbimsfltmjeeds-aisSharedServicesVirtualNetworkPeerings' has a length of '70' which exceeds the maximum length of '64'. Please see https://aka.ms/arm-deploy for usage details. (Code: InvalidDeployment)

See line:

"type": "Microsoft.Resources/deployments",

Temp Solution/Workaround:
I was able to successfully deploy the template by changing line 119 to:
"name": "[format('{0}-{1}VirtualNetworkPeerings', parameters('workloadName'), parameters('workloadName'))]",

Then the concat deployment name in this case is aisSharedServices-aisSharedServicesVirtualNetworkPeerings. However, with a 24 character limit on the workload name, one could still run into a "exceed max character" error

@glennmusa glennmusa added the bug Something isn't working label Sep 7, 2021
@glennmusa
Copy link
Contributor

Thanks for opening an issue @timothysprock! Marking this as a bug and as something to fix.

Until the team is able to commit a fix, I might give the take() function a try for your max character error.

@brooke-hamilton
Copy link
Contributor

@ExchMaster if the fix is something like using the take() function to limit the character length in the name, please also apply the same fix to mlz.bicep in which the spoke name is used to calculate a module name property. The spoke names can be overridden and could potentially cause the same issue as described in this bug.

@brooke-hamilton brooke-hamilton changed the title BICEP: Autogenerated deployment name in NewWorkload template exceed max length BICEP: Autogenerated deployment name in NewWorkload template exceeds max length Nov 29, 2021
@glennmusa glennmusa linked a pull request Dec 15, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants