fix: [[, double effect, empty default #1705
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed double square brackets "[[parameters".
Fixed double "effect, effect1", removed "effect1". Fixed "defaultValue": "" and removed it, since all parameters are really required.
Overview/Summary
The updated template can be deployed via the REST API without an error. Also, it will show the parameters correctly in the Azure portal.
This PR fixes/adds/changes/removes
Breaking Changes
Testing Evidence
When deployed with "[[parameters" syntax error, the REST API throws this error:
url:
https://learn.microsoft.com/en-us/rest/api/policy/policy-set-definitions/create-or-update?view=rest-policy-2023-04-01&tabs=HTTP&tryIt=true&source=docs#code-try-0
body:
{
"error": {
"code": "UnusedPolicyParameters",
"message": "The policy set '' has defined parameters 'azureFilePrivateDnsZoneId,azureAutomationWebhookPrivateDnsZoneId,azureAutomationDSCHybridPrivateDnsZoneId,azureCosmosSQLPrivateDnsZoneId,azureCosmosMongoPrivateDnsZoneId,azureIotCentralPrivateDnsZoneId,azureStorageTablePrivateDnsZoneId,azureStorageTableSecondaryPrivateDnsZoneId,azureSiteRecoveryBackupPrivateDnsZoneID,azureSiteRecoveryBlobPrivateDnsZoneID,azureSiteRecoveryQueuePrivateDnsZoneID' which are not used in referenced policy definitions. Please either remove these parameters from the definition or ensure that they are used."
}
}
When deployed with "effect" and "effect1", it will show double in the Azure portal:
![image](https://private-user-images.githubusercontent.com/16253984/347761576-dd647e08-d07e-4808-983e-d649554223f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1NjE3NjQsIm5iZiI6MTcyMzU2MTQ2NCwicGF0aCI6Ii8xNjI1Mzk4NC8zNDc3NjE1NzYtZGQ2NDdlMDgtZDA3ZS00ODA4LTk4M2UtZDY0OTU1NDIyM2Y0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEzVDE1MDQyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0NzJkZDMzYjAwZTU2NWNhNjcwZDJiY2ExOTlhOTYyOTc4M2VkNzIxMWY1YjdmOTY1MjAyMTgxZjExMTUxODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.d-AmWc5QKlV9y3WH80hwE_jV8RBSwQg_k2IYHhFHFNA)
When deployed with "defaultValue": "", it will not show the parameters in the Azure portal, even though they are really required:
![image](https://private-user-images.githubusercontent.com/16253984/347762044-9634110b-72a8-42bc-89ba-af141413bd6b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1NjE3NjQsIm5iZiI6MTcyMzU2MTQ2NCwicGF0aCI6Ii8xNjI1Mzk4NC8zNDc3NjIwNDQtOTYzNDExMGItNzJhOC00MmJjLTg5YmEtYWYxNDE0MTNiZDZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEzVDE1MDQyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZjMGE5OGQ4OTE1YTM3ZGUzMGUwNzE4NzFhZmM0MTU5OTBhZTlhYTE1MjIzNjE0ZmNlNGU4MmNhY2ZjODlmYzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PTsyBJ95F9VbrDP41SNyQaIA_bG7JBnKOHOvA26ZgLQ)
The fixed version can be deployed trough the REST API, plus it will show the parameters correctly and the effect shows up only once:
![image](https://private-user-images.githubusercontent.com/16253984/347763031-cf20ae8d-40a1-41f3-8950-16194c30be10.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1NjE3NjQsIm5iZiI6MTcyMzU2MTQ2NCwicGF0aCI6Ii8xNjI1Mzk4NC8zNDc3NjMwMzEtY2YyMGFlOGQtNDBhMS00MWYzLTg5NTAtMTYxOTRjMzBiZTEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEzVDE1MDQyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUwMTNiYjk1ZTg4Zjk1ZDdjZjUzMzI1NzZjOWZiODlmYjRjNWZkMWIzYzFkNzQyMGEzZTg0NzI4ZGQ5N2YzODAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yEyMdLDJuLjn48IRpU3ZI7Xhvn_aygDi-XFFdwieMFA)
Azure Public
[
](https://portal.azure.com/#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2FeslzArm.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2Feslz-portal.json)
Azure US Gov (Fairfax)
[
](https://portal.azure.us/#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2FeslzArm.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2Ffairfaxeslz-portal.json)
As part of this Pull Request I have
main
branch/docs/wiki/whats-new.md
)