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

Error in privateLink.bicep naming of scope which is currently limited to 16 characters #527

Closed
shawngib opened this issue Nov 16, 2021 · 0 comments · Fixed by #533
Closed
Assignees
Labels
bug Something isn't working

Comments

@shawngib
Copy link
Member

Description

There is the potential of the 16 character substring function cutting the name for the private link scope off at a hyphen which is used in the naming of the log analytics workspace and then used in the naming of the scope. This ending in hyphen will cause deployment to fail. In addition the use of substring will fail if the combined log analytics workspace, 8 characters from unique id and prefix of plscope is not the length of the requirested substring. For example requesting a substring of 80 but the string only is 30 will error as well. These lines need re-evaluating :

var privateLinkConnectionName  = substring('plconn${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkEndpointName = substring('pl${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkScopeName = substring('plscope${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkScopeResourceName = substring('plscres${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)

Steps to Reproduce

Steps to reproduce the behavior:

  1. Deploy with long prefix

Screenshots

image

Additional context

Consider:

var privateLinkConnectionName  = take('plconn${logAnalyticsWorkspaceName }${uniqueData}', 80)
var privateLinkEndpointName = take('pl${logAnalyticsWorkspaceName }${uniqueData}', 80)
var privateLinkScopeName = take('plscope${logAnalyticsWorkspaceName }${uniqueData}', 80)
var privateLinkScopeResourceName = take('plscres${logAnalyticsWorkspaceName }${uniqueData}', 80)

Operating System:
Terraform Version:
Cloud (public, Azure Government, etc.):

@shawngib shawngib added the bug Something isn't working label Nov 16, 2021
@shawngib shawngib added this to the Resource Naming milestone Nov 16, 2021
@shawngib shawngib self-assigned this Nov 16, 2021
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.

1 participant