-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(scripts): correct and prettify copy kv secrets script #15
fix(scripts): correct and prettify copy kv secrets script #15
Conversation
The linter throws the following error messages:
Messages formatted for readability:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think structurally this looks good 👍
Even though the linter throws an error on something that was implemented before your changes, I'd look into if it's something we could implement to stop it from complaining, or worst case ignore it (and add a comment clarifying why we ignore it).
The linter simply outputs a warning related to the verb used in this custom function:
To mitigate I will try to use a verb that supports |
Used Marshal Class to mitigate the following linter error:
Not entirely familiar with the extended use of this but the linter seems happy. Code block with the changes in question: ops-automation/scripts/powershell/Copy-AzKeyVaultSecret.ps1 Lines 138 to 145 in dac702e
References |
Changing custom function name from |
Reverted these changes. After testing a million different scenarios, we concluded that for now the workaround for handling key vault secrets as Encrypted Standard Strings (ESS) instead of secure strings converted to plaintext did not work. This is because even though the secret name and value are identical in both source and target key vaults, the ESS value changes after every time the command is being run, and the ESS value for target and source KV secret is not identical. In conclusion, the linter can keep complaining, as we have not yet found a workaround. |
Everything, except runbook, have been tested so this PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :D
Original issue was that when running the script we got the following warning:
This refers to the custom fuction
Set-AzSubscription
on line 97. I believe the issue was that the custom function name was too similar to an actual built-in Azure PowerShell cmdlet, which does not exist. To fix this I just changed the custom function name fromSet-AzSubscription
toSet-SubscriptionContext
, and updated the references.Simultaneously I did some formatting, added some comments and updated the parameter names.
Testing