Skip to content

Commit 4d08857

Browse files
mentat9dolauliYanaXumsJinLei
authored
Add warnings for future breaking changes in Az.Resources policy CRUD … (#24266)
* Update code-gen.yml (#24251) Use Pwsh for codegen * Add warnings for future breaking changes in Az.Resources policy CRUD cmdlets (#22691) * Get-AzPolicyAlias: optmize common path for single namespace * Update changelog. * Fox for #15828 * Update changelog * Add breaking change warnings to Policy CRUD cmdlets. * Minor changelog correction * Added per-cmdlet information about upcoming changes Corrected deprecation version per feedback * update changelog --------- Co-authored-by: Chris Stackhouse <[email protected]> * Update ChangeLog.md --------- Co-authored-by: Xiaogang <[email protected]> Co-authored-by: Yan Xu <[email protected]> Co-authored-by: Jin Lei <[email protected]>
1 parent beda78b commit 4d08857

14 files changed

+38
-0
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
9595
git push origin codegen/${{ parameters.ServiceName }} --force;
9696
arguments: '-RequiredPsVersion $(PSVersion)'
97+
pwsh: true
9798
- pwsh: |
9899
$SourceBranch = "$(Build.SourceBranch)"
99100
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")

src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyAssignment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2727
/// <summary>
2828
/// Gets the policy assignment.
2929
/// </summary>
30+
[CmdletOutputBreakingChangeWithVersion(
31+
typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
32+
NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
3033
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet), OutputType(typeof(PsPolicyAssignment))]
3134
public class GetAzurePolicyAssignmentCmdlet : PolicyCmdletBase
3235
{

src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyDefinition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2929
/// <summary>
3030
/// Gets the policy definition.
3131
/// </summary>
32+
[CmdletOutputBreakingChangeWithVersion(
33+
typeof(PsPolicyDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
34+
NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Mode", "Parameters", "PolicyRule", "PolicyType" })]
3235
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyDefinition))]
3336
public class GetAzurePolicyDefinitionCmdlet : PolicyCmdletBase
3437
{

src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyExemption.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2727
/// <summary>
2828
/// Gets the policy exemption.
2929
/// </summary>
30+
[CmdletOutputBreakingChangeWithVersion(
31+
typeof(PsPolicyExemption), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
32+
NewOutputProperties = new[] { "Description", "DisplayName", "ExemptionCategory", "ExpiresOn", "Metadata", "PolicyAssignmentId", "PolicyDefinitionReferenceIds" })]
3033
[Cmdlet(VerbsCommon.Get, AzureRMConstants.AzureRMPrefix + "PolicyExemption", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyExemption))]
3134
public class GetAzurePolicyExemptionCmdlet : PolicyCmdletBase
3235
{

src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicySetDefinition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2929
/// <summary>
3030
/// Gets the policy set definition.
3131
/// </summary>
32+
[CmdletOutputBreakingChangeWithVersion(
33+
typeof(PsPolicySetDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
34+
NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Parameters", "PolicyDefinitionGroups", "PolicyDefinitions", "PolicyType" })]
3235
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicySetDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicySetDefinition))]
3336
public class GetAzurePolicySetDefinitionCmdlet : PolicyCmdletBase
3437
{

src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyAssignment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
3434
/// <summary>
3535
/// Creates a policy assignment.
3636
/// </summary>
37+
[CmdletOutputBreakingChangeWithVersion(
38+
typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
39+
NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
3740
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet), OutputType(typeof(PsPolicyAssignment))]
3841
public class NewAzurePolicyAssignmentCmdlet : PolicyCmdletBase, IDynamicParameters
3942
{

src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyDefinition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2828
/// <summary>
2929
/// Creates the new policy definition.
3030
/// </summary>
31+
[CmdletOutputBreakingChangeWithVersion(
32+
typeof(PsPolicyDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
33+
NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Mode", "Parameters", "PolicyRule", "PolicyType" })]
3134
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyDefinition))]
3235
public class NewAzurePolicyDefinitionCmdlet : PolicyCmdletBase
3336
{

src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyExemption.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2929
/// <summary>
3030
/// Creates a policy exemption.
3131
/// </summary>
32+
[CmdletOutputBreakingChangeWithVersion(
33+
typeof(PsPolicyExemption), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
34+
NewOutputProperties = new[] { "Description", "DisplayName", "ExemptionCategory", "ExpiresOn", "Metadata", "PolicyAssignmentId", "PolicyDefinitionReferenceIds" })]
3235
[Cmdlet(VerbsCommon.New, AzureRMConstants.AzureRMPrefix + "PolicyExemption", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicyExemption))]
3336
public class NewAzurePolicyExemptionCmdlet : PolicyCmdletBase
3437
{

src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicySetDefinition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2727
/// <summary>
2828
/// Creates the policy set definition.
2929
/// </summary>
30+
[CmdletOutputBreakingChangeWithVersion(
31+
typeof(PsPolicySetDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
32+
NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Parameters", "PolicyDefinitionGroups", "PolicyDefinitions", "PolicyType" })]
3033
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicySetDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicySetDefinition))]
3134
public class NewAzurePolicySetDefinitionCmdlet : PolicyCmdletBase
3235
{

src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyAssignment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
3232
/// <summary>
3333
/// Sets the policy assignment.
3434
/// </summary>
35+
[CmdletOutputBreakingChangeWithVersion(
36+
typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
37+
NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
3538
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyAssignment))]
3639
public class SetAzurePolicyAssignmentCmdlet : PolicyCmdletBase
3740
{

0 commit comments

Comments
 (0)