From 981c5430ae10cfe00735d43cda594a8f02929c33 Mon Sep 17 00:00:00 2001 From: Yeming Liu Date: Wed, 25 Mar 2020 13:48:47 +0800 Subject: [PATCH 1/2] keyvault breaking change attribute --- src/KeyVault/KeyVault/ChangeLog.md | 2 + .../KeyVault/Commands/NewAzureKeyVault.cs | 38 ++++++++++--------- .../KeyVault/help/Add-AzKeyVaultKey.md | 2 +- src/KeyVault/KeyVault/help/Get-AzKeyVault.md | 6 +-- .../help/Get-AzKeyVaultCertificate.md | 4 +- .../help/Get-AzKeyVaultCertificateIssuer.md | 2 +- .../KeyVault/help/Get-AzKeyVaultKey.md | 4 +- .../Get-AzKeyVaultManagedStorageAccount.md | 2 +- .../KeyVault/help/Get-AzKeyVaultSecret.md | 4 +- 9 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/KeyVault/KeyVault/ChangeLog.md b/src/KeyVault/KeyVault/ChangeLog.md index 77c5b4b7fd9f..0ee0de1fe1d8 100644 --- a/src/KeyVault/KeyVault/ChangeLog.md +++ b/src/KeyVault/KeyVault/ChangeLog.md @@ -19,6 +19,8 @@ --> ## Upcoming Release +* Added breaking change attributes to `New-AzKeyVault` + ## Version 1.5.1 * Fixed duplicated text for Add-AzKeyVaultKey.md diff --git a/src/KeyVault/KeyVault/Commands/NewAzureKeyVault.cs b/src/KeyVault/KeyVault/Commands/NewAzureKeyVault.cs index 64bf99842ea4..9b36f5df3543 100644 --- a/src/KeyVault/KeyVault/Commands/NewAzureKeyVault.cs +++ b/src/KeyVault/KeyVault/Commands/NewAzureKeyVault.cs @@ -16,6 +16,7 @@ using Microsoft.Azure.Commands.KeyVault.Properties; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; using Microsoft.Azure.Management.KeyVault.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using System; using System.Collections; using System.Management.Automation; @@ -25,7 +26,8 @@ namespace Microsoft.Azure.Commands.KeyVault /// /// Create a new key vault. /// - [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KeyVault",SupportsShouldProcess = true)] + [GenericBreakingChange("Soft delete and purge protection will be enabled by default.", "2.0.0")] + [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KeyVault", SupportsShouldProcess = true)] [OutputType(typeof(PSKeyVault))] public class NewAzureKeyVault : KeyVaultManagementCmdletBase { @@ -81,11 +83,13 @@ public class NewAzureKeyVault : KeyVaultManagementCmdletBase HelpMessage = "If specified, enables secrets to be retrieved from this key vault by Azure Disk Encryption.")] public SwitchParameter EnabledForDiskEncryption { get; set; } + [CmdletParameterBreakingChange(nameof(EnableSoftDelete), ChangeDescription = "Soft delete will be enabled by default. We will add an option `-DisableSoftDelete` to disable it.")] [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "If specified, 'soft delete' functionality is enabled for this key vault.")] public SwitchParameter EnableSoftDelete { get; set; } + [CmdletParameterBreakingChange(nameof(EnablePurgeProtection), ChangeDescription = "Purge protection will be enabled by default. We will add an option `-DisablePurgeProtection` to disable it.")] [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "If specified, protection against immediate deletion is enabled for this vault; requires soft delete to be enabled as well.")] @@ -144,22 +148,22 @@ public override void ExecuteCmdlet() } var newVault = KeyVaultManagementClient.CreateNewVault(new VaultCreationParameters() - { - VaultName = this.Name, - ResourceGroupName = this.ResourceGroupName, - Location = this.Location, - EnabledForDeployment = this.EnabledForDeployment.IsPresent, - EnabledForTemplateDeployment = EnabledForTemplateDeployment.IsPresent, - EnabledForDiskEncryption = EnabledForDiskEncryption.IsPresent, - EnableSoftDelete = EnableSoftDelete.IsPresent, - EnablePurgeProtection = EnablePurgeProtection.IsPresent, - SkuFamilyName = DefaultSkuFamily, - SkuName = this.Sku, - TenantId = GetTenantId(), - AccessPolicy = accessPolicy, - NetworkAcls = new NetworkRuleSet(), // New key-vault takes in default network rule set - Tags = this.Tag - }, + { + VaultName = this.Name, + ResourceGroupName = this.ResourceGroupName, + Location = this.Location, + EnabledForDeployment = this.EnabledForDeployment.IsPresent, + EnabledForTemplateDeployment = EnabledForTemplateDeployment.IsPresent, + EnabledForDiskEncryption = EnabledForDiskEncryption.IsPresent, + EnableSoftDelete = EnableSoftDelete.IsPresent, + EnablePurgeProtection = EnablePurgeProtection.IsPresent, + SkuFamilyName = DefaultSkuFamily, + SkuName = this.Sku, + TenantId = GetTenantId(), + AccessPolicy = accessPolicy, + NetworkAcls = new NetworkRuleSet(), // New key-vault takes in default network rule set + Tags = this.Tag + }, ActiveDirectoryClient); this.WriteObject(newVault); diff --git a/src/KeyVault/KeyVault/help/Add-AzKeyVaultKey.md b/src/KeyVault/KeyVault/help/Add-AzKeyVaultKey.md index 8e2a3e750047..eda5dd837510 100644 --- a/src/KeyVault/KeyVault/help/Add-AzKeyVaultKey.md +++ b/src/KeyVault/KeyVault/help/Add-AzKeyVaultKey.md @@ -282,7 +282,7 @@ Accept wildcard characters: False Type: System.String Parameter Sets: InteractiveImport, InputObjectImport, ResourceIdImport Aliases: -Accepted values: HSM, Software, HSM, Software +Accepted values: HSM, Software Required: False Position: Named diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVault.md b/src/KeyVault/KeyVault/help/Get-AzKeyVault.md index a49deae5b912..663f7be76cfb 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVault.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVault.md @@ -240,7 +240,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -Tag @@ -271,7 +271,7 @@ Required: False Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: True +Accept wildcard characters: False ``` ```yaml @@ -283,7 +283,7 @@ Required: True Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: True +Accept wildcard characters: False ``` ### CommonParameters diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificate.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificate.md index 9c85044ee449..8d57fc8b3f81 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificate.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificate.md @@ -313,7 +313,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ```yaml @@ -325,7 +325,7 @@ Required: True Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -ResourceId diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificateIssuer.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificateIssuer.md index 49f78115838a..695eb4317087 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificateIssuer.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificateIssuer.md @@ -115,7 +115,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -ResourceId diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultKey.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultKey.md index bc3e960c3771..ffdbf40fba48 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultKey.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultKey.md @@ -323,7 +323,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ```yaml @@ -335,7 +335,7 @@ Required: True Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -ResourceId diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultManagedStorageAccount.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultManagedStorageAccount.md index da5c135a56a6..6da4e0abea92 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultManagedStorageAccount.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultManagedStorageAccount.md @@ -113,7 +113,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -DefaultProfile diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultSecret.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultSecret.md index d4062b77f8b2..828e8b5722ec 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultSecret.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultSecret.md @@ -346,7 +346,7 @@ Required: False Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ```yaml @@ -358,7 +358,7 @@ Required: True Position: 1 Default value: None Accept pipeline input: False -Accept wildcard characters: True +Accept wildcard characters: False ``` ### -ResourceId From 5fcb7e14ee1cd619feacd8b8ad0484a750fba629 Mon Sep 17 00:00:00 2001 From: Yeming Liu Date: Wed, 25 Mar 2020 17:08:55 +0800 Subject: [PATCH 2/2] ref az.msi in compute.sln --- src/Compute/Compute.sln | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Compute/Compute.sln b/src/Compute/Compute.sln index a3724def58c7..4cc26a7c7e69 100644 --- a/src/Compute/Compute.sln +++ b/src/Compute/Compute.sln @@ -14,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Acc EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KeyVault", "..\KeyVault\KeyVault\KeyVault.csproj", "{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedServiceIdentity", "..\ManagedServiceIdentity\ManagedServiceIdentity.csproj", "{228EB071-FA04-43B3-95F9-7D76DBF0B850}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{3E016018-D65D-4336-9F64-17DA97783AD0}" @@ -48,6 +50,10 @@ Global {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.ActiveCfg = Release|Any CPU {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.Build.0 = Release|Any CPU + {228EB071-FA04-43B3-95F9-7D76DBF0B850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {228EB071-FA04-43B3-95F9-7D76DBF0B850}.Debug|Any CPU.Build.0 = Debug|Any CPU + {228EB071-FA04-43B3-95F9-7D76DBF0B850}.Release|Any CPU.ActiveCfg = Release|Any CPU + {228EB071-FA04-43B3-95F9-7D76DBF0B850}.Release|Any CPU.Build.0 = Release|Any CPU {FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU