-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 support for selectors and overrides in Azure Policy CRUD cmdlets #26031
Conversation
…olicyAssignment Implement ResourceSelector parameter for New/Update-AzPolicyExemption Add new tests for selectors and overrides Add new examples for selectors and overrides
️✔️Az.Accounts
|
Type | Cmdlet | Description | Remediation |
---|---|---|---|
Get-AzADGroupOwner | Get-AzADGroupOwner Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzADGroupOwner | Get-AzADGroupOwner changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. | |
Get-AzADServicePrincipalAppRoleAssignment | Get-AzADServicePrincipalAppRoleAssignment Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzADServicePrincipalAppRoleAssignment | Get-AzADServicePrincipalAppRoleAssignment changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. | |
Get-AzPolicyAssignment | Get-AzPolicyAssignment Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzPolicyAssignment | Get-AzPolicyAssignment changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. | |
Get-AzPolicyDefinition | Get-AzPolicyDefinition Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzPolicyDefinition | Get-AzPolicyDefinition changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. | |
Get-AzPolicyExemption | Get-AzPolicyExemption Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzPolicyExemption | Get-AzPolicyExemption changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. | |
Get-AzPolicySetDefinition | Get-AzPolicySetDefinition Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. | Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue | |
Get-AzPolicySetDefinition | Get-AzPolicySetDefinition changes the confirm impact. Please ensure that the change in ConfirmImpact is justified | Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. |
⚠️ Help Example Check
⚠️ PowerShell Core - Windows
Type Cmdlet Example Line RuleName Description Extent Remediation ⚠️ New-AzPolicyAssignment 9 3 Mismatched_Parameter_Value_Type New-AzPolicyAssignment -PolicyDefinition $Policy is not an expected parameter value type. -PolicyDefinition Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition.(Command). ⚠️ New-AzPolicyAssignment 10 4 Mismatched_Parameter_Value_Type New-AzPolicyAssignment -PolicyDefinition $Policy is not an expected parameter value type. -PolicyDefinition Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition.(Command). ⚠️ New-AzPolicyAssignment 11 5 Mismatched_Parameter_Value_Type New-AzPolicyAssignment -PolicyDefinition $Policy is not an expected parameter value type. -PolicyDefinition Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition.(Command). ⚠️ New-AzPolicyAssignment 12 13 Mismatched_Parameter_Value_Type New-AzPolicyAssignment -PolicyDefinition $Policy is not an expected parameter value type. -PolicyDefinition Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition.(Command). ⚠️ New-AzPolicyExemption 3 3 Mismatched_Parameter_Value_Type New-AzPolicyExemption -PolicyAssignment $Assignment is not an expected parameter value type. -PolicyAssignment Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyAssignment.(Command). ⚠️ New-AzPolicyExemption 4 3 Mismatched_Parameter_Value_Type New-AzPolicyExemption -PolicyAssignment $Assignment is not an expected parameter value type. -PolicyAssignment Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyAssignment.(Command). ⚠️ New-AzPolicyExemption 4 3 Unassigned_Variable New-AzPolicyExemption -Scope $SpecialVM.Id is a null-valued parameter value. -Scope Assign value for $SpecialVM.Id. ⚠️ New-AzPolicyExemption 5 3 Mismatched_Parameter_Value_Type New-AzPolicyExemption -PolicyAssignment $Assignment is not an expected parameter value type. -PolicyAssignment Use correct parameter value type. Expected Type is psobject. Now the type is Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyAssignment.(Command). ⚠️ Update-AzPolicyAssignment 10 3 Is_Alias Set-AzPolicyAssignment is an alias of 'Update-AzPolicyAssignment'. Set-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -EnforcementMode Default Use formal name 'Update-AzPolicyAssignment' of the alias 'Set-AzPolicyAssignment'. ⚠️ Update-AzPolicyAssignment 10 3 Mismatched_Parameter_Value_Type Set-AzPolicyAssignment -Id $PolicyAssignment.ResourceId is not an expected parameter value type. -Id Use correct parameter value type. Expected Type is string. Now the type is .(Command). ⚠️ Update-AzPolicyExemption 6 2 Is_Alias Set-AzPolicyExemption is an alias of 'Update-AzPolicyExemption'. Set-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration Use formal name 'Update-AzPolicyExemption' of the alias 'Set-AzPolicyExemption'. ⚠️ Update-AzPolicyExemption 6 2 Mismatched_Parameter_Value_Type Set-AzPolicyExemption -Id $PolicyExemption.ResourceId is not an expected parameter value type. -Id Use correct parameter value type. Expected Type is string. Now the type is .(Command).
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
⚠️ File Change Check
⚠️ PowerShell Core - Windows
Type Cmdlet Description Remediation ⚠️ It is required to update ChangeLog.md if you want to release a new version for Az.Resources. Add a changelog record under Upcoming Release section with past tense.
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
⚠️ Test
⚠️ - Linux
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.00 % Test coverage for the module cannot be lower than 50%.
⚠️ - MacOS
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.00% Test coverage for the module cannot be lower than 50%.
⚠️ PowerShell Core - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.00% Test coverage for the module cannot be lower than 50%.
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
/azp run |
Commenter does not have sufficient privileges for PR 26031 in repo Azure/azure-powershell |
@msJinLei - I've applied your feedback and removed the needs-revision label. Can you take another look? The CI check failures seem to be from checkers crashing: not sure how to debug that. |
You the files of |
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
@msJinLei - My last change should fix the test failures. Please take another look when you get a chance. |
```powershell | ||
{ | ||
'{ |
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.
Please remove the non-powershell content in the examples first and re-generate the module again
```powershell | ||
{ | ||
'{ |
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.
remove these lines
…zure#26031) * Implement ResourceSelector and Override parameters for New/Update-AzPolicyAssignment Implement ResourceSelector parameter for New/Update-AzPolicyExemption Add new tests for selectors and overrides Add new examples for selectors and overrides * Rerecord tests * Fix two examples to contain only powershell commands * Rebuild docs * Switch tag new tests as -LiveOnly
Description
Implement ResourceSelector and Override parameters for New/Update-AzPolicyAssignment
Implement ResourceSelector parameter for New/Update-AzPolicyExemption
Add new tests for selectors and overrides
Add new examples for selectors and overrides
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.