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

Made akvName contain random string #176

Merged
merged 7 commits into from
Feb 9, 2022
Merged

Conversation

aszego
Copy link
Contributor

@aszego aszego commented Jan 7, 2022

PR Summary

Key Vault's name must be unique across Azure, and previous naming didn't contain a call to uniquestring().
I use the same implementation as with acrName.

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • This PR is ready to merge and is not Work in Progress
  • Link to a filed issue

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution, one of the team will evaluate shortly.

@Gordonby
Copy link
Collaborator

Gordonby commented Jan 8, 2022

Can you run the bicep build action in your repo to generate the compiled bicep please?
We'll need this as part of the PR, otherwise things get out of sync.

Generated via BicepBuild action.
Copy link
Collaborator

@Gordonby Gordonby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resourceName can be up to 20 characters in length.

Key Vault has a limit of 24 characters for its name.

This means by adding UniqueString() as a suffix, we're going to run this risk of going over the limit. We should ensure that we don't go over 24 characters.

I think you'll need something like this..

var akvRawName = 'kv-${replace(resourceName, '-', '')}${uniqueString(resourceGroup().id, resourceName)}'
var akvName = length(akvRawName) > 24 ? substring(akvRawName ,0,23) : akvRawName

@aszego - thoughts?

aszego and others added 5 commits January 19, 2022 21:57
Key Vault has a limit of 24 characters for its name.
This means by adding UniqueString() as a suffix, we're going to run this risk of going over the limit. We should ensure that we don't go over 24 characters.
@Gordonby
Copy link
Collaborator

Gordonby commented Feb 9, 2022

Fixed up PR;

  • Updating from main
  • Resolved conflicts
  • Tested KV name creation/truncation

Looks good.
image

@Gordonby Gordonby merged commit 23715ca into Azure:main Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants