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

Add a name length check when using the filename to name an assignment. #1

Closed
GPugnet opened this issue Dec 7, 2018 · 4 comments
Closed

Comments

@GPugnet
Copy link

GPugnet commented Dec 7, 2018

Context :
When an assignment has no name, the script use the filename to generate the assignment name.
Then the name is used to generate the assignment ID.

Issue :
If the name exceeds a maximum length of 48, the API returns a (400) Bad Request.
The script does not provide details about the issue.

Suggested fix :
Add a control and raise an error when using a filename longer than 48 characters.
Display more details about the API errors. In this case, the API returns an explicit error message we could display :

"error": {
        "code": "InvalidResourceName",
        "message": "The resource name 'policyAssignmentAF_ResourcesGroup_AuditMandatoryTags' exceeds the maximum length of 48."
    }
@JimGBritt
Copy link
Owner

Great feedback. Let me investigate what the best options are here.

@JimGBritt
Copy link
Owner

@GPugnet - I have validated with the Blueprint team that this specific limit is not an ARM limit but a limit imposed by the Blueprint feature. I'm working on adding some additional validation to ensure that if we hit this limit during import / export that we throw an error and terminate. Thanks for raising this up. Will be integrating a fix shortly and publish.

JimGBritt added a commit that referenced this issue Jan 4, 2019
   LAST EDIT: January 04, 2019 - version 2.2
   * Added ModuleMode to the parameters to allow for supporting AzureRM and Az module sets
     Thank you Florent APPOINTAIRE (@florent_app) for the feedback and additional inputs for supporting Az modules  
   * Added validation that all blueprint and artifact names are less than or equal to the maximim of 48 characters
     Thank you for your great inputs on these updates Guillaume Pugnet (@PugnetGuillaume)!
     #1
@JimGBritt
Copy link
Owner

@GPugnet could you please review the latest merged version to see if it supports the requirement? I have also added the ability to run the script on PS CORE with a moduleMode parameter so that you can leverage the Az versus AzureRM Module set.

@JimGBritt
Copy link
Owner

Validated character limit being honored and error thrown on failure. Closing this issue.

JimGBritt pushed a commit that referenced this issue Apr 27, 2020
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

No branches or pull requests

2 participants