Skip to content
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

Provide Warning Messages For Azure KeyVault Soft Delete #12672

Merged
merged 2 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/KeyVault/KeyVault/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
Added warning messages for planning to remove attribute SecretVauleText
* Added warning messages for planning to disable soft delete
* Added warning messages for planning to remove attribute SecretVauleText

## Version 2.0.0
* Removed two aliases: `New-AzKeyVaultCertificateAdministratorDetails` and `New-AzKeyVaultCertificateOrganizationDetails`
Expand Down
6 changes: 6 additions & 0 deletions src/KeyVault/KeyVault/Commands/NewAzureKeyVault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace Microsoft.Azure.Commands.KeyVault
/// <summary>
/// Create a new key vault.
/// </summary>
[GenericBreakingChange("The ability to create new key vaults with soft delete disabled will be deprecated by December 2020. " +
"All key vaults will be required to have soft delete enabled. Please see the following documentation for additional guidance. " +
"https://docs.microsoft.com/azure/key-vault/general/soft-delete-change")]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KeyVault", SupportsShouldProcess = true)]
[OutputType(typeof(PSKeyVault))]
public class NewAzureKeyVault : KeyVaultManagementCmdletBase
Expand Down Expand Up @@ -84,6 +87,9 @@ 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; }

public const String DisableSoftDeleteChangeDesc = "DisableSoftDelete will be deprecated without being replaced.";

[CmdletParameterBreakingChange("DisableSoftDelete", "3.0.0", ChangeDescription = DisableSoftDeleteChangeDesc)]
[Parameter(Mandatory = false,
HelpMessage = "If specified, 'soft delete' functionality is disabled for this key vault.")]
public SwitchParameter DisableSoftDelete { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions src/KeyVault/KeyVault/Commands/RemoveAzureKeyVault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
using Microsoft.Azure.Commands.KeyVault.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Globalization;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.KeyVault
{
[GenericBreakingChange("If you have soft-delete protection enabled on this key vault, you will not be able to reuse this key vault name until the key vault has been purged from the soft deleted state. " +
"Please see the following documentation for additional guidance. https://docs.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview")]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KeyVault",SupportsShouldProcess = true,DefaultParameterSetName = RemoveVaultParameterSet)]
[OutputType(typeof(bool))]
public class RemoveAzureKeyVault : KeyVaultManagementCmdletBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
using Microsoft.Azure.Commands.KeyVault.Models;
using Microsoft.Azure.Commands.KeyVault.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.KeyVault
{
/// <summary>
/// The Remove-AzKeyVaultCertificate cmdlet deletes a certificate in an Azure Key Vault.
/// </summary>
[GenericBreakingChange("If you have soft-delete protection enabled on this key vault, this certificate will be moved to the soft deleted state. " +
"You will not be able to create a certificate with the same name within this key vault until the certificate has been purged from the soft-deleted state. " +
"Please see the following documentation for additional guidance. https://docs.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview")]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzurePrefix + "KeyVaultCertificate",SupportsShouldProcess = true,DefaultParameterSetName = ByVaultNameAndNameParameterSet)]
[OutputType(typeof(PSDeletedKeyVaultCertificate))]
public class RemoveAzureKeyVaultCertificate : KeyVaultCmdletBase
Expand Down
4 changes: 4 additions & 0 deletions src/KeyVault/KeyVault/Commands/RemoveAzureKeyVaultKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
using System.Management.Automation;
using Microsoft.Azure.Commands.KeyVault.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.KeyVault
{
[GenericBreakingChange("If you have soft - delete protection enabled on this key vault, this key will be moved to the soft deleted state. " +
"You will not be able to create a key with the same name within this key vault until the key has been purged from the soft-deleted state. " +
"Please see the following documentation for additional guidance.https://docs.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview")]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzurePrefix + "KeyVaultKey",SupportsShouldProcess = true,DefaultParameterSetName = ByVaultNameParameterSet)]
[OutputType(typeof(PSDeletedKeyVaultKey))]
public class RemoveAzureKeyVaultKey : KeyVaultCmdletBase
Expand Down
3 changes: 3 additions & 0 deletions src/KeyVault/KeyVault/Commands/RemoveAzureKeyVaultSecret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

namespace Microsoft.Azure.Commands.KeyVault
{
[GenericBreakingChange("If you have soft-delete protection enabled on this key vault, this secret will be moved to the soft deleted state. " +
"You will not be able to create a secret with the same name within this key vault until the secret has been purged from the soft-deleted state. Please see the following documentation for additional guidance. " +
"https://docs.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview")]
[CmdletOutputBreakingChange(typeof(PSDeletedKeyVaultSecret), "3.0.0", DeprecatedOutputProperties = new String[] { "SecretValueText" })]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzurePrefix + "KeyVaultSecret",SupportsShouldProcess = true,DefaultParameterSetName = ByVaultNameParameterSet)]
[OutputType(typeof(PSDeletedKeyVaultSecret))]
Expand Down
4 changes: 4 additions & 0 deletions src/KeyVault/KeyVault/Commands/UpdateAzureKeyVault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Azure.Commands.KeyVault.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -48,7 +49,10 @@ public class UpdateTopLevelResourceCommand : KeyVaultManagementCmdletBase
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = UpdateByResourceIdParameterSet, HelpMessage = "Resource ID of the key vault.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

public const String EnableSoftDeleteChangeDesc = "EnableSoftDelete will be deprecated without being replaced.";

[CmdletParameterBreakingChange("EnableSoftDelete", "3.0.0", ChangeDescription = EnableSoftDeleteChangeDesc)]
[Parameter(Mandatory = false, HelpMessage = "Enable the soft-delete functionality for this key vault. Once enabled it cannot be disabled.")]
public SwitchParameter EnableSoftDelete { get; set; }

Expand Down