From 7dad202fa84eecf5c49b3bf9b69b0e332284ead3 Mon Sep 17 00:00:00 2001 From: Shawn Fang <45607042+mssfang@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:30:27 -0700 Subject: [PATCH] [PatchRelease] Prepare for July patch release for KV (#41342) * Prepare release July for Form recognizer and Metrics Advisor (#41338) * Updated list of libraries to patch in patch-release.yml * Reset sources for azure-security-keyvault-secrets to the release version 4.8.4. * Prepare azure-security-keyvault-secrets for 4.8.5 patch release. * Reset sources for azure-security-keyvault-certificates to the release version 4.6.4. * Prepare azure-security-keyvault-certificates for 4.6.5 patch release. * Reset sources for azure-security-keyvault-administration to the release version 4.5.5. * Prepare azure-security-keyvault-administration for 4.5.6 patch release. * Reset sources for azure-security-keyvault-keys to the release version 4.8.5. * Prepare azure-security-keyvault-keys for 4.8.6 patch release. * Updated dependencies in libraries and READMEs via version_client.txt --------- Co-authored-by: Sameeksha Vaity Co-authored-by: azure-sdk --- eng/pipelines/patch-release.yml | 22 +- eng/versioning/version_client.txt | 8 +- sdk/clientcore/http-stress/pom.xml | 4 +- sdk/e2e/pom.xml | 6 +- .../CHANGELOG.md | 12 +- .../README.md | 129 +------ .../assets.json | 2 +- .../pom.xml | 4 +- .../KeyVaultAdministrationServiceVersion.java | 9 +- .../KeyVaultBackupAsyncClient.java | 225 +----------- .../administration/KeyVaultBackupClient.java | 273 ++------------- .../KeyVaultBackupClientImpl.java | 330 ++---------------- .../models/PreBackupOperationParameters.java | 144 -------- .../models/PreFullBackupHeaders.java | 81 ----- .../PreFullRestoreOperationHeaders.java | 81 ----- .../models/PreRestoreOperationParameters.java | 113 ------ .../keyvault/administration/package-info.java | 95 +---- .../administration/ReadmeSamples.java | 124 +------ ...tBackupAsyncClientJavaDocCodeSnippets.java | 51 +-- ...yVaultBackupClientJavaDocCodeSnippets.java | 83 +---- .../KeyVaultAccessControlAsyncClientTest.java | 7 +- .../KeyVaultAccessControlClientTest.java | 6 +- .../KeyVaultAccessControlClientTestBase.java | 2 +- .../KeyVaultAdministrationClientTestBase.java | 32 +- .../KeyVaultBackupAsyncClientTest.java | 143 +++----- .../KeyVaultBackupClientTest.java | 67 +--- .../KeyVaultBackupClientTestBase.java | 8 +- .../KeyVaultSettingsAsyncClientTest.java | 4 - .../KeyVaultSettingsClientTest.java | 4 - .../swagger/autorest.md | 6 +- .../CHANGELOG.md | 17 +- .../README.md | 5 +- .../assets.json | 2 +- .../pom.xml | 25 +- .../CertificateServiceVersion.java | 9 +- .../CertificateAsyncClientTest.java | 8 +- .../certificates/CertificateClientTest.java | 14 +- .../CertificateClientTestBase.java | 34 +- .../certificates/FakeCredentialsForTests.java | 107 +++--- .../swagger/autorest.md | 2 +- .../azure-security-keyvault-keys/CHANGELOG.md | 17 +- .../azure-security-keyvault-keys/README.md | 3 +- .../azure-security-keyvault-keys/assets.json | 2 +- .../azure-security-keyvault-keys/pom.xml | 2 +- .../keyvault/keys/KeyServiceVersion.java | 9 +- .../cryptography/CryptographyAsyncClient.java | 56 +-- .../keys/cryptography/CryptographyClient.java | 54 +-- .../CryptographyClientBuilder.java | 78 ++--- .../CryptographyServiceVersion.java | 9 +- .../KeyEncryptionKeyAsyncClient.java | 19 +- .../cryptography/KeyEncryptionKeyClient.java | 15 +- .../KeyEncryptionKeyClientBuilder.java | 67 +--- .../implementation/CryptographyUtils.java | 53 +-- .../models/LifetimeActionsType.java | 6 +- .../keys/models/KeyRotationPolicyAction.java | 11 +- .../keyvault/keys/KeyAsyncClientTest.java | 20 +- .../security/keyvault/keys/KeyClientTest.java | 16 +- .../keyvault/keys/KeyClientTestBase.java | 20 +- .../cryptography/CryptographyClientTest.java | 6 +- .../CryptographyClientTestBase.java | 44 ++- .../KeyEncryptionKeyClientTest.java | 5 - .../KeyEncryptionKeyClientTestBase.java | 20 +- .../swagger/autorest.md | 2 +- .../azure-security-keyvault-perf/pom.xml | 6 +- .../CHANGELOG.md | 16 +- .../azure-security-keyvault-secrets/README.md | 3 +- .../assets.json | 2 +- .../perf-tests.yml | 14 +- .../azure-security-keyvault-secrets/pom.xml | 25 +- .../secrets/SecretServiceVersion.java | 9 +- .../secrets/SecretAsyncClientTest.java | 10 +- .../keyvault/secrets/SecretClientTest.java | 11 +- .../secrets/SecretClientTestBase.java | 25 +- .../swagger/autorest.md | 2 +- 74 files changed, 626 insertions(+), 2329 deletions(-) delete mode 100644 sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java delete mode 100644 sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java delete mode 100644 sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java delete mode 100644 sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java diff --git a/eng/pipelines/patch-release.yml b/eng/pipelines/patch-release.yml index d9559a5bd3103..3ffe2eb50994f 100644 --- a/eng/pipelines/patch-release.yml +++ b/eng/pipelines/patch-release.yml @@ -4,16 +4,20 @@ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client-patch.yml parameters: artifacts: - - name: azure-sdk-template + - name: azure-security-keyvault-secrets groupId: com.azure - safeName: azuresdktemplate - ServiceDirectory: template - - name: azure-sdk-template-two + safeName: azuresecuritykeyvaultsecrets + ServiceDirectory: keyvault + - name: azure-security-keyvault-certificates groupId: com.azure - safeName: azuresdktemplatetwo - ServiceDirectory: template - - name: azure-sdk-template-three + safeName: azuresecuritykeyvaultcertificates + ServiceDirectory: keyvault + - name: azure-security-keyvault-administration groupId: com.azure - safeName: azuresdktemplatethree - ServiceDirectory: template + safeName: azuresecuritykeyvaultadministration + ServiceDirectory: keyvault + - name: azure-security-keyvault-keys + groupId: com.azure + safeName: azuresecuritykeyvaultkeys + ServiceDirectory: keyvault diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 573fa343c8974..b0b980bced683 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -176,12 +176,12 @@ com.azure:azure-search-documents;11.7.0;11.8.0-beta.1 com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-security-attestation;1.1.26;1.2.0-beta.1 com.azure:azure-security-confidentialledger;1.0.22;1.1.0-beta.1 -com.azure:azure-security-keyvault-administration;4.5.5;4.6.0-beta.1 -com.azure:azure-security-keyvault-certificates;4.6.4;4.7.0-beta.1 +com.azure:azure-security-keyvault-administration;4.5.5;4.5.6 +com.azure:azure-security-keyvault-certificates;4.6.4;4.6.5 com.azure:azure-security-keyvault-jca;2.8.1;2.9.0-beta.3 com.azure:azure-security-test-keyvault-jca;1.0.0;1.0.0 -com.azure:azure-security-keyvault-keys;4.8.5;4.9.0-beta.1 -com.azure:azure-security-keyvault-secrets;4.8.4;4.9.0-beta.1 +com.azure:azure-security-keyvault-keys;4.8.5;4.8.6 +com.azure:azure-security-keyvault-secrets;4.8.4;4.8.5 com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/clientcore/http-stress/pom.xml b/sdk/clientcore/http-stress/pom.xml index aafa7d4909bfa..5091de352e8bb 100644 --- a/sdk/clientcore/http-stress/pom.xml +++ b/sdk/clientcore/http-stress/pom.xml @@ -48,7 +48,7 @@ io.opentelemetry opentelemetry-api - 1.38.0 + 1.40.0 @@ -89,7 +89,7 @@ io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8:[2.6.0-alpha] io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0:[2.6.0-alpha] ch.qos.logback:logback-classic:[1.3.14] - io.opentelemetry:opentelemetry-api:[1.38.0] + io.opentelemetry:opentelemetry-api:[1.40.0] diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index 138f96825474e..8ba770d9f5d21 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -44,17 +44,17 @@ com.azure azure-security-keyvault-keys - 4.9.0-beta.1 + 4.8.6 com.azure azure-security-keyvault-secrets - 4.9.0-beta.1 + 4.8.5 com.azure azure-security-keyvault-certificates - 4.7.0-beta.1 + 4.6.5 org.slf4j diff --git a/sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md index 0e5e89945a3ed..54b42a271575c 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md @@ -1,14 +1,14 @@ # Release History -## 4.6.0-beta.1 (Unreleased) +## 4.5.6 (2024-07-29) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`. +- Upgraded `azure-json` from `1.1.0` to version `1.2.0`. +- Upgraded `azure-core` from `1.49.1` to version `1.50.0`. ## 4.5.5 (2024-06-27) diff --git a/sdk/keyvault/azure-security-keyvault-administration/README.md b/sdk/keyvault/azure-security-keyvault-administration/README.md index a203d83439da6..ac71566fe4563 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/README.md +++ b/sdk/keyvault/azure-security-keyvault-administration/README.md @@ -43,14 +43,13 @@ If you want to take dependency on a particular version of the library that is no com.azure azure-security-keyvault-administration - 4.5.4 + 4.5.6 ``` [//]: # ({x-version-update-end}) ### Prerequisites - A [Java Development Kit (JDK)][jdk_link], version 8 or later. - - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis). - An [Azure Subscription][azure_subscription]. - An existing [Azure Key Vault Managed HSM][azure_keyvault_mhsm]. If you need to create a Managed HSM, you can do so using the Azure CLI by following the steps in [this document][azure_keyvault_mhsm_cli]. @@ -112,15 +111,9 @@ The Key Vault Backup Client provides both synchronous and asynchronous operation > NOTE: The backing store for key backups is a blob storage container using Shared Access Signature authentication. For more details on creating a SAS token using the `BlobServiceClient`, see the [Azure Storage Blobs client README][storage_readme_sas_token]. Alternatively, it is possible to [generate a SAS token in Storage Explorer][portal_sas_token]. -### Pre-Backup Operation -A pre-backup operation represents a long-running operation that checks if it is possible to perform a full key backup. - ### Backup Operation A backup operation represents a long-running operation for a full key backup. -### Pre-Restore Operation -A pre-restore operation represents a long-running operation that checks if it is possible to perform a full key restore from a backup. - ### Restore Operation A restore operation represents a long-running operation for both a full key and selective key restore. @@ -347,47 +340,20 @@ keyVaultAccessControlAsyncClient.deleteRoleAssignment(KeyVaultRoleScope.GLOBAL, ### Examples #### Sync API The following sections provide several code snippets covering some of the most common Azure Key Vault Backup client tasks, including: -- [Pre-backup check for a Key Vault](#run-pre-backup-check-for-a-collection-of-keys) - [Backup a Key Vault](#backup-a-collection-of-keys) -- [Pre-restore check for a Key Vault](#run-pre-restore-check-for-a-collection-of-keys) - [Restore a Key Vault](#restore-a-collection-of-keys) - [Restore a key](#selectively-restore-a-key) -##### Run pre-backup check for a collection of keys -Check if an entire collection of keys can be backed up by using `beginPreBackup()`. - -```java readme-sample-beginPreBackup -String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer"; -String sasToken = ""; - -SyncPoller preBackupPoller = - keyVaultBackupClient.beginPreBackup(blobStorageUrl, sasToken); -PollResponse pollResponse = preBackupPoller.poll(); - -System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); - -PollResponse finalPollResponse = preBackupPoller.waitForCompletion(); - -if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String folderUrl = preBackupPoller.getFinalResult(); - - System.out.printf("Pre-backup check completed successfully.%n"); -} else { - KeyVaultBackupOperation operation = preBackupPoller.poll().getValue(); - - System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage()); -} -``` - ##### Backup a collection of keys Back up an entire collection of keys using `beginBackup()`. ```java readme-sample-beginBackup String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; SyncPoller backupPoller = keyVaultBackupClient.beginBackup(blobStorageUrl, sasToken); + PollResponse pollResponse = backupPoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); @@ -405,49 +371,26 @@ if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COM } ``` -##### Run pre-restore check for a collection of keys -Check if an entire collection of keys can be restored from a backup by using `beginPreRestore()`. - -```java readme-sample-beginPreRestore -String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; - -SyncPoller preRestorePoller = - keyVaultBackupClient.beginPreRestore(folderUrl, sasToken); -PollResponse pollResponse = preRestorePoller.poll(); - -System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); - -PollResponse finalPollResponse = preRestorePoller.waitForCompletion(); - -if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - System.out.printf("Pre-restore check completed successfully.%n"); -} else { - KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue(); - - System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage()); -} -``` - ##### Restore a collection of keys Restore an entire collection of keys from a backup using `beginRestore()`. ```java readme-sample-beginRestore String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; -SyncPoller restorePoller = +SyncPoller backupPoller = keyVaultBackupClient.beginRestore(folderUrl, sasToken); -PollResponse pollResponse = restorePoller.poll(); + +PollResponse pollResponse = backupPoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); -PollResponse finalPollResponse = restorePoller.waitForCompletion(); +PollResponse finalPollResponse = backupPoller.waitForCompletion(); if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { System.out.printf("Backup restored successfully.%n"); } else { - KeyVaultRestoreOperation operation = restorePoller.poll().getValue(); + KeyVaultRestoreOperation operation = backupPoller.poll().getValue(); System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage()); } @@ -458,21 +401,22 @@ Restore a specific key from a backup using `beginSelectiveRestore()`. ```java readme-sample-beginSelectiveKeyRestore String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; String keyName = "myKey"; -SyncPoller restorePoller = +SyncPoller backupPoller = keyVaultBackupClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName); -PollResponse pollResponse = restorePoller.poll(); + +PollResponse pollResponse = backupPoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); -PollResponse finalPollResponse = restorePoller.waitForCompletion(); +PollResponse finalPollResponse = backupPoller.waitForCompletion(); if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { System.out.printf("Key restored successfully.%n"); } else { - KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue(); + KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue(); System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage()); } @@ -480,38 +424,18 @@ if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COM #### Async API The following sections provide several code snippets covering some of the most common asynchronous Azure Key Vault Backup client tasks, including: -- [Run pre-backup check for a collection of keys asynchronously](#run-pre-backup-check-for-a-collection-of-keys-asynchronously) - [Backup a Key Vault asynchronously](#backup-a-collection-of-keys-asynchronously) -- [Run pre-restore check for a collection of keys asynchronously](#run-pre-restore-check-for-a-collection-of-keys-asynchronously) - [Restore a Key Vault asynchronously](#restore-a-collection-of-keys-asynchronously) - [Restore a key asynchronously](#selectively-restore-a-key-asynchronously) > Note : You should add `System.in.read()` or `Thread.sleep()` after the function calls in the main class/thread to allow async functions/operations to execute and finish before the main application/thread exits. -##### Run pre-backup check for a collection of keys asynchronously -Check if an entire collection of keys can be backed up by using `beginPreBackup()`. - -```java readme-sample-beginPreBackupAsync -String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer"; -String sasToken = ""; - -keyVaultBackupAsyncClient.beginPreBackup(blobStorageUrl, sasToken) - .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. - .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage())) - .doOnNext(pollResponse -> - System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus())) - .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) - .flatMap(AsyncPollResponse::getFinalResult) - .subscribe(folderUrl -> - System.out.printf("Pre-backup check completed successfully.%n")); -``` - ##### Backup a collection of keys asynchronously Back up an entire collection of keys using `beginBackup()`. ```java readme-sample-beginBackupAsync String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken) .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. @@ -524,29 +448,12 @@ keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken) System.out.printf("Backup completed. The storage location of this backup is: %s.%n", folderUrl)); ``` -##### Run pre-restore check for a collection of keys asynchronously -Check if an entire collection of keys can be restored from a backup by using `beginPreRestore()`. - -```java readme-sample-beginPreRestoreAsync -String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; - -keyVaultBackupAsyncClient.beginPreRestore(folderUrl, sasToken) - .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. - .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage())) - .doOnNext(pollResponse -> - System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus())) - .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) - .flatMap(AsyncPollResponse::getFinalResult) - .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n")); -``` - ##### Restore a collection of keys asynchronously Restore an entire collection of keys from a backup using `beginRestore()`. ```java readme-sample-beginRestoreAsync String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken) .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. @@ -563,7 +470,7 @@ Restore an entire collection of keys from a backup using `beginSelectiveRestore( ```java readme-sample-beginSelectiveKeyRestoreAsync String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313"; -String sasToken = ""; +String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D"; String keyName = "myKey"; keyVaultBackupAsyncClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName) diff --git a/sdk/keyvault/azure-security-keyvault-administration/assets.json b/sdk/keyvault/azure-security-keyvault-administration/assets.json index 16819beda18c4..2edac6dd53d7f 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/assets.json +++ b/sdk/keyvault/azure-security-keyvault-administration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/keyvault/azure-security-keyvault-administration", - "Tag": "java/keyvault/azure-security-keyvault-administration_18fc6d4e27" + "Tag": "java/keyvault/azure-security-keyvault-administration_95d2cbb133" } diff --git a/sdk/keyvault/azure-security-keyvault-administration/pom.xml b/sdk/keyvault/azure-security-keyvault-administration/pom.xml index d19208600d496..152a5957fe18e 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-administration/pom.xml @@ -13,7 +13,7 @@ com.azure azure-security-keyvault-administration - 4.6.0-beta.1 + 4.5.6 Microsoft Azure client library for KeyVault Administration This module contains client library for Microsoft Azure KeyVault Administration. @@ -112,7 +112,7 @@ com.azure azure-security-keyvault-keys - 4.9.0-beta.1 + 4.8.6 test diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java index f816b886c8cbb..9da3c1ae7476c 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java +++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java @@ -27,12 +27,7 @@ public enum KeyVaultAdministrationServiceVersion implements ServiceVersion { /** * Service version {@code 7.5}. */ - V7_5("7.5"), - - /** - * Service version {@code 7.6-preview.1}. - */ - V7_6_PREVIEW_1("7.6-preview.1"); + V7_5("7.5"); private final String version; @@ -51,6 +46,6 @@ public String getVersion() { * @return The latest {@link KeyVaultAdministrationServiceVersion}. */ public static KeyVaultAdministrationServiceVersion getLatest() { - return V7_6_PREVIEW_1; + return V7_5; } } diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java index e49ae353a98b4..d4ed2f1d1f926 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java +++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java @@ -18,8 +18,6 @@ import com.azure.core.util.polling.PollingContext; import com.azure.security.keyvault.administration.implementation.KeyVaultBackupClientImpl; import com.azure.security.keyvault.administration.implementation.KeyVaultErrorCodeStrings; -import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters; -import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters; import com.azure.security.keyvault.administration.implementation.models.RestoreOperation; import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters; import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter; @@ -91,7 +89,8 @@ * *
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
  * client.beginBackup(blobStorageUrl, sasToken)
  *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -121,7 +120,8 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
  * client.beginRestore(folderUrl, sasToken)
  *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -150,7 +150,8 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  * String keyName = "myKey";
  *
  * client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
@@ -248,7 +249,8 @@ HttpPipeline getHttpPipeline() {
      * 
      * 
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      *
      * client.beginBackup(blobStorageUrl, sasToken)
      *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -398,101 +400,6 @@ private static Mono> processBackupOperatio
             toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue()));
     }
 
-    /**
-     * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
-     * collection of keys from a key vault.
-     *
-     * 

Code Samples

- *

Starts a {@link KeyVaultBackupOperation pre-backup operation}, polls for its status and waits for it to - * complete. Prints out the details of the operation's final result in case of success or prints out details of an - * error in case the operation fails.

- * - *
-     * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * String sasToken = "<sas-token>";
-     *
-     * client.beginPreBackup(blobStorageUrl, sasToken)
-     *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-     *     .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
-     *     .doOnNext(pollResponse ->
-     *         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-     *     .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-     *     .flatMap(AsyncPollResponse::getFinalResult)
-     *     .subscribe(unused -> System.out.printf("Pre-backup check completed successfully.%n"));
-     * 
- * - * - * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * - * @return A {@link PollerFlux} polling on the {@link KeyVaultBackupOperation pre-backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid. - * @throws NullPointerException If the {@code blobStorageUrl} is {@code null}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginPreBackup(String blobStorageUrl, String sasToken) { - if (blobStorageUrl == null) { - throw LOGGER.logExceptionAsError( - new NullPointerException( - String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'blobStorageUrl'"))); - } - - return new PollerFlux<>(getDefaultPollingInterval(), - preBackupActivationOperation(blobStorageUrl, sasToken), - backupPollOperation(), - (pollingContext, firstResponse) -> - Mono.error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))), - backupFetchOperation()); - } - - /** - * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire - * collection of keys from a key vault. - * - * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * @param context Additional context that is passed through the HTTP pipeline during the service call. - * - * @return A {@link PollerFlux} polling on the {@link KeyVaultBackupOperation pre-backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid. - */ - Mono> preBackupWithResponse(String blobStorageUrl, String sasToken, - Context context) { - PreBackupOperationParameters preBackupOperationParameters = new PreBackupOperationParameters() - .setStorageResourceUri(blobStorageUrl) - .setToken(sasToken) - .setUseManagedIdentity(sasToken == null); - - try { - return clientImpl.preFullBackupWithResponseAsync(vaultUrl, preBackupOperationParameters, context) - .doOnRequest(ignored -> LOGGER.verbose("Backing up at URL - {}", blobStorageUrl)) - .doOnSuccess(response -> LOGGER.verbose("Backed up at URL - {}", - response.getValue().getAzureStorageBlobContainerUri())) - .doOnError(error -> LOGGER.warning("Failed to backup at URL - {}", blobStorageUrl, error)) - .map(backupOperationResponse -> - new SimpleResponse<>(backupOperationResponse.getRequest(), backupOperationResponse.getStatusCode(), - backupOperationResponse.getHeaders(), - (KeyVaultBackupOperation) transformToLongRunningOperation(backupOperationResponse.getValue()))); - } catch (RuntimeException e) { - return monoError(LOGGER, e); - } - } - - private Function, Mono> preBackupActivationOperation(String blobStorageUrl, String sasToken) { - return (pollingContext) -> { - try { - return withContext(context -> preBackupWithResponse(blobStorageUrl, sasToken, context)) - .flatMap(backupResponse -> Mono.just(backupResponse.getValue())); - } catch (RuntimeException e) { - return monoError(LOGGER, e); - } - }; - } - /** * Initiates a full restore of the Key Vault. * @@ -502,7 +409,8 @@ private Function, Mono *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      *
      * client.beginRestore(folderUrl, sasToken)
      *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -646,116 +554,6 @@ static Mono> processRestoreOperationRespo
             toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue()));
     }
 
-    /**
-     * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
-     * collection of keys from a backup.
-     *
-     * 

Code Samples

- *

Starts a {@link KeyVaultRestoreOperation pre-restore operation}, polls for its status and waits for it to - * complete. Prints out error details in case the operation fails.

- * - *
-     * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * String sasToken = "<sas-token>";
-     *
-     * client.beginPreRestore(folderUrl, sasToken)
-     *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-     *     .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
-     *     .doOnNext(pollResponse ->
-     *         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-     *     .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-     *     .flatMap(AsyncPollResponse::getFinalResult)
-     *     .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
-     * 
- * - * - * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to - * the blob container where the backup resides. This would be the exact value that is returned as the result of a - * backup operation. An example of such a URL may look like the following: - * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * - * @return A {@link PollerFlux} polling on the {@link KeyVaultRestoreOperation restore operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid. - * @throws NullPointerException If the {@code folderUrl} is {@code null}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginPreRestore(String folderUrl, - String sasToken) { - if (folderUrl == null) { - throw LOGGER.logExceptionAsError( - new NullPointerException(String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'folderUrl'"))); - } - - return new PollerFlux<>(getDefaultPollingInterval(), - preRestoreActivationOperation(folderUrl, sasToken), - restorePollOperation(), - (pollingContext, firstResponse) -> - Mono.error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))), - (pollingContext) -> Mono.just(new KeyVaultRestoreResult())); - } - - /** - * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire - * collection of keys from a backup. - * - * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to - * the blob container where the backup resides. This would be the exact value that is returned as the result of a - * backup operation. An example of such a URL may look like the following: - * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * @param context Additional context that is passed through the HTTP pipeline during the service call. - * - * @return A {@link PollerFlux} polling on the {@link KeyVaultRestoreOperation backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid. - */ - Mono> preRestoreWithResponse(String folderUrl, String sasToken, - Context context) { - String[] segments = folderUrl.split("/"); - String folderName = segments[segments.length - 1]; - String containerUrl = folderUrl.substring(0, folderUrl.length() - folderName.length()); - - SASTokenParameter sasTokenParameter = new SASTokenParameter(containerUrl) - .setToken(sasToken) - .setUseManagedIdentity(sasToken == null); - - PreRestoreOperationParameters preRestoreOperationParameters = - new PreRestoreOperationParameters() - .setFolderToRestore(folderName) - .setSasTokenParameters(sasTokenParameter); - - try { - return clientImpl.preFullRestoreOperationWithResponseAsync(vaultUrl, preRestoreOperationParameters, context) - .doOnRequest(ignored -> LOGGER.verbose("Restoring from location - {}", folderUrl)) - .doOnSuccess(response -> LOGGER.verbose("Restored from location - {}", folderUrl)) - .doOnError(error -> - LOGGER.warning("Failed to restore from location - {}", folderUrl, error)) - .map(restoreOperationResponse -> - new SimpleResponse<>(restoreOperationResponse.getRequest(), - restoreOperationResponse.getStatusCode(), - restoreOperationResponse.getHeaders(), - (KeyVaultRestoreOperation) transformToLongRunningOperation( - restoreOperationResponse.getValue()))); - } catch (RuntimeException e) { - return monoError(LOGGER, e); - } - } - - private Function, Mono> preRestoreActivationOperation(String folderUrl, String sasToken) { - return (pollingContext) -> { - try { - return withContext(context -> preRestoreWithResponse(folderUrl, sasToken, context)) - .flatMap(restoreResponse -> Mono.just(restoreResponse.getValue())); - } catch (RuntimeException e) { - return monoError(LOGGER, e); - } - }; - } - /** * Restores all versions of a given key using the supplied SAS token pointing to a previously stored Azure Blob * storage backup folder. @@ -766,7 +564,8 @@ private Function, Mono *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      * String keyName = "myKey";
      *
      * client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
index 52bb3f35d5a8b..3dafe20bf84aa 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
@@ -22,10 +22,6 @@
 import com.azure.security.keyvault.administration.implementation.models.FullBackupHeaders;
 import com.azure.security.keyvault.administration.implementation.models.FullBackupOperation;
 import com.azure.security.keyvault.administration.implementation.models.FullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters;
-import com.azure.security.keyvault.administration.implementation.models.PreFullBackupHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreFullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters;
 import com.azure.security.keyvault.administration.implementation.models.RestoreOperation;
 import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters;
 import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter;
@@ -96,9 +92,11 @@
  * 
  * 
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
  * SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
  * PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -133,20 +131,22 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
  *     client.beginRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Backup restored successfully.%n");
  * } else {
- *     KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ *     KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
  *
  *     System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
  * }
@@ -169,21 +169,23 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  * String keyName = "myKey";
  *
- * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
  *     client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Key restored successfully.%n");
  * } else {
- *     KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+ *     KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
  *
  *     System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
  * }
@@ -269,9 +271,11 @@ public String getVaultUrl() {
      * 
      * 
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      *
      * SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+     *
      * PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
      *
      * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -410,112 +414,6 @@ private static PollResponse processBackupOperationRespo
             toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue());
     }
 
-    /**
-     * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
-     * collection of keys from a key vault.
-     *
-     * 

Code Samples

- *

Starts a {@link KeyVaultBackupOperation pre-backup operation}, polls for its status and waits for it to - * complete. Prints out the details of the operation's final result in case of success or prints out error details - * in case the operation fails.

- * - *
-     * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * String sasToken = "<sas-token>";
-     *
-     * SyncPoller<KeyVaultBackupOperation, String> preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
-     * PollResponse<KeyVaultBackupOperation> pollResponse = preBackupPoller.poll();
-     *
-     * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-     *
-     * PollResponse<KeyVaultBackupOperation> finalPollResponse = preBackupPoller.waitForCompletion();
-     *
-     * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-     *     System.out.printf("Pre-backup check completed successfully.%n");
-     * } else {
-     *     KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
-     *
-     *     System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
-     * }
-     * 
- * - * - * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * - * @return A {@link SyncPoller} polling on the {@link KeyVaultBackupOperation pre-backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid. - * @throws NullPointerException If the {@code blobStorageUrl} is {@code null}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginPreBackup(String blobStorageUrl, String sasToken) { - if (blobStorageUrl == null) { - throw LOGGER.logExceptionAsError( - new NullPointerException( - String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'blobStorageUrl'"))); - } - - Context context = Context.NONE; - - return SyncPoller.createPoller( - getDefaultPollingInterval(), - cxt -> - new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, - preBackupActivationOperation(blobStorageUrl, sasToken, context) - .apply(cxt)), - backupPollOperation(context), - (pollingContext, firstResponse) -> { - throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported")); - }, - backupFetchOperation()); - } - - private Function, KeyVaultBackupOperation> preBackupActivationOperation( - String blobStorageUrl, String sasToken, Context context) { - - return (pollingContext) -> { - try { - return preBackupWithResponse(blobStorageUrl, sasToken, context).getValue(); - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } - }; - } - - /** - * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire - * collection of keys from a key vault. - * - * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * @param context Additional context that is passed through the HTTP pipeline during the service call. - * - * @return A {@link Response} containing the {@link KeyVaultBackupOperation pre-backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid. - */ - Response preBackupWithResponse(String blobStorageUrl, String sasToken, Context context) { - PreBackupOperationParameters preBackupOperationParameters = new PreBackupOperationParameters() - .setStorageResourceUri(blobStorageUrl) - .setToken(sasToken) - .setUseManagedIdentity(sasToken == null); - context = enableSyncRestProxy(context); - - try { - ResponseBase backupOperationResponse = - clientImpl.preFullBackupWithResponse(vaultUrl, preBackupOperationParameters, context); - - return new SimpleResponse<>(backupOperationResponse.getRequest(), backupOperationResponse.getStatusCode(), - backupOperationResponse.getHeaders(), - (KeyVaultBackupOperation) transformToLongRunningOperation(backupOperationResponse.getValue())); - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } - } - /** * Initiates a full restore of the Key Vault. * @@ -525,9 +423,11 @@ Response preBackupWithResponse(String blobStorageUrl, S * *
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      *
      * SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+     *
      * PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
      *
      * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -669,121 +569,6 @@ private static PollResponse processRestoreOperationRes
             toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue());
     }
 
-    /**
-     * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
-     * collection of keys from a backup.
-     *
-     * 

Code Samples

- *

Starts a {@link KeyVaultRestoreOperation pre-restore operation}, polls for its status and waits for it to - * complete. Prints out error details in case the operation fails.

- * - *
-     * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * String sasToken = "<sas-token>";
-     *
-     * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> preRestorePoller =
-     *     client.beginPreRestore(folderUrl, sasToken);
-     * PollResponse<KeyVaultRestoreOperation> pollResponse = preRestorePoller.poll();
-     *
-     * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-     *
-     * PollResponse<KeyVaultRestoreOperation> finalPollResponse = preRestorePoller.waitForCompletion();
-     *
-     * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-     *     System.out.printf("Pre-restore check completed successfully.%n");
-     * } else {
-     *     KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
-     *
-     *     System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
-     * }
-     * 
- * - * - * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to - * the blob container where the backup resides. This would be the exact value that is returned as the result of a - * backup operation. An example of such a URL may look like the following: - * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * - * @return A {@link SyncPoller} to poll on the {@link KeyVaultRestoreOperation restore operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid. - * @throws NullPointerException If the {@code folderUrl} is {@code null}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginPreRestore(String folderUrl, String sasToken) { - if (folderUrl == null) { - throw LOGGER.logExceptionAsError( - new NullPointerException(String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'folderUrl'"))); - } - - Context context = Context.NONE; - - return SyncPoller.createPoller(getDefaultPollingInterval(), - cxt -> - new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, - preRestoreActivationOperation(folderUrl, sasToken, context) - .apply(cxt)), - restorePollOperation(context), - (pollingContext, firstResponse) -> { - throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported")); - }, - (pollingContext) -> new KeyVaultRestoreResult()); - } - - /** - * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire - * collection of keys from a backup. - * - * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to - * the blob container where the backup resides. This would be the exact value that is returned as the result of a - * backup operation. An example of such a URL may look like the following: - * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}. - * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null}, - * Managed Identity will be used to authenticate instead. - * @param context Additional context that is passed through the HTTP pipeline during the service call. - * - * @return A {@link Response} containing the {@link KeyVaultRestoreOperation backup operation} status. - * - * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid. - */ - Response preRestoreWithResponse(String folderUrl, String sasToken, Context context) { - String[] segments = folderUrl.split("/"); - String folderName = segments[segments.length - 1]; - String containerUrl = folderUrl.substring(0, folderUrl.length() - folderName.length()); - - SASTokenParameter sasTokenParameter = new SASTokenParameter(containerUrl) - .setToken(sasToken) - .setUseManagedIdentity(sasToken == null); - PreRestoreOperationParameters restoreOperationParameters = - new PreRestoreOperationParameters() - .setFolderToRestore(folderName) - .setSasTokenParameters(sasTokenParameter); - context = enableSyncRestProxy(context); - - try { - ResponseBase restoreOperationResponse = - clientImpl.preFullRestoreOperationWithResponse(vaultUrl, restoreOperationParameters, context); - return new SimpleResponse<>(restoreOperationResponse.getRequest(), - restoreOperationResponse.getStatusCode(), - restoreOperationResponse.getHeaders(), - (KeyVaultRestoreOperation) transformToLongRunningOperation(restoreOperationResponse.getValue())); - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } - } - - private Function, KeyVaultRestoreOperation> preRestoreActivationOperation(String folderUrl, String sasToken, Context context) { - return (pollingContext) -> { - try { - return preRestoreWithResponse(folderUrl, sasToken, context).getValue(); - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } - }; - } - /** * Restores all versions of a given key using the supplied SAS token pointing to a previously stored Azure Blob * storage backup folder. @@ -794,21 +579,23 @@ private Function, KeyVaultRestoreOperat * *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * String sasToken = "<sas-token>";
+     * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+     *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
      * String keyName = "myKey";
      *
-     * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
+     * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
      *     client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
+     *
+     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
      *
      * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
      *
-     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
      *
      * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
      *     System.out.printf("Key restored successfully.%n");
      * } else {
-     *     KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+     *     KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
      *
      *     System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
      * }
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
index 88a7c6f61f0dd..4cf02ee63d5f2 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
@@ -33,10 +33,6 @@
 import com.azure.security.keyvault.administration.implementation.models.FullBackupOperation;
 import com.azure.security.keyvault.administration.implementation.models.FullRestoreOperationHeaders;
 import com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException;
-import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters;
-import com.azure.security.keyvault.administration.implementation.models.PreFullBackupHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreFullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters;
 import com.azure.security.keyvault.administration.implementation.models.RestoreOperation;
 import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters;
 import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter;
@@ -61,7 +57,7 @@ public final class KeyVaultBackupClientImpl {
 
     /**
      * Gets Api Version.
-     *
+     * 
      * @return the apiVersion value.
      */
     public String getApiVersion() {
@@ -75,7 +71,7 @@ public String getApiVersion() {
 
     /**
      * Gets The HTTP pipeline to send requests through.
-     *
+     * 
      * @return the httpPipeline value.
      */
     public HttpPipeline getHttpPipeline() {
@@ -89,7 +85,7 @@ public HttpPipeline getHttpPipeline() {
 
     /**
      * Gets The serializer to serialize an object into a string.
-     *
+     * 
      * @return the serializerAdapter value.
      */
     public SerializerAdapter getSerializerAdapter() {
@@ -98,7 +94,7 @@ public SerializerAdapter getSerializerAdapter() {
 
     /**
      * Initializes an instance of KeyVaultBackupClient client.
-     *
+     * 
      * @param apiVersion Api Version.
      */
     public KeyVaultBackupClientImpl(String apiVersion) {
@@ -108,7 +104,7 @@ public KeyVaultBackupClientImpl(String apiVersion) {
 
     /**
      * Initializes an instance of KeyVaultBackupClient client.
-     *
+     * 
      * @param httpPipeline The HTTP pipeline to send requests through.
      * @param apiVersion Api Version.
      */
@@ -118,7 +114,7 @@ public KeyVaultBackupClientImpl(HttpPipeline httpPipeline, String apiVersion) {
 
     /**
      * Initializes an instance of KeyVaultBackupClient client.
-     *
+     * 
      * @param httpPipeline The HTTP pipeline to send requests through.
      * @param serializerAdapter The serializer to serialize an object into a string.
      * @param apiVersion Api Version.
@@ -154,22 +150,6 @@ ResponseBase fullBackupSync(
             @BodyParam("application/json") SASTokenParameter azureStorageBlobContainerUri,
             @HeaderParam("Accept") String accept, Context context);
 
-        @Post("/prebackup")
-        @ExpectedResponses({ 202 })
-        @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
-        Mono> preFullBackup(
-            @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
-            @BodyParam("application/json") PreBackupOperationParameters preBackupOperationParameters,
-            @HeaderParam("Accept") String accept, Context context);
-
-        @Post("/prebackup")
-        @ExpectedResponses({ 202 })
-        @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
-        ResponseBase preFullBackupSync(
-            @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
-            @BodyParam("application/json") PreBackupOperationParameters preBackupOperationParameters,
-            @HeaderParam("Accept") String accept, Context context);
-
         @Get("/backup/{jobId}/pending")
         @ExpectedResponses({ 200 })
         @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
@@ -184,22 +164,6 @@ Response fullBackupStatusSync(@HostParam("vaultBaseUrl") St
             @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion,
             @HeaderParam("Accept") String accept, Context context);
 
-        @Put("/prerestore")
-        @ExpectedResponses({ 202 })
-        @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
-        Mono> preFullRestoreOperation(
-            @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
-            @BodyParam("application/json") PreRestoreOperationParameters preRestoreOperationParameters,
-            @HeaderParam("Accept") String accept, Context context);
-
-        @Put("/prerestore")
-        @ExpectedResponses({ 202 })
-        @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
-        ResponseBase preFullRestoreOperationSync(
-            @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
-            @BodyParam("application/json") PreRestoreOperationParameters preRestoreOperationParameters,
-            @HeaderParam("Accept") String accept, Context context);
-
         @Put("/restore")
         @ExpectedResponses({ 202 })
         @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
@@ -251,7 +215,7 @@ Response restoreStatusSync(@HostParam("vaultBaseUrl") String v
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -271,7 +235,7 @@ public Mono> fullBackupWith
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -291,7 +255,7 @@ public Mono> fullBackupWith
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -310,7 +274,7 @@ public Mono fullBackupAsync(String vaultBaseUrl,
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -330,7 +294,7 @@ public Mono fullBackupAsync(String vaultBaseUrl,
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -351,7 +315,7 @@ public ResponseBase fullBackupWithRespon
 
     /**
      * Creates a full backup using a user-provided SAS token to an Azure blob storage container.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
      * container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -366,115 +330,9 @@ public FullBackupOperation fullBackup(String vaultBaseUrl, SASTokenParameter azu
         return fullBackupWithResponse(vaultBaseUrl, azureStorageBlobContainerUri, Context.NONE).getValue();
     }
 
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation along with {@link ResponseBase} on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono>
-        preFullBackupWithResponseAsync(String vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.preFullBackup(vaultBaseUrl, this.getApiVersion(),
-            preBackupOperationParameters, accept, context));
-    }
-
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation along with {@link ResponseBase} on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> preFullBackupWithResponseAsync(
-        String vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters, Context context) {
-        final String accept = "application/json";
-        return service.preFullBackup(vaultBaseUrl, this.getApiVersion(), preBackupOperationParameters, accept, context);
-    }
-
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono preFullBackupAsync(String vaultBaseUrl,
-        PreBackupOperationParameters preBackupOperationParameters) {
-        return preFullBackupWithResponseAsync(vaultBaseUrl, preBackupOperationParameters)
-            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
-    }
-
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono preFullBackupAsync(String vaultBaseUrl,
-        PreBackupOperationParameters preBackupOperationParameters, Context context) {
-        return preFullBackupWithResponseAsync(vaultBaseUrl, preBackupOperationParameters, context)
-            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
-    }
-
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation along with {@link ResponseBase}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public ResponseBase preFullBackupWithResponse(String vaultBaseUrl,
-        PreBackupOperationParameters preBackupOperationParameters, Context context) {
-        final String accept = "application/json";
-        return service.preFullBackupSync(vaultBaseUrl, this.getApiVersion(), preBackupOperationParameters, accept,
-            context);
-    }
-
-    /**
-     * Pre-backup operation for checking whether the customer can perform a full backup operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return full backup operation.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public FullBackupOperation preFullBackup(String vaultBaseUrl,
-        PreBackupOperationParameters preBackupOperationParameters) {
-        return preFullBackupWithResponse(vaultBaseUrl, preBackupOperationParameters, Context.NONE).getValue();
-    }
-
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -491,7 +349,7 @@ public Mono> fullBackupStatusWithResponseAsync(Str
 
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @param context The context to associate with this operation.
@@ -509,7 +367,7 @@ public Mono> fullBackupStatusWithResponseAsync(Str
 
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -524,7 +382,7 @@ public Mono fullBackupStatusAsync(String vaultBaseUrl, Stri
 
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @param context The context to associate with this operation.
@@ -541,7 +399,7 @@ public Mono fullBackupStatusAsync(String vaultBaseUrl, Stri
 
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @param context The context to associate with this operation.
@@ -559,7 +417,7 @@ public Response fullBackupStatusWithResponse(String vaultBa
 
     /**
      * Returns the status of full backup operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The id returned as part of the backup request.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -572,125 +430,9 @@ public FullBackupOperation fullBackupStatus(String vaultBaseUrl, String jobId) {
         return fullBackupStatusWithResponse(vaultBaseUrl, jobId, Context.NONE).getValue();
     }
 
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation along with {@link ResponseBase} on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono>
-        preFullRestoreOperationWithResponseAsync(String vaultBaseUrl,
-            PreRestoreOperationParameters preRestoreOperationParameters) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.preFullRestoreOperation(vaultBaseUrl, this.getApiVersion(),
-            preRestoreOperationParameters, accept, context));
-    }
-
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation along with {@link ResponseBase} on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono>
-        preFullRestoreOperationWithResponseAsync(String vaultBaseUrl,
-            PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
-        final String accept = "application/json";
-        return service.preFullRestoreOperation(vaultBaseUrl, this.getApiVersion(), preRestoreOperationParameters,
-            accept, context);
-    }
-
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono preFullRestoreOperationAsync(String vaultBaseUrl,
-        PreRestoreOperationParameters preRestoreOperationParameters) {
-        return preFullRestoreOperationWithResponseAsync(vaultBaseUrl, preRestoreOperationParameters)
-            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
-    }
-
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono preFullRestoreOperationAsync(String vaultBaseUrl,
-        PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
-        return preFullRestoreOperationWithResponseAsync(vaultBaseUrl, preRestoreOperationParameters, context)
-            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
-    }
-
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @param context The context to associate with this operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation along with {@link ResponseBase}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public ResponseBase preFullRestoreOperationWithResponse(
-        String vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
-        final String accept = "application/json";
-        return service.preFullRestoreOperationSync(vaultBaseUrl, this.getApiVersion(), preRestoreOperationParameters,
-            accept, context);
-    }
-
-    /**
-     * Pre-restore operation for checking whether the customer can perform a full restore operation.
-     *
-     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
-     * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
-     * restore operation.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws KeyVaultErrorException thrown if the request is rejected by server.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return restore operation.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public RestoreOperation preFullRestoreOperation(String vaultBaseUrl,
-        PreRestoreOperationParameters preRestoreOperationParameters) {
-        return preFullRestoreOperationWithResponse(vaultBaseUrl, preRestoreOperationParameters, Context.NONE)
-            .getValue();
-    }
-
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -709,7 +451,7 @@ public RestoreOperation preFullRestoreOperation(String vaultBaseUrl,
 
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -728,7 +470,7 @@ public Mono> fullRes
 
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -746,7 +488,7 @@ public Mono fullRestoreOperationAsync(String vaultBaseUrl,
 
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -765,7 +507,7 @@ public Mono fullRestoreOperationAsync(String vaultBaseUrl,
 
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -785,7 +527,7 @@ public ResponseBase fullRestoreOp
 
     /**
      * Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
      * was stored.
@@ -801,7 +543,7 @@ public RestoreOperation fullRestoreOperation(String vaultBaseUrl, RestoreOperati
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -818,7 +560,7 @@ public Mono> restoreStatusWithResponseAsync(String va
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @param context The context to associate with this operation.
@@ -836,7 +578,7 @@ public Mono> restoreStatusWithResponseAsync(String va
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -851,7 +593,7 @@ public Mono restoreStatusAsync(String vaultBaseUrl, String job
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @param context The context to associate with this operation.
@@ -868,7 +610,7 @@ public Mono restoreStatusAsync(String vaultBaseUrl, String job
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @param context The context to associate with this operation.
@@ -885,7 +627,7 @@ public Response restoreStatusWithResponse(String vaultBaseUrl,
 
     /**
      * Returns the status of restore operation.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param jobId The Job Id returned part of the restore operation.
      * @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -901,7 +643,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -923,7 +665,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -946,7 +688,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -966,7 +708,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -987,7 +729,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -1010,7 +752,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
     /**
      * Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
      * storage backup folder.
-     *
+     * 
      * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
      * @param keyName The name of the key to be restored from the user supplied backup.
      * @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java
deleted file mode 100644
index c8a6be3a6278a..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-
-/**
- * The PreBackupOperationParameters model.
- */
-@Fluent
-public final class PreBackupOperationParameters implements JsonSerializable {
-    /*
-     * Azure Blob storage container Uri
-     */
-    private String storageResourceUri;
-
-    /*
-     * The SAS token pointing to an Azure Blob storage container
-     */
-    private String token;
-
-    /*
-     * Indicates which authentication method should be used. If set to true, Managed HSM will use the configured
-     * user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified.
-     */
-    private Boolean useManagedIdentity;
-
-    /**
-     * Creates an instance of PreBackupOperationParameters class.
-     */
-    public PreBackupOperationParameters() {
-    }
-
-    /**
-     * Get the storageResourceUri property: Azure Blob storage container Uri.
-     *
-     * @return the storageResourceUri value.
-     */
-    public String getStorageResourceUri() {
-        return this.storageResourceUri;
-    }
-
-    /**
-     * Set the storageResourceUri property: Azure Blob storage container Uri.
-     *
-     * @param storageResourceUri the storageResourceUri value to set.
-     * @return the PreBackupOperationParameters object itself.
-     */
-    public PreBackupOperationParameters setStorageResourceUri(String storageResourceUri) {
-        this.storageResourceUri = storageResourceUri;
-        return this;
-    }
-
-    /**
-     * Get the token property: The SAS token pointing to an Azure Blob storage container.
-     *
-     * @return the token value.
-     */
-    public String getToken() {
-        return this.token;
-    }
-
-    /**
-     * Set the token property: The SAS token pointing to an Azure Blob storage container.
-     *
-     * @param token the token value to set.
-     * @return the PreBackupOperationParameters object itself.
-     */
-    public PreBackupOperationParameters setToken(String token) {
-        this.token = token;
-        return this;
-    }
-
-    /**
-     * Get the useManagedIdentity property: Indicates which authentication method should be used. If set to true,
-     * Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage.
-     * Otherwise, a SAS token has to be specified.
-     *
-     * @return the useManagedIdentity value.
-     */
-    public Boolean isUseManagedIdentity() {
-        return this.useManagedIdentity;
-    }
-
-    /**
-     * Set the useManagedIdentity property: Indicates which authentication method should be used. If set to true,
-     * Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage.
-     * Otherwise, a SAS token has to be specified.
-     *
-     * @param useManagedIdentity the useManagedIdentity value to set.
-     * @return the PreBackupOperationParameters object itself.
-     */
-    public PreBackupOperationParameters setUseManagedIdentity(Boolean useManagedIdentity) {
-        this.useManagedIdentity = useManagedIdentity;
-        return this;
-    }
-
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeStringField("storageResourceUri", this.storageResourceUri);
-        jsonWriter.writeStringField("token", this.token);
-        jsonWriter.writeBooleanField("useManagedIdentity", this.useManagedIdentity);
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of PreBackupOperationParameters from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of PreBackupOperationParameters if the JsonReader was pointing to an instance of it, or null
-     * if it was pointing to JSON null.
-     * @throws IOException If an error occurs while reading the PreBackupOperationParameters.
-     */
-    public static PreBackupOperationParameters fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            PreBackupOperationParameters deserializedPreBackupOperationParameters = new PreBackupOperationParameters();
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-
-                if ("storageResourceUri".equals(fieldName)) {
-                    deserializedPreBackupOperationParameters.storageResourceUri = reader.getString();
-                } else if ("token".equals(fieldName)) {
-                    deserializedPreBackupOperationParameters.token = reader.getString();
-                } else if ("useManagedIdentity".equals(fieldName)) {
-                    deserializedPreBackupOperationParameters.useManagedIdentity
-                        = reader.getNullable(JsonReader::getBoolean);
-                } else {
-                    reader.skipChildren();
-                }
-            }
-
-            return deserializedPreBackupOperationParameters;
-        });
-    }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java
deleted file mode 100644
index 9a2f0a0902ba3..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.http.HttpHeaderName;
-import com.azure.core.http.HttpHeaders;
-
-/**
- * The PreFullBackupHeaders model.
- */
-@Fluent
-public final class PreFullBackupHeaders {
-    /*
-     * The Retry-After property.
-     */
-    private Long retryAfter;
-
-    /*
-     * The Azure-AsyncOperation property.
-     */
-    private String azureAsyncOperation;
-
-    private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation");
-
-    // HttpHeaders containing the raw property values.
-    /**
-     * Creates an instance of PreFullBackupHeaders class.
-     *
-     * @param rawHeaders The raw HttpHeaders that will be used to create the property values.
-     */
-    public PreFullBackupHeaders(HttpHeaders rawHeaders) {
-        String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER);
-        if (retryAfter != null) {
-            this.retryAfter = Long.parseLong(retryAfter);
-        }
-        this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION);
-    }
-
-    /**
-     * Get the retryAfter property: The Retry-After property.
-     *
-     * @return the retryAfter value.
-     */
-    public Long getRetryAfter() {
-        return this.retryAfter;
-    }
-
-    /**
-     * Set the retryAfter property: The Retry-After property.
-     *
-     * @param retryAfter the retryAfter value to set.
-     * @return the PreFullBackupHeaders object itself.
-     */
-    public PreFullBackupHeaders setRetryAfter(Long retryAfter) {
-        this.retryAfter = retryAfter;
-        return this;
-    }
-
-    /**
-     * Get the azureAsyncOperation property: The Azure-AsyncOperation property.
-     *
-     * @return the azureAsyncOperation value.
-     */
-    public String getAzureAsyncOperation() {
-        return this.azureAsyncOperation;
-    }
-
-    /**
-     * Set the azureAsyncOperation property: The Azure-AsyncOperation property.
-     *
-     * @param azureAsyncOperation the azureAsyncOperation value to set.
-     * @return the PreFullBackupHeaders object itself.
-     */
-    public PreFullBackupHeaders setAzureAsyncOperation(String azureAsyncOperation) {
-        this.azureAsyncOperation = azureAsyncOperation;
-        return this;
-    }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java
deleted file mode 100644
index 4a44da9e1280a..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.http.HttpHeaderName;
-import com.azure.core.http.HttpHeaders;
-
-/**
- * The PreFullRestoreOperationHeaders model.
- */
-@Fluent
-public final class PreFullRestoreOperationHeaders {
-    /*
-     * The Retry-After property.
-     */
-    private Long retryAfter;
-
-    /*
-     * The Azure-AsyncOperation property.
-     */
-    private String azureAsyncOperation;
-
-    private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation");
-
-    // HttpHeaders containing the raw property values.
-    /**
-     * Creates an instance of PreFullRestoreOperationHeaders class.
-     *
-     * @param rawHeaders The raw HttpHeaders that will be used to create the property values.
-     */
-    public PreFullRestoreOperationHeaders(HttpHeaders rawHeaders) {
-        String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER);
-        if (retryAfter != null) {
-            this.retryAfter = Long.parseLong(retryAfter);
-        }
-        this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION);
-    }
-
-    /**
-     * Get the retryAfter property: The Retry-After property.
-     *
-     * @return the retryAfter value.
-     */
-    public Long getRetryAfter() {
-        return this.retryAfter;
-    }
-
-    /**
-     * Set the retryAfter property: The Retry-After property.
-     *
-     * @param retryAfter the retryAfter value to set.
-     * @return the PreFullRestoreOperationHeaders object itself.
-     */
-    public PreFullRestoreOperationHeaders setRetryAfter(Long retryAfter) {
-        this.retryAfter = retryAfter;
-        return this;
-    }
-
-    /**
-     * Get the azureAsyncOperation property: The Azure-AsyncOperation property.
-     *
-     * @return the azureAsyncOperation value.
-     */
-    public String getAzureAsyncOperation() {
-        return this.azureAsyncOperation;
-    }
-
-    /**
-     * Set the azureAsyncOperation property: The Azure-AsyncOperation property.
-     *
-     * @param azureAsyncOperation the azureAsyncOperation value to set.
-     * @return the PreFullRestoreOperationHeaders object itself.
-     */
-    public PreFullRestoreOperationHeaders setAzureAsyncOperation(String azureAsyncOperation) {
-        this.azureAsyncOperation = azureAsyncOperation;
-        return this;
-    }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java
deleted file mode 100644
index a720ab06700d4..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-
-/**
- * The PreRestoreOperationParameters model.
- */
-@Fluent
-public final class PreRestoreOperationParameters implements JsonSerializable {
-    /*
-     * The sasTokenParameters property.
-     */
-    private SASTokenParameter sasTokenParameters;
-
-    /*
-     * The Folder name of the blob where the previous successful full backup was stored
-     */
-    private String folderToRestore;
-
-    /**
-     * Creates an instance of PreRestoreOperationParameters class.
-     */
-    public PreRestoreOperationParameters() {
-    }
-
-    /**
-     * Get the sasTokenParameters property: The sasTokenParameters property.
-     *
-     * @return the sasTokenParameters value.
-     */
-    public SASTokenParameter getSasTokenParameters() {
-        return this.sasTokenParameters;
-    }
-
-    /**
-     * Set the sasTokenParameters property: The sasTokenParameters property.
-     *
-     * @param sasTokenParameters the sasTokenParameters value to set.
-     * @return the PreRestoreOperationParameters object itself.
-     */
-    public PreRestoreOperationParameters setSasTokenParameters(SASTokenParameter sasTokenParameters) {
-        this.sasTokenParameters = sasTokenParameters;
-        return this;
-    }
-
-    /**
-     * Get the folderToRestore property: The Folder name of the blob where the previous successful full backup was
-     * stored.
-     *
-     * @return the folderToRestore value.
-     */
-    public String getFolderToRestore() {
-        return this.folderToRestore;
-    }
-
-    /**
-     * Set the folderToRestore property: The Folder name of the blob where the previous successful full backup was
-     * stored.
-     *
-     * @param folderToRestore the folderToRestore value to set.
-     * @return the PreRestoreOperationParameters object itself.
-     */
-    public PreRestoreOperationParameters setFolderToRestore(String folderToRestore) {
-        this.folderToRestore = folderToRestore;
-        return this;
-    }
-
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeJsonField("sasTokenParameters", this.sasTokenParameters);
-        jsonWriter.writeStringField("folderToRestore", this.folderToRestore);
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of PreRestoreOperationParameters from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of PreRestoreOperationParameters if the JsonReader was pointing to an instance of it, or null
-     * if it was pointing to JSON null.
-     * @throws IOException If an error occurs while reading the PreRestoreOperationParameters.
-     */
-    public static PreRestoreOperationParameters fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            PreRestoreOperationParameters deserializedPreRestoreOperationParameters
-                = new PreRestoreOperationParameters();
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-
-                if ("sasTokenParameters".equals(fieldName)) {
-                    deserializedPreRestoreOperationParameters.sasTokenParameters = SASTokenParameter.fromJson(reader);
-                } else if ("folderToRestore".equals(fieldName)) {
-                    deserializedPreRestoreOperationParameters.folderToRestore = reader.getString();
-                } else {
-                    reader.skipChildren();
-                }
-            }
-
-            return deserializedPreRestoreOperationParameters;
-        });
-    }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
index b753f047dcb97..1132a91286a5c 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
@@ -312,45 +312,6 @@
  * com.azure.security.keyvault.administration.KeyVaultAccessControlAsyncClient}. 
*
* - *

Run Pre-Backup Check for a Collection of Keys

- * - * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to check if it is possible to - * back up the entire collection of keys from a key vault. - * - *

- * Code Sample: - * - *

- * The following code sample demonstrates how to synchronously check if it is possible to back up an entire collection - * of keys, using the - * {@link com.azure.security.keyvault.administration.KeyVaultBackupClient#beginPreBackup(String, String)} API. - * - *

- * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultBackupOperation, String> preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
- * PollResponse<KeyVaultBackupOperation> pollResponse = preBackupPoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultBackupOperation> finalPollResponse = preBackupPoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- *     System.out.printf("Pre-backup check completed successfully.%n");
- * } else {
- *     KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
- *
- *     System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
- * }
- * 
- * - * - *

- * Note: For the asynchronous sample, refer to {@link - * com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}.
- *


- * *

Back Up a Collection of Keys

* * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to back up the entire @@ -365,9 +326,11 @@ * *
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
  * SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
  * PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -391,46 +354,6 @@
  * com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}. 
*
* - *

Run Pre-Restore Check for a Collection of Keys

- * - * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to check if it is possible to - * restore an entire collection of keys from a backup. - * - *

- * Code Sample: - * - *

- * The following code sample demonstrates how to synchronously check if it is possible to restore an entire collection - * of keys from a backup, using the - * {@link com.azure.security.keyvault.administration.KeyVaultBackupClient#beginPreRestore(String, String)} API. - * - *

- * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> preRestorePoller =
- *     client.beginPreRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = preRestorePoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = preRestorePoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- *     System.out.printf("Pre-restore check completed successfully.%n");
- * } else {
- *     KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
- *
- *     System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
- * }
- * 
- * - * - *

- * Note: For the asynchronous sample, refer to {@link - * com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}.
- *


- * *

Restore a Collection of Keys

* * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to restore an entire @@ -445,20 +368,22 @@ * *
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ *     + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
  *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
  *     client.beginRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Backup restored successfully.%n");
  * } else {
- *     KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ *     KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
  *
  *     System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
  * }
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
index f7d0108edc7a5..7fa3c2c0dad7f 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
@@ -293,44 +293,17 @@ public void createBackupClient() {
         // END: readme-sample-createBackupClient
     }
 
-    /**
-     * Code sample for starting a {@link KeyVaultBackupOperation pre-backup check}.
-     */
-    public void beginPreBackup() {
-        // BEGIN: readme-sample-beginPreBackup
-        String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
-
-        SyncPoller preBackupPoller =
-            keyVaultBackupClient.beginPreBackup(blobStorageUrl, sasToken);
-        PollResponse pollResponse = preBackupPoller.poll();
-
-        System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
-        PollResponse finalPollResponse = preBackupPoller.waitForCompletion();
-
-        if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-            String folderUrl = preBackupPoller.getFinalResult();
-
-            System.out.printf("Pre-backup check completed successfully.%n");
-        } else {
-            KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
-
-            System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
-        }
-        // END: readme-sample-beginPreBackup
-    }
-
     /**
      * Code sample for starting a {@link KeyVaultBackupOperation backup operation}.
      */
     public void beginBackup() {
         // BEGIN: readme-sample-beginBackup
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         SyncPoller backupPoller =
             keyVaultBackupClient.beginBackup(blobStorageUrl, sasToken);
+
         PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -349,52 +322,27 @@ public void beginBackup() {
         // END: readme-sample-beginBackup
     }
 
-    /**
-     * Code sample for starting a {@link KeyVaultRestoreOperation pre-restore check}.
-     */
-    public void beginPreRestore() {
-        // BEGIN: readme-sample-beginPreRestore
-        String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
-
-        SyncPoller preRestorePoller =
-            keyVaultBackupClient.beginPreRestore(folderUrl, sasToken);
-        PollResponse pollResponse = preRestorePoller.poll();
-
-        System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
-        PollResponse finalPollResponse = preRestorePoller.waitForCompletion();
-
-        if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-            System.out.printf("Pre-restore check completed successfully.%n");
-        } else {
-            KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
-
-            System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
-        }
-        // END: readme-sample-beginPreRestore
-    }
-
     /**
      * Code sample for starting a {@link KeyVaultRestoreOperation restore operation}.
      */
     public void beginRestore() {
         // BEGIN: readme-sample-beginRestore
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
-        SyncPoller restorePoller =
+        SyncPoller backupPoller =
             keyVaultBackupClient.beginRestore(folderUrl, sasToken);
-        PollResponse pollResponse = restorePoller.poll();
+
+        PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = restorePoller.waitForCompletion();
+        PollResponse finalPollResponse = backupPoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Backup restored successfully.%n");
         } else {
-            KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+            KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
 
             System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
         }
@@ -407,54 +355,35 @@ public void beginRestore() {
     public void beginSelectiveKeyRestore() {
         // BEGIN: readme-sample-beginSelectiveKeyRestore
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
         String keyName = "myKey";
 
-        SyncPoller restorePoller =
+        SyncPoller backupPoller =
             keyVaultBackupClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-        PollResponse pollResponse = restorePoller.poll();
+
+        PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = restorePoller.waitForCompletion();
+        PollResponse finalPollResponse = backupPoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Key restored successfully.%n");
         } else {
-            KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+            KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
 
             System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
         }
         // END: readme-sample-beginSelectiveKeyRestore
     }
 
-    /**
-     * Code sample for starting a {@link KeyVaultBackupOperation pre-backup check} asynchronously.
-     */
-    public void beginPreBackupAsync() {
-        // BEGIN: readme-sample-beginPreBackupAsync
-        String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
-
-        keyVaultBackupAsyncClient.beginPreBackup(blobStorageUrl, sasToken)
-            .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-            .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
-            .doOnNext(pollResponse ->
-                System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-            .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-            .flatMap(AsyncPollResponse::getFinalResult)
-            .subscribe(folderUrl ->
-                System.out.printf("Pre-backup check completed successfully.%n"));
-        // END: readme-sample-beginPreBackupAsync
-    }
-
     /**
      * Code sample for starting a {@link KeyVaultBackupOperation backup operation} asynchronously.
      */
     public void beginBackupAsync() {
         // BEGIN: readme-sample-beginBackupAsync
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -468,32 +397,13 @@ public void beginBackupAsync() {
         // END: readme-sample-beginBackupAsync
     }
 
-    /**
-     * Code sample for starting a {@link KeyVaultRestoreOperation pre-restore check} asynchronously.
-     */
-    public void beginPreRestoreAsync() {
-        // BEGIN: readme-sample-beginPreRestoreAsync
-        String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
-
-        keyVaultBackupAsyncClient.beginPreRestore(folderUrl, sasToken)
-            .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-            .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
-            .doOnNext(pollResponse ->
-                System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-            .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-            .flatMap(AsyncPollResponse::getFinalResult)
-            .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
-        // END: readme-sample-beginPreRestoreAsync
-    }
-
     /**
      * Code sample for starting a {@link KeyVaultRestoreOperation restore operation} asynchronously.
      */
     public void beginRestoreAsync() {
         // BEGIN: readme-sample-beginRestoreAsync
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -513,7 +423,7 @@ public void beginRestoreAsync() {
     public void beginSelectiveKeyRestoreAsync() {
         // BEGIN: readme-sample-beginSelectiveKeyRestoreAsync
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
         String keyName = "myKey";
 
         keyVaultBackupAsyncClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
index 158569649064e..57e9b916a1c0c 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
@@ -50,27 +50,6 @@ public KeyVaultBackupAsyncClient createAsyncClientWithHttpClient() {
         return keyVaultBackupAsyncClient;
     }
 
-    /**
-     * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginPreBackup(String, String)}.
-     */
-    public void beginPreBackup() {
-        KeyVaultBackupAsyncClient client = createAsyncClient();
-
-        // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreBackup#String-String
-        String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
-
-        client.beginPreBackup(blobStorageUrl, sasToken)
-            .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-            .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
-            .doOnNext(pollResponse ->
-                System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-            .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-            .flatMap(AsyncPollResponse::getFinalResult)
-            .subscribe(unused -> System.out.printf("Pre-backup check completed successfully.%n"));
-        // END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreBackup#String-String
-    }
-
     /**
      * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginBackup(String, String)}.
      */
@@ -79,7 +58,8 @@ public void beginBackup() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginBackup#String-String
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         client.beginBackup(blobStorageUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -93,27 +73,6 @@ public void beginBackup() {
         // END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginBackup#String-String
     }
 
-    /**
-     * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginPreRestore(String, String)}.
-     */
-    public void beginPreRestore() {
-        KeyVaultBackupAsyncClient client = createAsyncClient();
-
-        // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreRestore#String-String
-        String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
-
-        client.beginPreRestore(folderUrl, sasToken)
-            .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
-            .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
-            .doOnNext(pollResponse ->
-                System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
-            .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-            .flatMap(AsyncPollResponse::getFinalResult)
-            .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
-        // END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreRestore#String-String
-    }
-
     /**
      * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginRestore(String, String)}.
      */
@@ -122,7 +81,8 @@ public void beginRestore() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginRestore#String-String
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         client.beginRestore(folderUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -144,7 +104,8 @@ public void beginSelectiveKeyRestore() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginSelectiveKeyRestore#String-String-String
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
         String keyName = "myKey";
 
         client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
index 1c0788b0b3c22..a0a0b8f1dab87 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
@@ -34,33 +34,6 @@ public KeyVaultBackupClient createClient() {
         return keyVaultBackupClient;
     }
 
-    /**
-     * Generates code samples for using {@link KeyVaultBackupClient#beginPreBackup(String, String)}.
-     */
-    public void beginPreBackup() {
-        KeyVaultBackupClient client = createClient();
-
-        // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreBackup#String-String
-        String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
-
-        SyncPoller preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
-        PollResponse pollResponse = preBackupPoller.poll();
-
-        System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
-        PollResponse finalPollResponse = preBackupPoller.waitForCompletion();
-
-        if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-            System.out.printf("Pre-backup check completed successfully.%n");
-        } else {
-            KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
-
-            System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
-        }
-        // END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreBackup#String-String
-    }
-
     /**
      * Generates code samples for using {@link KeyVaultBackupClient#beginBackup(String, String)}.
      */
@@ -69,9 +42,11 @@ public void beginBackup() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginBackup#String-String
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
         SyncPoller backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+
         PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -90,34 +65,6 @@ public void beginBackup() {
         // END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginBackup#String-String
     }
 
-    /**
-     * Generates code samples for using {@link KeyVaultBackupClient#beginPreRestore(String, String)}.
-     */
-    public void beginPreRestore() {
-        KeyVaultBackupClient client = createClient();
-
-        // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreRestore#String-String
-        String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
-
-        SyncPoller preRestorePoller =
-            client.beginPreRestore(folderUrl, sasToken);
-        PollResponse pollResponse = preRestorePoller.poll();
-
-        System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
-        PollResponse finalPollResponse = preRestorePoller.waitForCompletion();
-
-        if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
-            System.out.printf("Pre-restore check completed successfully.%n");
-        } else {
-            KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
-
-            System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
-        }
-        // END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreRestore#String-String
-    }
-
     /**
      * Generates code samples for using {@link KeyVaultBackupClient#beginRestore(String, String)}.
      */
@@ -126,20 +73,22 @@ public void beginRestore() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginRestore#String-String
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
 
-        SyncPoller restorePoller =
+        SyncPoller backupPoller =
             client.beginRestore(folderUrl, sasToken);
-        PollResponse pollResponse = restorePoller.poll();
+
+        PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = restorePoller.waitForCompletion();
+        PollResponse finalPollResponse = backupPoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Backup restored successfully.%n");
         } else {
-            KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+            KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
 
             System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
         }
@@ -154,21 +103,23 @@ public void beginSelectiveKeyRestore() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginSelectiveKeyRestore#String-String-String
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        String sasToken = "";
+        String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+            + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
         String keyName = "myKey";
 
-        SyncPoller restorePoller =
+        SyncPoller backupPoller =
             client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-        PollResponse pollResponse = restorePoller.poll();
+
+        PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = restorePoller.waitForCompletion();
+        PollResponse finalPollResponse = backupPoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Key restored successfully.%n");
         } else {
-            KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+            KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
 
             System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
         }
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
index 50d4d53a7015e..5f7e65aead11a 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
@@ -29,11 +29,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
         asyncClient = getClientBuilder(buildAsyncAssertingClient(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
             .buildAsyncClient();
-
-        if (!interceptorManager.isLiveMode()) {
-            // Remove `id` and `name` sanitizers from the list of common sanitizers.
-            interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
-        }
     }
 
     private HttpClient buildAsyncAssertingClient(HttpClient httpClient) {
@@ -222,7 +217,7 @@ public void createRoleAssignment(HttpClient httpClient) {
                     KeyVaultRoleAssignmentProperties properties = roleAssignment.getProperties();
 
                     assertNotNull(properties);
-                    assertNotNull(properties.getPrincipalId());
+                    assertEquals(servicePrincipalId, properties.getPrincipalId());
                     assertEquals(KeyVaultRoleScope.GLOBAL, properties.getScope());
 
                     KeyVaultRoleDefinition roleDefinition = tuple.getT1();
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
index 33822a59c17fc..cae65a605f98d 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
@@ -29,10 +29,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
         client = getClientBuilder(buildSyncAssertingClient(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
             .buildClient();
-        if (!interceptorManager.isLiveMode()) {
-            // Remove `id` and `name` sanitizers from the list of common sanitizers.
-            interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
-        }
     }
 
     private HttpClient buildSyncAssertingClient(HttpClient httpClient) {
@@ -215,7 +211,7 @@ public void createRoleAssignment(HttpClient httpClient) {
             KeyVaultRoleAssignmentProperties properties = createdRoleAssignment.getProperties();
 
             assertNotNull(properties);
-            assertNotNull(properties.getPrincipalId());
+            assertEquals(servicePrincipalId, properties.getPrincipalId());
             assertEquals(createdRoleDefinition.getId(), properties.getRoleDefinitionId());
             assertEquals(KeyVaultRoleScope.GLOBAL, properties.getScope());
         } finally {
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
index bcddfaf61d1e6..1912b0a0d0839 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
@@ -23,7 +23,7 @@ public abstract class KeyVaultAccessControlClientTestBase extends KeyVaultAdmini
     private static final ClientLogger LOGGER = new ClientLogger(KeyVaultAccessControlClientTestBase.class);
 
     protected final String servicePrincipalId =
-        Configuration.getGlobalConfiguration().get("CLIENT_OBJECTID", "f84ae8f9-c979-4750-a2fe-b350a00bebff");
+        Configuration.getGlobalConfiguration().get("CLIENT_OBJECTID", "3a107ba6-6cc0-40cf-9fed-22b612269c92");
 
     KeyVaultAccessControlClientBuilder getClientBuilder(HttpClient httpClient, boolean forCleanup) {
         return new KeyVaultAccessControlClientBuilder()
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
index ff488e7ca3d10..a5ffb214a4ad3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
@@ -24,8 +24,7 @@
 import com.azure.core.test.models.TestProxySanitizerType;
 import com.azure.core.test.utils.MockTokenCredential;
 import com.azure.core.util.Configuration;
-import com.azure.identity.AzurePowerShellCredentialBuilder;
-import com.azure.identity.DefaultAzureCredentialBuilder;
+import com.azure.identity.ClientSecretCredentialBuilder;
 import com.azure.security.keyvault.administration.implementation.KeyVaultCredentialPolicy;
 import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.params.provider.Arguments;
@@ -59,13 +58,28 @@ protected String getTestName() {
 
     HttpPipeline getPipeline(HttpClient httpClient, boolean forCleanup) {
         TokenCredential credential;
-        if (interceptorManager.isLiveMode()) {
-            credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build();
-        } else if (interceptorManager.isRecordMode()) {
-            credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build();
-            List customSanitizers = new ArrayList<>();
-            customSanitizers.add(new TestProxySanitizer("token", null, "REDACTED", TestProxySanitizerType.BODY_KEY));
-            interceptorManager.addSanitizers(customSanitizers);
+
+        if (!interceptorManager.isPlaybackMode()) {
+            String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID");
+            String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET");
+            String tenantId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID");
+
+            Objects.requireNonNull(clientId, "The client id cannot be null");
+            Objects.requireNonNull(clientKey, "The client key cannot be null");
+            Objects.requireNonNull(tenantId, "The tenant id cannot be null");
+
+            credential = new ClientSecretCredentialBuilder()
+                .clientSecret(clientKey)
+                .clientId(clientId)
+                .tenantId(tenantId)
+                .additionallyAllowedTenants("*")
+                .build();
+
+            if (interceptorManager.isRecordMode()) {
+                List customSanitizers = new ArrayList<>();
+                customSanitizers.add(new TestProxySanitizer("token", null, "REDACTED", TestProxySanitizerType.BODY_KEY));
+                interceptorManager.addSanitizers(customSanitizers);
+            }
         } else {
             credential = new MockTokenCredential();
 
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
index 1e8baaddd8101..6c3be6ed35a8a 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
@@ -5,20 +5,24 @@
 import com.azure.core.http.HttpClient;
 import com.azure.core.test.http.AssertingHttpClientBuilder;
 import com.azure.core.util.polling.AsyncPollResponse;
-import com.azure.security.keyvault.keys.KeyClient;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.security.keyvault.administration.models.KeyVaultBackupOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultRestoreOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultRestoreResult;
+import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreResult;
+import com.azure.security.keyvault.keys.KeyAsyncClient;
 import com.azure.security.keyvault.keys.KeyClientBuilder;
+import com.azure.security.keyvault.keys.KeyServiceVersion;
 import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions;
 import com.azure.security.keyvault.keys.models.KeyVaultKey;
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
-import reactor.test.StepVerifier;
 
 import java.time.OffsetDateTime;
 import java.time.ZoneOffset;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class KeyVaultBackupAsyncClientTest extends KeyVaultBackupClientTestBase {
@@ -45,34 +49,13 @@ private HttpClient buildAsyncAssertingClient(HttpClient httpClient) {
     public void beginBackup(HttpClient httpClient) {
         getAsyncClient(httpClient, false);
 
-        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
-                .last()
-                .flatMap(AsyncPollResponse::getFinalResult))
-            .assertNext(backupBlobUri -> {
-                assertNotNull(backupBlobUri);
-                assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-            })
-            .verifyComplete();
-    }
-
-    /**
-     * Tests that a Key Vault or MHSM can be pre-backed up.
-     */
-    @SuppressWarnings("ConstantConditions")
-    @ParameterizedTest(name = DISPLAY_NAME)
-    @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
-    public void beginPreBackup(HttpClient httpClient) {
-        getAsyncClient(httpClient, false);
+        AsyncPollResponse backupPollResponse =
+            setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken)).blockLast();
 
-        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginPreBackup(blobStorageUrl, sasToken))
-                .last()
-                .flatMap(AsyncPollResponse::getFinalResult)
-                .mapNotNull(backupBlobUri -> {
-                    assertNull(backupBlobUri);
+        String backupBlobUri = backupPollResponse.getFinalResult().block();
 
-                    return backupBlobUri;
-                }))
-            .verifyComplete();
+        assertNotNull(backupBlobUri);
+        assertTrue(backupBlobUri.startsWith(blobStorageUrl));
     }
 
     /**
@@ -84,49 +67,26 @@ public void beginPreBackup(HttpClient httpClient) {
     public void beginRestore(HttpClient httpClient) {
         getAsyncClient(httpClient, false);
 
-        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
-                .last()
-                .flatMap(AsyncPollResponse::getFinalResult)
-                .map(backupBlobUri -> {
-                    assertNotNull(backupBlobUri);
-                    assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
-                    return backupBlobUri;
-                })
-                .map(backupBlobUri -> asyncClient.beginRestore(backupBlobUri, sasToken)
-                    .last()
-                    .map(AsyncPollResponse::getValue)))
-            .assertNext(Assertions::assertNotNull)
-            .verifyComplete();
+        // Create a backup
+        AsyncPollResponse backupPollResponse =
+            setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
+                .takeUntil(asyncPollResponse ->
+                    asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+                .blockLast();
 
-        // For some reason, the service might still think a restore operation is running even after returning a success
-        // signal. This gives it some time to "clear" the operation.
-        sleepIfRunningAgainstService(30000);
-    }
+        KeyVaultBackupOperation backupOperation = backupPollResponse.getValue();
+        assertNotNull(backupOperation);
 
-    /**
-     * Tests that a Key Vault can be pre-restored from a backup.
-     */
-    @SuppressWarnings("ConstantConditions")
-    @ParameterizedTest(name = DISPLAY_NAME)
-    @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
-    public void beginPreRestore(HttpClient httpClient) {
-        getAsyncClient(httpClient, false);
+        // Restore the backup
+        String backupFolderUrl = backupOperation.getAzureStorageBlobContainerUrl();
+        AsyncPollResponse restorePollResponse =
+            setPlaybackPollerFluxPollInterval(asyncClient.beginRestore(backupFolderUrl, sasToken))
+                .takeUntil(asyncPollResponse ->
+                    asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+                .blockLast();
 
-        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
-                .last()
-                .flatMap(AsyncPollResponse::getFinalResult)
-                .map(backupBlobUri -> {
-                    assertNotNull(backupBlobUri);
-                    assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
-                    return backupBlobUri;
-                })
-                .map(backupBlobUri -> asyncClient.beginPreRestore(backupBlobUri, sasToken)
-                    .last()
-                    .map(AsyncPollResponse::getValue)))
-            .assertNext(Assertions::assertNotNull)
-            .verifyComplete();
+        KeyVaultRestoreOperation restoreOperation = restorePollResponse.getValue();
+        assertNotNull(restoreOperation);
 
         // For some reason, the service might still think a restore operation is running even after returning a success
         // signal. This gives it some time to "clear" the operation.
@@ -140,35 +100,42 @@ public void beginPreRestore(HttpClient httpClient) {
     @ParameterizedTest(name = DISPLAY_NAME)
     @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
     public void beginSelectiveKeyRestore(HttpClient httpClient) {
-        KeyClient keyClient = new KeyClientBuilder()
+        KeyAsyncClient keyClient = new KeyClientBuilder()
             .vaultUrl(getEndpoint())
+            .serviceVersion(KeyServiceVersion.V7_2)
             .pipeline(getPipeline(httpClient, false))
-            .buildClient();
+            .buildAsyncClient();
 
         String keyName = testResourceNamer.randomName("backupKey", 20);
         CreateRsaKeyOptions rsaKeyOptions = new CreateRsaKeyOptions(keyName)
             .setExpiresOn(OffsetDateTime.of(2050, 1, 30, 0, 0, 0, 0, ZoneOffset.UTC))
             .setNotBefore(OffsetDateTime.of(2000, 1, 30, 12, 59, 59, 0, ZoneOffset.UTC));
 
-        KeyVaultKey createdKey = keyClient.createRsaKey(rsaKeyOptions);
+        KeyVaultKey createdKey = keyClient.createRsaKey(rsaKeyOptions).block();
 
         getAsyncClient(httpClient, false);
 
-        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
-                .last()
-                .flatMap(AsyncPollResponse::getFinalResult)
-                .map(backupBlobUri -> {
-                    assertNotNull(backupBlobUri);
-                    assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
-                    return backupBlobUri;
-                })
-                .map(backupBlobUri ->
-                    asyncClient.beginSelectiveKeyRestore(createdKey.getName(), backupBlobUri, sasToken)
-                        .last()
-                        .map(AsyncPollResponse::getValue)))
-            .assertNext(Assertions::assertNotNull)
-            .verifyComplete();
+        // Create a backup
+        AsyncPollResponse backupPollResponse =
+            setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
+                .takeUntil(asyncPollResponse ->
+                    asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+                .blockLast();
+
+        KeyVaultBackupOperation backupOperation = backupPollResponse.getValue();
+        assertNotNull(backupOperation);
+
+        // Restore the backup
+        String backupFolderUrl = backupOperation.getAzureStorageBlobContainerUrl();
+        AsyncPollResponse restorePollResponse =
+            setPlaybackPollerFluxPollInterval(asyncClient.beginSelectiveKeyRestore(createdKey.getName(),
+                backupFolderUrl, sasToken))
+                .takeUntil(asyncPollResponse ->
+                    asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+                .blockLast();
+
+        KeyVaultSelectiveKeyRestoreOperation restoreOperation = restorePollResponse.getValue();
+        assertNotNull(restoreOperation);
 
         // For some reason, the service might still think a restore operation is running even after returning a success
         // signal. This gives it some time to "clear" the operation.
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
index 362e36ff1299e..62b4d8e7cf2c3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
@@ -14,6 +14,7 @@
 import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreResult;
 import com.azure.security.keyvault.keys.KeyClient;
 import com.azure.security.keyvault.keys.KeyClientBuilder;
+import com.azure.security.keyvault.keys.KeyServiceVersion;
 import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions;
 import com.azure.security.keyvault.keys.models.KeyVaultKey;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -24,7 +25,6 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class KeyVaultBackupClientTest extends KeyVaultBackupClientTestBase {
@@ -52,9 +52,8 @@ public void beginBackup(HttpClient httpClient) {
 
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
-        PollResponse pollResponse = backupPoller.waitForCompletion();
 
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
+        backupPoller.waitForCompletion();
 
         String backupBlobUri = backupPoller.getFinalResult();
 
@@ -62,25 +61,6 @@ public void beginBackup(HttpClient httpClient) {
         assertTrue(backupBlobUri.startsWith(blobStorageUrl));
     }
 
-    /**
-     * Tests that a Key Vault can be pre-backed up.
-     */
-    @ParameterizedTest(name = DISPLAY_NAME)
-    @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
-    public void beginPreBackup(HttpClient httpClient) {
-        getClient(httpClient, false);
-
-        SyncPoller backupPoller =
-            setPlaybackSyncPollerPollInterval(client.beginPreBackup(blobStorageUrl, sasToken));
-        PollResponse pollResponse = backupPoller.waitForCompletion();
-
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
-
-        String backupBlobUri = backupPoller.getFinalResult();
-
-        assertNull(backupBlobUri);
-    }
-
     /**
      * Tests that a Key Vault can be restored from a backup.
      */
@@ -92,9 +72,8 @@ public void beginRestore(HttpClient httpClient) {
         // Create a backup
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
-        PollResponse pollResponse = backupPoller.waitForCompletion();
 
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
+        backupPoller.waitForCompletion();
 
         // Restore the backup
         String backupFolderUrl = backupPoller.getFinalResult();
@@ -112,34 +91,6 @@ public void beginRestore(HttpClient httpClient) {
         sleepIfRunningAgainstService(30000);
     }
 
-    /**
-     * Tests that a Key Vault can be pre-restored from a backup.
-     */
-    @ParameterizedTest(name = DISPLAY_NAME)
-    @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
-    public void beginPreRestore(HttpClient httpClient) {
-        getClient(httpClient, false);
-
-        // Create a backup
-        SyncPoller backupPoller =
-            setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
-        PollResponse backupPollResponse = backupPoller.waitForCompletion();
-
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, backupPollResponse.getStatus());
-
-        // Restore the backup
-        String backupFolderUrl = backupPoller.getFinalResult();
-        SyncPoller restorePoller =
-            setPlaybackSyncPollerPollInterval(client.beginPreRestore(backupFolderUrl, sasToken));
-        PollResponse restorePollResponse = restorePoller.waitForCompletion();
-
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, restorePollResponse.getStatus());
-
-        // For some reason, the service might still think a restore operation is running even after returning a success
-        // signal. This gives it some time to "clear" the operation.
-        sleepIfRunningAgainstService(30000);
-    }
-
     /**
      * Tests that a key can be restored from a backup.
      */
@@ -148,6 +99,7 @@ public void beginPreRestore(HttpClient httpClient) {
     public void beginSelectiveKeyRestore(HttpClient httpClient) {
         KeyClient keyClient = new KeyClientBuilder()
             .vaultUrl(getEndpoint())
+            .serviceVersion(KeyServiceVersion.V7_2)
             .pipeline(getPipeline(httpClient, false))
             .buildClient();
 
@@ -163,19 +115,20 @@ public void beginSelectiveKeyRestore(HttpClient httpClient) {
         // Create a backup
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
-        PollResponse backupPollResponse = backupPoller.waitForCompletion();
 
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, backupPollResponse.getStatus());
+        backupPoller.waitForCompletion();
 
         // Restore one key from said backup
         String backupFolderUrl = backupPoller.getFinalResult();
         SyncPoller selectiveKeyRestorePoller =
             setPlaybackSyncPollerPollInterval(client.beginSelectiveKeyRestore(createdKey.getName(), backupFolderUrl,
                 sasToken));
-        PollResponse restorePollResponse =
-            selectiveKeyRestorePoller.waitForCompletion();
 
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, restorePollResponse.getStatus());
+        selectiveKeyRestorePoller.waitForCompletion();
+
+        PollResponse response = selectiveKeyRestorePoller.poll();
+
+        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.getStatus());
 
         // For some reason, the service might still think a restore operation is running even after returning a success
         // signal. This gives it some time to "clear" the operation.
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
index 37adff2fc63a7..0b5c5110844b3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
@@ -19,7 +19,7 @@
 public abstract class KeyVaultBackupClientTestBase extends KeyVaultAdministrationClientTestBase {
     protected final String blobStorageUrl = IS_MANAGED_HSM_DEPLOYED
         ? getStorageEndpoint() + Configuration.getGlobalConfiguration().get("BLOB_CONTAINER_NAME")
-        : "https://tb5d8675f0aa83a18prim.blob.core.windows.net/backup";
+        : "https://ta70c2fe596f0a0dfprim.blob.core.windows.net/backup";
     protected final String sasToken = IS_MANAGED_HSM_DEPLOYED ? generateSasToken() : "REDACTED";
 
     KeyVaultBackupClientBuilder getClientBuilder(HttpClient httpClient, boolean forCleanup) {
@@ -31,15 +31,9 @@ KeyVaultBackupClientBuilder getClientBuilder(HttpClient httpClient, boolean forC
     @Test
     public abstract void beginBackup(HttpClient httpClient);
 
-    @Test
-    public abstract void beginPreBackup(HttpClient httpClient);
-
     @Test
     public abstract void beginRestore(HttpClient httpClient);
 
-    @Test
-    public abstract void beginPreRestore(HttpClient httpClient);
-
     @Test
     public abstract void beginSelectiveKeyRestore(HttpClient httpClient);
 
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
index ae7a60912ee12..e917be7b12639 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
@@ -26,10 +26,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
         asyncClient = getClientBuilder(buildAsyncAssertingClient(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
             .buildAsyncClient();
-        if (!interceptorManager.isLiveMode()) {
-            // Remove `id` and `name` sanitizers from the list of common sanitizers.
-            interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
-        }
     }
 
     @ParameterizedTest(name = DISPLAY_NAME)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
index 82caca78a28da..b4dbc2cf3f99e 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
@@ -25,10 +25,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
         client = getClientBuilder(buildSyncAssertingClient(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
             .buildClient();
-        if (!interceptorManager.isLiveMode()) {
-            // Remove `id` and `name` sanitizers from the list of common sanitizers.
-            interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
-        }
     }
 
     @ParameterizedTest(name = DISPLAY_NAME)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
index 7d1eeb09dfb6a..39e47f91030e8 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
+++ b/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
@@ -65,7 +65,7 @@ partial-update: true
 These settings apply only when `--tag=rbac` is specified on the command line.
 
 ``` yaml $(tag) == 'rbac'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/rbac.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/rbac.json
 title: KeyVaultAccessControlClient
 custom-types: KeyVaultDataAction,KeyVaultRoleDefinitionType,KeyVaultRoleScope,KeyVaultRoleType
 customization-class: src/main/java/RbacCustomizations.java
@@ -87,7 +87,7 @@ directive:
 These settings apply only when `--tag=backuprestore` is specified on the command line.
 
 ``` yaml $(tag) == 'backuprestore'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/backuprestore.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/backuprestore.json
 title: KeyVaultBackupClient
 customization-class: src/main/java/BackupRestoreCustomizations.java
 ```
@@ -96,7 +96,7 @@ customization-class: src/main/java/BackupRestoreCustomizations.java
 These settings apply only when `--tag=settings` is specified on the command line.
 
 ``` yaml $(tag) == 'settings'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/settings.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/settings.json
 title: KeyVaultSettingsClient
 custom-types: KeyVaultSettingType
 customization-class: src/main/java/SettingsCustomizations.java
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
index 778d15ebb50db..c752765194c8e 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
+++ b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
@@ -1,14 +1,14 @@
 # Release History
 
-## 4.7.0-beta.1 (Unreleased)
+## 4.6.5 (2024-07-29)
 
-### Features Added
-
-### Breaking Changes
+### Other Changes
 
-### Bugs Fixed
+#### Dependency Updates
 
-### Other Changes
+- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`.
+- Upgraded `azure-json` from `1.1.0` to version `1.2.0`.
+- Upgraded `azure-core` from `1.49.1` to version `1.50.0`.
 
 
 ## 4.6.4 (2024-06-27)
@@ -555,8 +555,10 @@ Changes when compared to the last stable release (`4.5.9`) include:
 - Removed `AdministratorContact` constructor overloads and introduced setters for all parameters.
 - Removed `CertificateContact` constructor overloads and introduced setters for all parameters.
 
+For details on the Azure SDK for Java (December 2019 beta) release refer to the [release announcement](https://aka.ms/azure-sdk-beta7-java).
 
 ## 4.0.0-beta.6 (2019-12-04)
+For details on the Azure SDK for Java (November 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java).
 
 
 ### Breaking changes
@@ -588,6 +590,7 @@ Changes when compared to the last stable release (`4.5.9`) include:
 
 
 ## 4.0.0-preview.5 (2019-11-01)
+For details on the Azure SDK for Java (November 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java).
 
 ### Breaking changes
 - `beginCreateCertificate` method now returns a SyncPoller in `CertificateClient` and a PollerFlux in`CertificateAsyncClient`
@@ -634,7 +637,7 @@ For details on the Azure SDK for Java (September 2019 Preview) release refer to
 ## 4.0.0-preview.3 (2019-09-10)
 For details on the Azure SDK for Java (August 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview3-java).
 
-This library is not a direct replacement for certificates management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.0.0/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-certificates`.
+This library is not a direct replacement for certificates management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.7.3/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-certificates`.
 This package's
 [documentation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/README.md)
 and
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/README.md b/sdk/keyvault/azure-security-keyvault-certificates/README.md
index 895541486ceff..681e70be9ae9d 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/README.md
+++ b/sdk/keyvault/azure-security-keyvault-certificates/README.md
@@ -43,14 +43,13 @@ If you want to take dependency on a particular version of the library that is no
 
     com.azure
     azure-security-keyvault-certificates
-    4.6.3
+    4.6.5
 
 ```
 [//]: # ({x-version-update-end})
 
 ### Prerequisites
 - A [Java Development Kit (JDK)][jdk_link], version 8 or later.
-  - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis).
 - An [Azure Subscription][azure_subscription].
 - An existing [Azure Key Vault][azure_keyvault]. If you need to create a key vault, you can do so in the Azure Portal by following the steps in [this document][azure_keyvault_portal]. Alternatively, you can use the Azure CLI by following the steps in [this document][azure_keyvault_cli].
 
@@ -270,8 +269,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][microsoft_c
 [source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/src
 [api_documentation]: https://azure.github.io/azure-sdk-for-java
 [azkeyvault_docs]: https://docs.microsoft.com/azure/key-vault/
-[certificates_samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/src/samples/java/com/azure/security/keyvault/certificates
-[managed_identity]: https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
 [azure_identity]: https://docs.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable
 [azure_subscription]: https://azure.microsoft.com/
 [azure_keyvault]: https://docs.microsoft.com/azure/key-vault/general/overview
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/assets.json b/sdk/keyvault/azure-security-keyvault-certificates/assets.json
index 7235a61b39fcb..22243c30c53ec 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/assets.json
+++ b/sdk/keyvault/azure-security-keyvault-certificates/assets.json
@@ -2,5 +2,5 @@
   "AssetsRepo": "Azure/azure-sdk-assets",
   "AssetsRepoPrefixPath": "java",
   "TagPrefix": "java/keyvault/azure-security-keyvault-certificates",
-  "Tag": "java/keyvault/azure-security-keyvault-certificates_e018897fab"
+  "Tag": "java/keyvault/azure-security-keyvault-certificates_2816fc1705"
 }
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
index 272956eeedfa8..6596be07f8c59 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
+++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
@@ -12,7 +12,7 @@
 
   com.azure
   azure-security-keyvault-certificates
-  4.7.0-beta.1 
+  4.6.5 
 
   Microsoft Azure client library for KeyVault Certificates
   This module contains client library for Microsoft Azure KeyVault Certificates.
@@ -98,12 +98,6 @@
       1.12.1 
       test
     
-    
-      com.azure
-      azure-core-http-vertx
-      1.0.0-beta.19 
-      test
-    
     
       com.azure
       azure-identity
@@ -144,21 +138,4 @@
       
     
   
-
-  
-    
-      java12plus
-      
-        [12,)
-      
-      
-        
-          com.azure
-          azure-core-http-jdk-httpclient
-          1.0.0-beta.14 
-          test
-        
-      
-    
-  
 
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/CertificateServiceVersion.java b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/CertificateServiceVersion.java
index c9be34b86aa71..461be4837c41f 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/CertificateServiceVersion.java
+++ b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/CertificateServiceVersion.java
@@ -37,12 +37,7 @@ public enum CertificateServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5"),
-
-    /**
-     * Service version {@code 7.6-preview.1}.
-     */
-    V7_6_PREVIEW_1("7.6-preview.1");
+    V7_5("7.5");
 
     private final String version;
 
@@ -64,6 +59,6 @@ public String getVersion() {
      * @return the latest {@link CertificateServiceVersion}
      */
     public static CertificateServiceVersion getLatest() {
-        return V7_6_PREVIEW_1;
+        return V7_5;
     }
 }
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateAsyncClientTest.java
index 926609d0bbd92..94612cd2c6bcd 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateAsyncClientTest.java
@@ -873,7 +873,7 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
         importCertificateRunner((importCertificateOptions) ->
             StepVerifier.create(certificateAsyncClient.importCertificate(importCertificateOptions))
                 .assertNext(importedCertificate -> {
-                    assertTrue("73b4319cdf38e0797084535d9c02fd04d4b2b2e6"
+                    assertTrue("db1497bc2c82b365c5c7c73f611513ee117790a9"
                         .equalsIgnoreCase(importedCertificate.getProperties().getX509ThumbprintAsString()));
                     assertEquals(importCertificateOptions.isEnabled(), importedCertificate.getProperties().isEnabled());
 
@@ -881,10 +881,8 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
                     X509Certificate x509Certificate = assertDoesNotThrow(
                         () -> loadCerToX509Certificate(importedCertificate.getCer()));
 
-                    assertTrue(x509Certificate.getSubjectX500Principal().getName()
-                        .contains("CN=Test,OU=Test,O=Contoso,L=Redmond,ST=WA,C=US"));
-                    assertTrue(x509Certificate.getIssuerX500Principal().getName()
-                        .contains("CN=Test,OU=Test,O=Contoso,L=Redmond,ST=WA,C=US"));
+                    assertEquals("CN=KeyVaultTest", x509Certificate.getSubjectX500Principal().getName());
+                    assertEquals("CN=KeyVaultTest", x509Certificate.getIssuerX500Principal().getName());
                 })
                 .verifyComplete());
     }
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java
index c727d4e7bbebe..176841ed1efaf 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java
@@ -9,8 +9,6 @@
 import com.azure.core.http.rest.PagedIterable;
 import com.azure.core.test.http.AssertingHttpClientBuilder;
 import com.azure.core.util.Context;
-import com.azure.core.util.logging.ClientLogger;
-import com.azure.core.util.logging.LogLevel;
 import com.azure.core.util.polling.LongRunningOperationStatus;
 import com.azure.core.util.polling.PollResponse;
 import com.azure.core.util.polling.SyncPoller;
@@ -70,8 +68,6 @@
 import static org.junit.jupiter.api.Assertions.fail;
 
 public class CertificateClientTest extends CertificateClientTestBase {
-    private static final ClientLogger LOGGER = new ClientLogger(CertificateClientTest.class);
-
     private CertificateClient certificateClient;
 
     @Override
@@ -865,7 +861,7 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
             KeyVaultCertificateWithPolicy importedCertificate =
                 certificateClient.importCertificate(importCertificateOptions);
 
-            assertTrue("73b4319cdf38e0797084535d9c02fd04d4b2b2e6"
+            assertTrue("db1497bc2c82b365c5c7c73f611513ee117790a9"
                 .equalsIgnoreCase(importedCertificate.getProperties().getX509ThumbprintAsString()));
             assertEquals(importCertificateOptions.isEnabled(), importedCertificate.getProperties().isEnabled());
 
@@ -873,10 +869,8 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
             X509Certificate x509Certificate = assertDoesNotThrow(
                 () -> loadCerToX509Certificate(importedCertificate.getCer()));
 
-            assertTrue(x509Certificate.getSubjectX500Principal().getName()
-                .contains("CN=Test,OU=Test,O=Contoso,L=Redmond,ST=WA,C=US"));
-            assertTrue(x509Certificate.getIssuerX500Principal().getName()
-                .contains("CN=Test,OU=Test,O=Contoso,L=Redmond,ST=WA,C=US"));
+            assertEquals("CN=KeyVaultTest", x509Certificate.getSubjectX500Principal().getName());
+            assertEquals("CN=KeyVaultTest", x509Certificate.getIssuerX500Principal().getName());
         });
     }
 
@@ -981,7 +975,7 @@ private void pollOnCertificatePurge(String certificateName) {
             }
         }
 
-        LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Certificate " + certificateName + " was not purged");
+        System.err.printf("Deleted Key %s was not purged \n", certificateName);
     }
 
 }
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTestBase.java b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTestBase.java
index 4db4fb531a1a1..e620da07d0ed3 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTestBase.java
@@ -19,8 +19,7 @@
 import com.azure.core.test.utils.TestUtils;
 import com.azure.core.util.Configuration;
 import com.azure.core.util.CoreUtils;
-import com.azure.identity.AzurePowerShellCredentialBuilder;
-import com.azure.identity.DefaultAzureCredentialBuilder;
+import com.azure.identity.ClientSecretCredentialBuilder;
 import com.azure.security.keyvault.certificates.implementation.KeyVaultCredentialPolicy;
 import com.azure.security.keyvault.certificates.models.AdministratorContact;
 import com.azure.security.keyvault.certificates.models.CertificateContact;
@@ -97,13 +96,25 @@ CertificateClientBuilder getCertificateClientBuilder(HttpClient httpClient, Stri
         CertificateServiceVersion serviceVersion) {
         TokenCredential credential;
 
-        if (interceptorManager.isLiveMode()) {
-            credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build();
-        } else if (interceptorManager.isRecordMode()) {
-            credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build();
-            List customSanitizers = new ArrayList<>();
-            customSanitizers.add(new TestProxySanitizer("value", "-----BEGIN PRIVATE KEY-----\\n(.+\\n)*-----END PRIVATE KEY-----\\n", "-----BEGIN PRIVATE KEY-----\\nREDACTED\\n-----END PRIVATE KEY-----\\n", TestProxySanitizerType.BODY_KEY));
-            interceptorManager.addSanitizers(customSanitizers);
+        if (!interceptorManager.isPlaybackMode()) {
+            String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID");
+            String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET");
+            String tenantId = testTenantId == null
+                ? Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID")
+                : testTenantId;
+
+            credential = new ClientSecretCredentialBuilder()
+                .clientSecret(Objects.requireNonNull(clientKey, "The client key cannot be null"))
+                .clientId(Objects.requireNonNull(clientId, "The client id cannot be null"))
+                .tenantId(Objects.requireNonNull(tenantId, "The tenant id cannot be null"))
+                .additionallyAllowedTenants("*")
+                .build();
+
+            if (interceptorManager.isRecordMode()) {
+                List customSanitizers = new ArrayList<>();
+                customSanitizers.add(new TestProxySanitizer("value", "-----BEGIN PRIVATE KEY-----\\n(.+\\n)*-----END PRIVATE KEY-----\\n", "-----BEGIN PRIVATE KEY-----\\nREDACTED\\n-----END PRIVATE KEY-----\\n", TestProxySanitizerType.BODY_KEY));
+                interceptorManager.addSanitizers(customSanitizers);
+            }
         } else {
             credential = new MockTokenCredential();
 
@@ -119,11 +130,6 @@ CertificateClientBuilder getCertificateClientBuilder(HttpClient httpClient, Stri
             .credential(credential)
             .httpClient(httpClient);
 
-        if (!interceptorManager.isLiveMode()) {
-            // Remove `id` and `name` sanitizers from the list of common sanitizers.
-            interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
-        }
-
         if (interceptorManager.isPlaybackMode()) {
             return builder.retryOptions(PLAYBACK_RETRY_OPTIONS);
         } else {
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialsForTests.java b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialsForTests.java
index d51e8d7c971e0..67557bb45c07c 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialsForTests.java
+++ b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialsForTests.java
@@ -11,63 +11,56 @@ public class FakeCredentialsForTests {
      * Fake certificate content
      */
     public static final String FAKE_CERTIFICATE =
-        "MIIKjwIBAzCCCkUGCSqGSIb3DQEHAaCCCjYEggoyMIIKLjCCBJoGCSqGSIb3DQEH"
-        + "BqCCBIswggSHAgEAMIIEgAYJKoZIhvcNAQcBMF8GCSqGSIb3DQEFDTBSMDEGCSqG"
-        + "SIb3DQEFDDAkBBD6J7VlngzbeYpxVxb5zbUjAgIIADAMBggqhkiG9w0CCQUAMB0G"
-        + "CWCGSAFlAwQBKgQQFq79Veolktn9WBVZ2b+yn4CCBBDmBdB0C7F9Lac/Kv5pjH4b"
-        + "RFX1HEygcQVBJQpCKq5WuR2ahBZolTfo6mlhWrB0Y/pdNe5QBERrw5PX9hghny19"
-        + "S0m9jmwYb2VwTigIGJAqR6Ruik3MJ1Ya57dYNXgpr3smhgYNe66Jk8sHbFiwlSU7"
-        + "Hsq69+1EZwwKBHerGfpMux4vWAWAIHorJgZxrXAuce+mSxDxkASe+Ud/bqq0no3q"
-        + "qsad60l2SgTElwpBCrMkac8bUHwOg6jOJltPRSfWjfSiqVt/14OIS5HQwUaA6ZyP"
-        + "sD3poTAaDu35d3Xou7f7oZlN5AeCNnoD/uQlA5d/nXEyCC/UXbXj9O+vDXKfaS7Y"
-        + "naUqKSOcqxCj9NRsLAJWuE06oOFxrZJu+UbcANZAUqLW6GD8D7kTgoZmakE6QxT0"
-        + "Q1tOtEV2/pxhAHKj3V8IiWQ2NdodigO52UcGIt8Q4awbydy6RPFMppsi8WBTXDtP"
-        + "bui8V4AJvtrm5jRGdW7mzJvkqeUVR/IeQ/7L5hpcr1hg1EVs43ax29VF6VmMiVKa"
-        + "Y3Itiqs49fet6Qburgf11AyrP9RuipJD5hQd1YmlIvpySLkxc2/PMGEsdgC4BTIz"
-        + "I0MszHaQPvsgKxGTdf6keV4yZSWUyEOAyFCmuynfOCwSya6Cbm74YAXXj4IdA1dY"
-        + "6kOgNgfTM8Tr3KmaBSNbenwAXXPVHIJacqIMRTUIQ/+be0dwsgJ5FJi0/5poYrDj"
-        + "XLyXT25OOTFZVAzGwVcm5hlFNQUULV7bAaJOH2ZtK3uoTHuH83FCfRSRqeOqEhZJ"
-        + "Z0DF2yEG2yuEHOT2OqcIYuRnl1HbGdYFgbwoa9UTMOYG8HkEgzKFTXoqmKOC38zu"
-        + "W+1pKLn+uiTkeyCOjAq99Mwve2fFDdQHXcSmv24ZFsiHSctzDQe9xJUBtRtm38+d"
-        + "GkniMuusmxBIhgMqPeG1g7tqS7OrX+r9wZieBqL3aaabXAXQbuQZ3tFyZDzWfA5w"
-        + "lWY0mc7rmqau70XTV90eGxUtT4IYeLuTbjVsPBYahsupEbujrkeo4kS8cp6AyIhl"
-        + "WLzcXYzwAnIcbQJkw6nb/JyCrz9/mASpQmKpX4syj+4wcFATwDDt4KjblAendcJw"
-        + "bguM4isaPCxP48hg4Tj0CLLSRNtMfXIjKltJWkhjXzQLEzcCTeWLAUzzm9mNyDOZ"
-        + "EVso2Y1jN6Xqdm6D1bRuHp0TsKlHdkyBwBCkFPph+fCgKrASmbgSzX8bilqzOU/r"
-        + "8Ql+ot6br42IPIm6Cwn6sCwdiS0chx0mr52n3Fef7Aurluu6x/xnNT+wLoURXHNe"
-        + "FqN0nKZBgKWRQIUKAkpK+02tN0TFtUWbHjJ0EAsNwAaSoTwqXNgEmb8JPR1BRCod"
-        + "kYfAnHlnvBy83IMiXMz0lDCCBYwGCSqGSIb3DQEHAaCCBX0EggV5MIIFdTCCBXEG"
-        + "CyqGSIb3DQEMCgECoIIFOTCCBTUwXwYJKoZIhvcNAQUNMFIwMQYJKoZIhvcNAQUM"
-        + "MCQEEEaqp++BjdYKmeKmJMqBDE0CAggAMAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUD"
-        + "BAEqBBB8PJ1Qo62GUuy2gDROrqH8BIIE0Byd3Rzee8m9fS7xEV6Z5QM86PEOyziF"
-        + "nzWe8WRrbTN62u9JPAfYvXeeCRdr8QKkvw8mJXUUNHYmwo56ExR/JSJu/vQIl7FN"
-        + "jtGzwQHQtUTNcZuAsiFrZvYq4vAI0wnwmtW/ApQCylbERyZp8DRx3fT90QTAGz9s"
-        + "T9RreOeN8qUj0UY6/8eD3vZJ2sG+QpHK5cv1H++ZhbfgZgR8aaupu6xXKQdTHg7P"
-        + "ors42O7Q40Sk/LvWVHfA2tYPr5QfeB1tyjhSnwx1wExlWb01XvRq1IkP8K4SD4Ss"
-        + "7Smo7SmWprzjIFcpTWXI0MS2sFIzJICxih3eUoWvRYWZk0J8H1qVq4yDke0q9ah7"
-        + "FdCOt2Ah7JPscb+ahGjQjNNWsfC3INSNLABxB3b3RlJLCY9D/hG5a2auDaF/0tXX"
-        + "UhrRfUZhW70Cc345I4hdrX9xze4kSdF5h9Uzzv2OzzFcojM/7CYG3ya2pyMn1CQH"
-        + "B/SY2XqweINrqVRWiBEhD1r/SJ1Sq2uvMp6WmctKKOh6JNErFabxd/GybrcYlhZO"
-        + "a6SnH23xpMonPzAzW43p8C41GDIizUMFvbxvkPFWBbsSJuUUoGvR6sHvKGOLs72Z"
-        + "D0ruInfTeZxD15NX8zd+pZDEyFWVH0sxZjOXouJr3RM28UvLu9uuIoz7+1/p3rns"
-        + "NX7tBV7zDspe5Tsb3t49vtO5wxdGAIAEK+5MrbvuP1w2T6aQYwF5DSzckDeZREGn"
-        + "GjEyTnzFRn/1FTKgfPkBUa8AIl1CbYYNebusVZSoB19+gDCH3oyzF4+Qr5mKpkEF"
-        + "LFbV4Sxvbk8vxNthubcuMXP+QGJA5o6jNfpvM8mGcZR8tO8J7Kq+pKv8AdtkRHuj"
-        + "HVuenB5sdgKR5hJB7cOqQBush+6i+yA4dFWbt1vblABGCueJYw7/czhQx4iO6JEx"
-        + "P2TZaFq7+SuvIdEOB7uMwnPIQFv1ukBcx8eiWspK0qsKeIpqDVwaypJLgqKEOL9U"
-        + "0YRXxeH1XjxBWGipvRhmo4C8NYt9Lwt1FUh9nEwjmXSapaA0zUO2pLpzy3rdIGW9"
-        + "gdRfKvNie0w8jwuvgzMY9t3u04MHyKQ2h1NIOXrOfZk/dOrgpUpRqG1bPhS/El1s"
-        + "cwZglmVX6PU4fItXFkQpR+WxQpVncOlS/e4ac3RYXAq/ch84vQ+vXRaWruNB9nSy"
-        + "y1d/bwJWtF1I0ZWE+nExyWdlUBp89dIrYSFw/cfwark615ROE1akA7wU68Y5K7HO"
-        + "99t4V9NwleGhfQ2mf94QjkfVyszYsrCBqSWhrGYTQ6JoTKquR0Xz6vZnMmUvaUK1"
-        + "Ddv96lmfWBSIJ/urWMSRL75jIH5bYNnx5gAyorXqEKJAtt1yGftZYUXaOOfHvXJc"
-        + "FOlXIGAF9EtmaPnefC9HSTmnrNSJEB9u+hiaXBzVkI2oJG/GM6aLOTdYyMDC8fXw"
-        + "30h0j+cp4IhoYythftmQZ1rz9oVZOZgIQJjViYwPHY2gOE/BZ+bBKjtdZ4cDYOHS"
-        + "9g3DrtexeLpjmWSqITa+x/KV8KWmE0FMcsDauKNVILFs607F9hqd+4azfqhtpT8Q"
-        + "0u84RgoVrmFIajhaNl5+06KVGCRAkmwQkxYHiY8SkuPTo4dh0/9AycqMODL5Zjh6"
-        + "a6MHpGSGG+WXMSUwIwYJKoZIhvcNAQkVMRYEFHO0MZzfOOB5cIRTXZwC/QTUsrLm"
-        + "MEEwMTANBglghkgBZQMEAgEFAAQguefMRfuN/2S1v8baZNWXyR/9lVxdKylJSNnO"
-        + "ULN2mZ4ECN9bsOpidibOAgIIAA==";
+        "MIIJUQIBAzCCCRcGCSqGSIb3DQEHAaCCCQgEggkEMIIJADCCA7cGCSqGSIb3DQEH"
+        + "BqCCA6gwggOkAgEAMIIDnQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIONsr"
+        + "wr1FhuICAggAgIIDcBQWaArZgVr5K8+zccadOCGIC+WzlAx2V88HT6fQcujZItr3"
+        + "koiHi7+sdTe3mQncnxqZoNGgx4s6Xh+QIIFdHSAo4EL9uGoFKiprKMHAmiCj9Pcm"
+        + "M6stTFYMnzmlAiVLCNogPEobi2pfcQIVbDaVUHdm4EczlBGKyMTZSTkXmxI7Ax9V"
+        + "YXucniBpxJ3d0bTHchvHCjqHCLTDCnqyPXTqQH0JpHSYdcq9pxydtoNNgT7NDrKM"
+        + "0QtxIvI29+ZlSLZMxB3Mf4qOhn6bmyBakUypK1S8N0b2YPLTjp5+Zmb8W24+1bVm"
+        + "gV2p10SFjbt8CacDl3dmRUkwu6C8Cl3QIpgwbMoP8hnJppyaFvIqar9roNNS3seG"
+        + "8RDn/Q4DCYWJ6JhA6Z+gDL3BncwE2q9rekkOwo1MwERNhBEtINrXztKogdA/as1o"
+        + "O443ZbM/qm5pX9ZPh4Hv8Hzgl0aqlxubsUcEr8SIDNEJ3u91/gDdmHWgabnLZif8"
+        + "A7e2TMCqTiCM2nRr3soNUvOqnLHoexAKqsQAvi36VVmdAH1085Q+ISpVseCe3Piq"
+        + "PhLsqyfF2Yox+NkI/nOwtg0XhO+mdoAkes03ojctqFXB2ygo/iRH2ng16zGnWes0"
+        + "nSp3rcOaoqcE1c85+/QQZZrzVspdnnNhYWWr1IiwyiOctOAovpmU9oDacY+1u9dO"
+        + "pnVRr5ibwR1NSlIVl1KPNsYmQoP9hig8lULeVGLQTWEQc8qb55t/Y/RpgNFEs3pi"
+        + "Hmd12R9NZMBcrZp3bbSzdS51OicQ6PKRXKESHVMbbsLiR8M62Dxg9ysH0kVEdxjw"
+        + "LfdlqAPby/+/L2t62WKkoHq37GtqtVDYAELBsP9tq3AF+ucUB1Gj8vvwEAedJ2Zl"
+        + "Q2f9xVTHXr0Ah3JkYsMpAuK0HZzMTVc0ZKXrfocbtvwr4aVwc3zOP+pz1AhqZpkD"
+        + "fr23NVkAmV63aIBOr1TSNPCnn7PMlr4rfZ2vzwBKCrfnc+O44IsWNg1N4ZBAKjnh"
+        + "ZZjhgxRYC5en7PKVPHAla2R8299RJy7tuiR6qo58UZNdsIJXBbjhytLroZHvdF3r"
+        + "mSTxgYli5h9xKAw9c6eqmrmGNRD1dY9bmkgFNwF6C8Yi4RdCZ3C6LNFHhgxMwbXi"
+        + "Xl5Mfa7E4ZSOWIeH8I79knxDPDMm4sTRSncbyn8wggVBBgkqhkiG9w0BBwGgggUy"
+        + "BIIFLjCCBSowggUmBgsqhkiG9w0BDAoBAqCCBO4wggTqMBwGCiqGSIb3DQEMAQMw"
+        + "DgQI4fPTwJwGln0CAggABIIEyE1waejpdCUGBbzwCZhdul9adyBO8futpEZKKlcc"
+        + "RnP2iQ82N7P2CE7cXEch8OrC3+qyvyGfqVzNpjOWT1v+uMrqT67enK00/eU/OWxk"
+        + "2edizJXUr+usLjojPh1Yu822Ffax3qiZ87Svm9staSNebek6q/2W24KnaDNvqPPT"
+        + "vGA4prwpwdn98NHGQou5WQiSsh+VkT49duZxO6/+TWK8I27FnoyCgiKEjr6vvY6a"
+        + "x4E3ect4Kz0MZsLKNYd6/BqBRw2UnrKg0yoIYHvP/j/DT8q++cafs9ZSS2eO4ZlC"
+        + "5DAshQdXUD6O7fJF+rI5Ao36keWlkz8DKi0kWL32Rzvk56vVbVGIkrGveZ19E5WR"
+        + "3kqkFNddO+zZs6tJJeO8Rghylp43mgyivpkzPQ6By9aekn+VgQ5Oqze7gUX74CD0"
+        + "onjf5Q5eaOl6ZGdcVlKOXbf/r8libAq7GvGICm1Rfa79/Q1IqvvKFmxd/WZfa1iJ"
+        + "OwZwaV53ALhlDejdTU1YS7ZHorFTJGfn4LtHoVkRpZsMnA+ygMZ0+vTTgnGS1GZz"
+        + "g7OACuXWla1Dh2yv/UYKpdnhgyAGgCcIIguiRSD/JWxZxiT9sb/t+bN7NLRYpXak"
+        + "rYTOi1lHoqCGfZTlzMyZPmo/DfZTdhGXVUYA6puvi+Qv22ub9N01riv2TN9noOkB"
+        + "RH67I48dXRrzJi7m2CYG6v8pQmvW4Tg3feIrOF99hHU/YJfOWvQgjiQoyJFlyq8L"
+        + "1wwhG4eXQH4bP97ilJHFDWjTzKzbYrhKZadd7SJ2hT6R3NPH9AYyMdsoPaWu9RIE"
+        + "g2niz0niFXwUnNQib/deL7PDyFwndsRtp3P405oF4tzMU1Q4mD2IwObM7g4+syFW"
+        + "c+2Cy29o0buJrb4jIsIjjUYNB/mzoU7iKXwQ0qhPTHyUbP4XM5jaiEuS48u4hRbh"
+        + "k9C5Ti6fvrbeVqN/rcXPvS0h+HCf4Gc8LCXTBME0a1SSnQR10q66GRnuQa2hM+/b"
+        + "AxQUTXNYs/p4Np8aGIR6EkXXR0cbcoMHp3+d6h9B8tqlmvTYAFYvlkImeyJaNOpH"
+        + "J9E+AbNEugEm1s+GgfQT5XKCThmpg0uNyKFAkjvkXjoS5K4dJwQPtYfM2SYyLjTO"
+        + "dEmsjPKR7NcBIR3hx35PIpyHxdqAnb25GakB7GHX1/HJsZCf+NLuUsWkyP6pNy6w"
+        + "o9l9BOSSDnUPEV5D/J1h/GZ/hOHcf9WDv06KefKAy77UpnTKSSlHr/PzkfNbtjFf"
+        + "6xKPQRWA1WVd3FW2BETdABteX0QcYSZjVRjirWZUOxu2VKv9I4G0PGMjmo6UxCMG"
+        + "xFV1qulKn+kPAInoNbgbY2ZaF5q1FAoMQ4nAPG6W79J0xgEkuCiH6F7F7TEHldCO"
+        + "ulHWfJja7K27zW2T4ZnQbcpKmHpCns7bAt0198CrYyHfNP4Yyx0uiXBI+Z9hlHvO"
+        + "kcs0l5RDV1EWR3jOih7zLr43MPwJ12sXwEMCOjUHYxs0jTZcgmti+wBPs8xuWayh"
+        + "J/9pD1DfFxf6lFOCi1op5zPc7U3NNMbU3gXgSolsrMjm0dJH0rfu4+C0cym62EBo"
+        + "IGdvyABqS9N96YUu1OreBcCYiTP5Qajn87J8i9zj3aa5lFGJYCS6s8EBeDElMCMG"
+        + "CSqGSIb3DQEJFTEWBBTbFJe8LIKzZcXHxz9hFRPuEXeQqTAxMCEwCQYFKw4DAhoF"
+        + "AAQUI7HzgLxeU0ExCw7mUkJyWmnUlckECNF1gKFeLQMGAgIIAA==";
 
     public static final String FAKE_PEM_CERTIFICATE =
         "-----BEGIN CERTIFICATE-----\n"
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-certificates/swagger/autorest.md
index 077bab94790b3..535eb0f0d9fdc 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/swagger/autorest.md
+++ b/sdk/keyvault/azure-security-keyvault-certificates/swagger/autorest.md
@@ -34,7 +34,7 @@ autorest
 use: '@autorest/java@4.1.22'
 output-folder: ../
 java: true
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/certificates.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/certificates.json
 title: CertificateClient
 namespace: com.azure.security.keyvault.certificates
 models-subpackage: implementation.models
diff --git a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md
index d797ea7cb9364..5f155459ffdcb 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md
+++ b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md
@@ -1,15 +1,14 @@
 # Release History
 
-## 4.9.0-beta.1 (Unreleased)
+## 4.8.6 (2024-07-29)
 
-### Features Added
-- Added a new configuration flag to cryptography clients to defer all cryptographic operations to the Key Vault service. ([#40384](https://github.com/Azure/azure-sdk-for-java/pull/40384))
-
-### Breaking Changes
+### Other Changes
 
-### Bugs Fixed
+#### Dependency Updates
 
-### Other Changes
+- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`.
+- Upgraded `azure-json` from `1.1.0` to version `1.2.0`.
+- Upgraded `azure-core` from `1.49.1` to version `1.50.0`.
 
 
 ## 4.8.5 (2024-06-27)
@@ -811,11 +810,11 @@ For details on the Azure SDK for Java (August 2019 Preview) release refer to the
 - Removed static builder method from clients. Builders are now instantiable.
 
 ## 4.0.0-preview.1 (2019-06-28)
-Version 4.0.0-preview.1 is a preview of our efforts in creating a client library that is developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as possible. The principles that guide our efforts can be found in the [Azure SDK Design Guidelines for Java](https://aka.ms/azsdk/guide/java).
+Version 4.0.0-preview.1 is a preview of our efforts in creating a client library that is developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as possible. The principles that guide our efforts can be found in the [Azure SDK Design Guidelines for Java](https://azuresdkspecs.z5.web.core.windows.net/JavaSpec.html).
 
 For details on the Azure SDK for Java (July 2019 Preview) release, you can refer to the [release announcement](https://aka.ms/azure-sdk-preview1-java).
 
-This library is not a direct replacement for keys management operations from microsoft-azure-keyvault. Applications using that library would require code changes to use `azure-keyvault-keys`.
+This library is not a direct replacement for keys management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.7.3/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-keys`.
 This package's
 [documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-keyvault-keys_4.0.0-preview.1/keyvault/client/keys/README.md)
 and
diff --git a/sdk/keyvault/azure-security-keyvault-keys/README.md b/sdk/keyvault/azure-security-keyvault-keys/README.md
index 622f5f196724f..26bc461eceef3 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/README.md
+++ b/sdk/keyvault/azure-security-keyvault-keys/README.md
@@ -45,14 +45,13 @@ If you want to take dependency on a particular version of the library that is no
 
     com.azure
     azure-security-keyvault-keys
-    4.8.4
+    4.8.6
 
 ```
 [//]: # ({x-version-update-end})
 
 ### Prerequisites
 - A [Java Development Kit (JDK)][jdk_link], version 8 or later.
-  - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis).
 - An [Azure Subscription][azure_subscription].
 - One of the following:
   - An existing [Azure Key Vault][azure_keyvault]. If you need to create a key vault, you can do so in the Azure Portal by following the steps in [this document][azure_keyvault_portal]. Alternatively, you can use the Azure CLI by following the steps in [this document][azure_keyvault_cli].
diff --git a/sdk/keyvault/azure-security-keyvault-keys/assets.json b/sdk/keyvault/azure-security-keyvault-keys/assets.json
index 31f6f88f48d3c..f14b27d364ed8 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/assets.json
+++ b/sdk/keyvault/azure-security-keyvault-keys/assets.json
@@ -2,5 +2,5 @@
   "AssetsRepo": "Azure/azure-sdk-assets",
   "AssetsRepoPrefixPath": "java",
   "TagPrefix": "java/keyvault/azure-security-keyvault-keys",
-  "Tag": "java/keyvault/azure-security-keyvault-keys_d9bef0f806"
+  "Tag": "java/keyvault/azure-security-keyvault-keys_72fb58ae91"
 }
diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml
index 61687a4511415..c5cba79e1c68c 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml
+++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml
@@ -14,7 +14,7 @@
 
   com.azure
   azure-security-keyvault-keys
-  4.9.0-beta.1 
+  4.8.6 
 
   Microsoft Azure client library for KeyVault Keys
   This module contains client library for Microsoft Azure KeyVault Keys.
diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyServiceVersion.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyServiceVersion.java
index c335fdc6e383e..500375096e3a8 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyServiceVersion.java
+++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyServiceVersion.java
@@ -37,12 +37,7 @@ public enum KeyServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5"),
-
-    /**
-     * Service version {@code 7.6-preview.1}.
-     */
-    V7_6_PREVIEW_1("7.6-preview.1");
+    V7_5("7.5");
 
     private final String version;
 
@@ -64,6 +59,6 @@ public String getVersion() {
      * @return the latest {@link KeyServiceVersion}
      */
     public static KeyServiceVersion getLatest() {
-        return V7_6_PREVIEW_1;
+        return V7_5;
     }
 }
diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java
index b1377f219a9ea..8db2a23bf05ed 100644
--- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java
+++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java
@@ -9,10 +9,12 @@
 import com.azure.core.exception.ResourceNotFoundException;
 import com.azure.core.http.HttpPipeline;
 import com.azure.core.http.rest.Response;
+import com.azure.core.util.CoreUtils;
 import com.azure.core.util.FluxUtil;
 import com.azure.core.util.logging.ClientLogger;
 import com.azure.core.util.logging.LogLevel;
 import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyClientImpl;
+import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils;
 import com.azure.security.keyvault.keys.cryptography.implementation.LocalKeyCryptographyClient;
 import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters;
 import com.azure.security.keyvault.keys.cryptography.models.DecryptResult;
@@ -35,9 +37,8 @@
 
 import static com.azure.core.util.FluxUtil.monoError;
 import static com.azure.core.util.FluxUtil.withContext;
-import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.createLocalClient;
+import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.initializeLocalClient;
 import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.isThrowableRetryable;
-import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.retrieveJwkAndCreateLocalAsyncClient;
 
 /**
  * The {@link CryptographyAsyncClient} provides asynchronous methods to perform cryptographic operations using
@@ -81,14 +82,6 @@
  * 
  * 
* - *

When a {@link CryptographyAsyncClient} gets created using a {@code Azure Key Vault key identifier}, the first - * time a cryptographic operation is attempted, the client will attempt to retrieve the key material from the service, - * cache it, and perform all future cryptographic operations locally, deferring to the service when that's not possible. - * If key retrieval and caching fails because of a non-retryable error, the client will not make any further attempts - * and will fall back to performing all cryptographic operations on the service side. Conversely, when a - * {@link CryptographyAsyncClient} created using a {@link JsonWebKey JSON Web Key}, all cryptographic operations will be - * performed locally.

- * *
* *

Encrypt Data

@@ -150,7 +143,7 @@ public class CryptographyAsyncClient { private final HttpPipeline pipeline; - private volatile boolean skipLocalClientCreation; + private volatile boolean attemptedToInitializeLocalClient = false; private volatile LocalKeyCryptographyClient localKeyCryptographyClient; final CryptographyClientImpl implClient; @@ -162,15 +155,11 @@ public class CryptographyAsyncClient { * @param keyId The Azure Key Vault key identifier to use for cryptography operations. * @param pipeline {@link HttpPipeline} that the HTTP requests and responses flow through. * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. - * @param disableKeyCaching Indicates if local key caching should be disabled and all cryptographic operations - * deferred to the service. */ - CryptographyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version, - boolean disableKeyCaching) { - this.implClient = new CryptographyClientImpl(keyId, pipeline, version); + CryptographyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { this.keyId = keyId; this.pipeline = pipeline; - this.skipLocalClientCreation = disableKeyCaching; + this.implClient = new CryptographyClientImpl(keyId, pipeline, version); } /** @@ -199,7 +188,8 @@ public class CryptographyAsyncClient { this.pipeline = null; try { - this.localKeyCryptographyClient = createLocalClient(jsonWebKey, null); + this.localKeyCryptographyClient = initializeLocalClient(jsonWebKey, null); + this.attemptedToInitializeLocalClient = true; } catch (RuntimeException e) { throw LOGGER.logExceptionAsError( new RuntimeException("Could not initialize local cryptography client.", e)); @@ -881,10 +871,11 @@ public Mono verifyData(SignatureAlgorithm algorithm, byte[] data, } private Mono isLocalClientAvailable() { - if (!skipLocalClientCreation && localKeyCryptographyClient == null) { - return retrieveJwkAndCreateLocalAsyncClient(implClient) + if (!attemptedToInitializeLocalClient) { + return retrieveJwkAndInitializeLocalAsyncClient() .map(localClient -> { localKeyCryptographyClient = localClient; + attemptedToInitializeLocalClient = true; return true; }) @@ -893,7 +884,7 @@ private Mono isLocalClientAvailable() { LOGGER.log(LogLevel.VERBOSE, () -> "Could not set up local cryptography for this operation. " + "Defaulting to service-side cryptography.", t); } else { - skipLocalClientCreation = true; + attemptedToInitializeLocalClient = true; LOGGER.log(LogLevel.VERBOSE, () -> "Could not set up local cryptography. Defaulting to" + "service-side cryptography for all operations.", t); @@ -905,4 +896,27 @@ private Mono isLocalClientAvailable() { return Mono.just(localKeyCryptographyClient != null); } + + private Mono retrieveJwkAndInitializeLocalAsyncClient() { + // Technically the collection portion of a key identifier should never be null/empty, but we still check for it. + if (!CoreUtils.isNullOrEmpty(implClient.getKeyCollection())) { + // Get the JWK from the service and validate it. Then attempt to create a local cryptography client or + // default to using service-side cryptography. + Mono jsonWebKeyMono = CryptographyUtils.SECRETS_COLLECTION.equals(implClient.getKeyCollection()) + ? implClient.getSecretKeyAsync() + : implClient.getKeyAsync().map(keyVaultKeyResponse -> keyVaultKeyResponse.getValue().getKey()); + + return jsonWebKeyMono.handle((jsonWebKey, sink) -> { + if (!jsonWebKey.isValid()) { + sink.error(new IllegalStateException("The retrieved JSON Web Key is not valid.")); + } else { + sink.next(initializeLocalClient(jsonWebKey, implClient)); + } + }); + } else { + // Couldn't/didn't create a local cryptography client. + return Mono.error(new IllegalStateException( + "Could not create a local cryptography client. Key collection is null or empty.")); + } + } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java index b4cf37ab5a886..05a2a63adf166 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java @@ -10,9 +10,11 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.logging.LogLevel; import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyClientImpl; +import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils; import com.azure.security.keyvault.keys.cryptography.implementation.LocalKeyCryptographyClient; import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; @@ -33,9 +35,8 @@ import java.util.Objects; -import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.createLocalClient; +import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.initializeLocalClient; import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.isThrowableRetryable; -import static com.azure.security.keyvault.keys.cryptography.implementation.CryptographyUtils.retrieveJwkAndCreateLocalClient; /** * The {@link CryptographyClient} provides synchronous methods to perform cryptographic operations using asymmetric and @@ -78,14 +79,6 @@ *
* * - *

When a {@link CryptographyClient} gets created using a {@code Azure Key Vault key identifier}, the first time a - * cryptographic operation is attempted, the client will attempt to retrieve the key material from the service, cache - * it, and perform all future cryptographic operations locally, deferring to the service when that's not possible. If - * key retrieval and caching fails because of a non-retryable error, the client will not make any further attempts and - * will fall back to performing all cryptographic operations on the service side. Conversely, when a - * {@link CryptographyClient} created using a {@link JsonWebKey JSON Web Key}, all cryptographic operations will be - * performed locally.

- * *
* *
@@ -144,7 +137,7 @@ public class CryptographyClient { private static final ClientLogger LOGGER = new ClientLogger(CryptographyClient.class); - private volatile boolean skipLocalClientCreation; + private volatile boolean attemptedToInitializeLocalClient = false; private volatile LocalKeyCryptographyClient localKeyCryptographyClient; final CryptographyClientImpl implClient; @@ -156,14 +149,10 @@ public class CryptographyClient { * @param keyId The Azure Key Vault key identifier to use for cryptography operations. * @param pipeline {@link HttpPipeline} that the HTTP requests and responses flow through. * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. - * @param disableKeyCaching Indicates if local key caching should be disabled and all cryptographic operations - * deferred to the service. */ - CryptographyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version, - boolean disableKeyCaching) { + CryptographyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { this.implClient = new CryptographyClientImpl(keyId, pipeline, version); this.keyId = keyId; - this.skipLocalClientCreation = disableKeyCaching; } /** @@ -191,7 +180,8 @@ public class CryptographyClient { this.keyId = jsonWebKey.getId(); try { - this.localKeyCryptographyClient = createLocalClient(jsonWebKey, null); + this.localKeyCryptographyClient = initializeLocalClient(jsonWebKey, null); + this.attemptedToInitializeLocalClient = true; } catch (RuntimeException e) { throw LOGGER.logExceptionAsError( new RuntimeException("Could not initialize local cryptography client.", e)); @@ -1211,15 +1201,16 @@ String getVaultUrl() { } private boolean isLocalClientAvailable() { - if (!skipLocalClientCreation && localKeyCryptographyClient == null) { + if (!attemptedToInitializeLocalClient) { try { - localKeyCryptographyClient = retrieveJwkAndCreateLocalClient(implClient); + localKeyCryptographyClient = retrieveJwkAndInitializeLocalClient(); + attemptedToInitializeLocalClient = true; } catch (Throwable t) { if (isThrowableRetryable(t)) { LOGGER.log(LogLevel.VERBOSE, () -> "Could not set up local cryptography for this operation. " + "Defaulting to service-side cryptography.", t); } else { - skipLocalClientCreation = true; + attemptedToInitializeLocalClient = true; LOGGER.log(LogLevel.VERBOSE, () -> "Could not set up local cryptography. Defaulting to " + "service-side cryptography for all operations.", t); @@ -1229,4 +1220,27 @@ private boolean isLocalClientAvailable() { return localKeyCryptographyClient != null; } + + private LocalKeyCryptographyClient retrieveJwkAndInitializeLocalClient() { + // Technically the collection portion of a key identifier should never be null/empty, but we still check for it. + if (!CoreUtils.isNullOrEmpty(implClient.getKeyCollection())) { + // Get the JWK from the service and validate it. Then attempt to create a local cryptography client or + // default to using service-side cryptography. + JsonWebKey jsonWebKey = CryptographyUtils.SECRETS_COLLECTION.equals(implClient.getKeyCollection()) + ? implClient.getSecretKey() + : implClient.getKey(Context.NONE).getValue().getKey(); + + if (jsonWebKey == null) { + throw new IllegalStateException( + "Could not retrieve JSON Web Key to perform local cryptographic operations."); + } else if (!jsonWebKey.isValid()) { + throw new IllegalStateException("The retrieved JSON Web Key is not valid."); + } else { + return initializeLocalClient(jsonWebKey, implClient); + } + } else { + // Couldn't/didn't create a local cryptography client. + throw new IllegalStateException("Could not create a local cryptography client."); + } + } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java index 10bd63643da4b..4a41747e04224 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java @@ -49,6 +49,11 @@ * a {@link CryptographyAsyncClient} or a {@link CryptographyClient} are a {@link TokenCredential credential} and either * a {@link JsonWebKey JSON Web Key} or a {@code Azure Key Vault key identifier}.

* + *

To ensure correct behavior when performing operations such as {@code Decrypt}, {@code Unwrap} and + * {@code Verify}, it is recommended to use a {@link CryptographyAsyncClient} or {@link CryptographyClient} created + * for the specific key version that was used for the corresponding inverse operation: {@code Encrypt}, + * {@code Wrap}, or {@code Sign}, respectively.

+ * * *
  * CryptographyAsyncClient cryptographyAsyncClient = new CryptographyClientBuilder()
@@ -66,19 +71,6 @@
  * 
* * - *

When a {@link CryptographyAsyncClient} or {@link CryptographyClient} gets created using a - * {@code Azure Key Vault key identifier}, the first time a cryptographic operation is attempted, the client will - * attempt to retrieve the key material from the service, cache it, and perform all future cryptographic operations - * locally, deferring to the service when that's not possible. If key retrieval and caching fails because of a - * non-retryable error, the client will not make any further attempts and will fall back to performing all cryptographic - * operations on the service side. Conversely, when a {@link CryptographyAsyncClient} or {@link CryptographyClient} gets - * created using a {@link JsonWebKey JSON Web Key}, all cryptographic operations will be performed locally.

- * - *

To ensure correct behavior when performing operations such as {@code Decrypt}, {@code Unwrap} and - * {@code Verify}, it is recommended to use a {@link CryptographyAsyncClient} or {@link CryptographyClient} created - * for the specific key version that was used for the corresponding inverse operation: {@code Encrypt}, - * {@code Wrap}, or {@code Sign}, respectively.

- * *

The {@link HttpLogDetailLevel log detail level}, multiple custom {@link HttpLoggingPolicy policies} and a custom * {@link HttpClient http client} can be optionally configured in the {@link CryptographyClientBuilder}.

* @@ -93,6 +85,27 @@ *
* * + *

The minimal configuration options required by {@link CryptographyClientBuilder cryptographyClientBuilder} to + * build {@link CryptographyClient} are {@link JsonWebKey jsonWebKey} or + * {@link String Azure Key Vault key identifier} and {@link TokenCredential credential}.

+ * + * + *
+ * CryptographyClient cryptographyClient = new CryptographyClientBuilder()
+ *     .keyIdentifier("<your-key-id>")
+ *     .credential(new DefaultAzureCredentialBuilder().build())
+ *     .buildClient();
+ * 
+ * + * + *
+ * JsonWebKey jsonWebKey = new JsonWebKey().setId("SampleJsonWebKey");
+ * CryptographyClient cryptographyClient = new CryptographyClientBuilder()
+ *     .jsonWebKey(jsonWebKey)
+ *     .buildClient();
+ * 
+ * + * * @see CryptographyAsyncClient * @see CryptographyClient */ @@ -122,8 +135,7 @@ public final class CryptographyClientBuilder implements private RetryOptions retryOptions; private String keyId; private TokenCredential credential; - private boolean isChallengeResourceVerificationDisabled = false; - private boolean isKeyCachingDisabled = false; + private boolean disableChallengeResourceVerification = false; static { Map properties = CoreUtils.getProperties("azure-key-vault-keys.properties"); @@ -173,7 +185,7 @@ public CryptographyClient buildClient() { version != null ? version : CryptographyServiceVersion.getLatest(); if (pipeline != null) { - return new CryptographyClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled); + return new CryptographyClient(keyId, pipeline, serviceVersion); } if (credential == null) { @@ -184,13 +196,8 @@ public CryptographyClient buildClient() { HttpPipeline pipeline = setupPipeline(); - return new CryptographyClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled); + return new CryptographyClient(keyId, pipeline, serviceVersion); } else { - if (isKeyCachingDisabled) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Key caching cannot be disabled when using a JSON Web Key.")); - } - return new CryptographyClient(jsonWebKey); } } @@ -228,7 +235,7 @@ public CryptographyAsyncClient buildAsyncClient() { version != null ? version : CryptographyServiceVersion.getLatest(); if (pipeline != null) { - return new CryptographyAsyncClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled); + return new CryptographyAsyncClient(keyId, pipeline, serviceVersion); } if (credential == null) { @@ -239,13 +246,8 @@ public CryptographyAsyncClient buildAsyncClient() { HttpPipeline pipeline = setupPipeline(); - return new CryptographyAsyncClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled); + return new CryptographyAsyncClient(keyId, pipeline, serviceVersion); } else { - if (isKeyCachingDisabled) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Key caching cannot be disabled when using a JSON Web Key.")); - } - return new CryptographyAsyncClient(jsonWebKey); } } @@ -276,7 +278,7 @@ HttpPipeline setupPipeline() { // Add retry policy. policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions)); - policies.add(new KeyVaultCredentialPolicy(credential, isChallengeResourceVerificationDisabled)); + policies.add(new KeyVaultCredentialPolicy(credential, disableChallengeResourceVerification)); // Add per retry additional policies. policies.addAll(perRetryPolicies); @@ -575,21 +577,7 @@ public CryptographyClientBuilder clientOptions(ClientOptions clientOptions) { * @return The updated {@link CryptographyClientBuilder} object. */ public CryptographyClientBuilder disableChallengeResourceVerification() { - this.isChallengeResourceVerificationDisabled = true; - - return this; - } - - /** - * Disables local key caching and defers all cryptographic operations to the service. - * - *

This method will have no effect if used in conjunction with the - * {@link CryptographyClientBuilder#jsonWebKey(JsonWebKey)} method.

- * - * @return The updated {@link CryptographyClientBuilder} object. - */ - public CryptographyClientBuilder disableKeyCaching() { - this.isKeyCachingDisabled = true; + this.disableChallengeResourceVerification = true; return this; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceVersion.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceVersion.java index 728b1b316463c..c3694a542c5ad 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceVersion.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceVersion.java @@ -37,12 +37,7 @@ public enum CryptographyServiceVersion implements ServiceVersion { /** * Service version {@code 7.5}. */ - V7_5("7.5"), - - /** - * Service version {@code 7.6-preview.1}. - */ - V7_6_PREVIEW_1("7.6-preview.1"); + V7_5("7.5"); private final String version; @@ -64,6 +59,6 @@ public String getVersion() { * @return the latest {@link CryptographyServiceVersion} */ public static CryptographyServiceVersion getLatest() { - return V7_6_PREVIEW_1; + return V7_5; } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java index b4870b7850941..e1ebf974fe23a 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java @@ -3,6 +3,8 @@ package com.azure.security.keyvault.keys.cryptography; +import static com.azure.core.util.FluxUtil.monoError; + import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; @@ -13,18 +15,8 @@ import com.azure.security.keyvault.keys.models.JsonWebKey; import reactor.core.publisher.Mono; -import static com.azure.core.util.FluxUtil.monoError; - /** * A key client which is used to asynchronously wrap or unwrap another key. - * - *

When a {@link KeyEncryptionKeyAsyncClient} gets created using a {@code Azure Key Vault key identifier}, the first - * time a cryptographic operation is attempted, the client will attempt to retrieve the key material from the service, - * cache it, and perform all future cryptographic operations locally, deferring to the service when that's not possible. - * If key retrieval and caching fails because of a non-retryable error, the client will not make any further attempts - * and will fall back to performing all cryptographic operations on the service side. Conversely, when a - * {@link KeyEncryptionKeyAsyncClient} created using a {@link JsonWebKey JSON Web Key}, all cryptographic operations - * will be performed locally.

*/ @ServiceClient(builder = KeyEncryptionKeyClientBuilder.class, isAsync = true) public final class KeyEncryptionKeyAsyncClient extends CryptographyAsyncClient implements AsyncKeyEncryptionKey { @@ -36,12 +28,9 @@ public final class KeyEncryptionKeyAsyncClient extends CryptographyAsyncClient i * @param keyId The identifier of the key to use for cryptography operations. * @param pipeline The {@link HttpPipeline} that the HTTP requests and responses flow through. * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. - * @param disableKeyCaching Indicates if local key caching should be disabled and all cryptographic operations - * deferred to the service. */ - KeyEncryptionKeyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version, - boolean disableKeyCaching) { - super(keyId, pipeline, version, disableKeyCaching); + KeyEncryptionKeyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { + super(keyId, pipeline, version); } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java index 6cb9adcfeb210..9a3be82d909eb 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java @@ -13,14 +13,6 @@ /** * A key client which is used to synchronously wrap or unwrap another key. - * - *

When a {@link KeyEncryptionKeyClient} gets created using a {@code Azure Key Vault key identifier}, the first time - * a cryptographic operation is attempted, the client will attempt to retrieve the key material from the service, cache - * it, and perform all future cryptographic operations locally, deferring to the service when that's not possible. If - * key retrieval and caching fails because of a non-retryable error, the client will not make any further attempts and - * will fall back to performing all cryptographic operations on the service side. Conversely, when a - * {@link KeyEncryptionKeyClient} created using a {@link JsonWebKey JSON Web Key}, all cryptographic operations will be - * performed locally.

*/ @ServiceClient(builder = KeyEncryptionKeyClientBuilder.class) public final class KeyEncryptionKeyClient extends CryptographyClient implements KeyEncryptionKey { @@ -31,12 +23,9 @@ public final class KeyEncryptionKeyClient extends CryptographyClient implements * @param keyId The identifier of the key to use for cryptography operations. * @param pipeline The {@link HttpPipeline} that the HTTP requests and responses flow through. * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. - * @param disableKeyCaching Indicates if local key caching should be disabled and all cryptographic operations - * deferred to the service. */ - KeyEncryptionKeyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version, - boolean disableKeyCaching) { - super(keyId, pipeline, version, disableKeyCaching); + KeyEncryptionKeyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { + super(keyId, pipeline, version); } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java index 5fef7876808aa..cae34fa88f5ae 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java @@ -40,16 +40,6 @@ * {@link AsyncKeyEncryptionKey} are {@link JsonWebKey jsonWebKey} or {@link String Azure Key Vault key identifier} * and {@link TokenCredential credential}.

* - *

When a {@link AsyncKeyEncryptionKey KeyEncryptionKey async client} or - * {@link KeyEncryptionKey KeyEncryptionKey sync client} gets created using a - * {@code Azure Key Vault key identifier}, the first time a cryptographic operation is attempted, the client will - * attempt to retrieve the key material from the service, cache it, and perform all future cryptographic operations - * locally, deferring to the service when that's not possible. If key retrieval and caching fails because of a - * non-retryable error, the client will not make any further attempts and will fall back to performing all cryptographic - * operations on the service side. Conversely, when a {@link AsyncKeyEncryptionKey KeyEncryptionKey async client} or - * {@link KeyEncryptionKey KeyEncryptionKey sync client} gets created using a {@link JsonWebKey JSON Web Key}, all - * cryptographic operations will be performed locally.

- * *

The {@link HttpLogDetailLevel log detail level}, multiple custom {@link HttpLoggingPolicy policies} and custom * {@link HttpClient http client} can be optionally configured in the {@link KeyEncryptionKeyClientBuilder}.

* @@ -72,7 +62,6 @@ public final class KeyEncryptionKeyClientBuilder implements KeyEncryptionKeyReso private static final ClientLogger LOGGER = new ClientLogger(KeyEncryptionKeyClientBuilder.class); private final CryptographyClientBuilder builder; - private boolean isKeyCachingDisabled = false; /** * The constructor with defaults. @@ -103,16 +92,16 @@ public KeyEncryptionKey buildKeyEncryptionKey(String keyId) { builder.keyIdentifier(keyId); if (CoreUtils.isNullOrEmpty(keyId)) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("An Azure Key Vault key identifier cannot be null and is required to build " - + "the key encryption key client.")); + throw LOGGER.logExceptionAsError(new IllegalStateException( + "An Azure Key Vault key identifier cannot be null and is required to build the key encryption key " + + "client.")); } CryptographyServiceVersion serviceVersion = builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); if (builder.getPipeline() != null) { - return new KeyEncryptionKeyClient(keyId, builder.getPipeline(), serviceVersion, isKeyCachingDisabled); + return new KeyEncryptionKeyClient(keyId, builder.getPipeline(), serviceVersion); } if (builder.getCredential() == null) { @@ -122,7 +111,7 @@ public KeyEncryptionKey buildKeyEncryptionKey(String keyId) { HttpPipeline pipeline = builder.setupPipeline(); - return new KeyEncryptionKeyClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled); + return new KeyEncryptionKeyClient(keyId, pipeline, serviceVersion); } /** @@ -147,11 +136,6 @@ public KeyEncryptionKey buildKeyEncryptionKey(JsonWebKey key) { new IllegalArgumentException("JSON Web Key's id property is not configured.")); } - if (isKeyCachingDisabled) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Key caching cannot be disabled when using a JSON Web Key.")); - } - return new KeyEncryptionKeyClient(key); } @@ -182,18 +166,15 @@ public Mono buildAsyncKeyEncryptionKey(String k builder.keyIdentifier(keyId); if (CoreUtils.isNullOrEmpty(keyId)) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("An Azure Key Vault key identifier cannot be null and is required to build " - + "the key encryption key client.")); + throw LOGGER.logExceptionAsError(new IllegalStateException( + "An Azure Key Vault key identifier cannot be null and is required to build the key encryption key " + + "client.")); } - CryptographyServiceVersion serviceVersion = - builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); + CryptographyServiceVersion serviceVersion = builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); if (builder.getPipeline() != null) { - return Mono.defer(() -> - Mono.just(new KeyEncryptionKeyAsyncClient(keyId, builder.getPipeline(), serviceVersion, - isKeyCachingDisabled))); + return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(keyId, builder.getPipeline(), serviceVersion))); } if (builder.getCredential() == null) { @@ -203,8 +184,7 @@ public Mono buildAsyncKeyEncryptionKey(String k HttpPipeline pipeline = builder.setupPipeline(); - return Mono.defer(() -> - Mono.just(new KeyEncryptionKeyAsyncClient(keyId, pipeline, serviceVersion, isKeyCachingDisabled))); + return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(keyId, pipeline, serviceVersion))); } /** @@ -226,13 +206,8 @@ public Mono buildAsyncKeyEncryptionKey(JsonWebK throw LOGGER.logExceptionAsError(new IllegalStateException( "JSON Web Key cannot be null and is required to build a local key encryption key async client.")); } else if (key.getId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("JSON Web Key's id property is not configured.")); - } - - if (isKeyCachingDisabled) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Key caching cannot be disabled when using a JSON Web Key.")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "JSON Web Key's id property is not configured.")); } return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(key))); @@ -463,20 +438,4 @@ public KeyEncryptionKeyClientBuilder disableChallengeResourceVerification() { return this; } - - /** - * Disables the ability to perform cryptographic operations locally, performing all cryptographic operations on the - * service side instead. - * - *

This method will have no effect if - * {@link KeyEncryptionKeyClientBuilder#buildAsyncKeyEncryptionKey(JsonWebKey)} or - * {@link KeyEncryptionKeyClientBuilder#buildKeyEncryptionKey(JsonWebKey)} are used to create a client.

- * - * @return The updated {@link KeyEncryptionKeyClientBuilder} object. - */ - public KeyEncryptionKeyClientBuilder disableLocalCryptography() { - this.isKeyCachingDisabled = true; - - return this; - } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyUtils.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyUtils.java index 9905eedef8031..8edf0cdd5b178 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyUtils.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyUtils.java @@ -3,7 +3,6 @@ package com.azure.security.keyvault.keys.cryptography.implementation; import com.azure.core.exception.HttpResponseException; -import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; @@ -15,7 +14,6 @@ import com.azure.security.keyvault.keys.models.JsonWebKey; import com.azure.security.keyvault.keys.models.KeyOperation; import com.azure.security.keyvault.keys.models.KeyType; -import reactor.core.publisher.Mono; import java.net.MalformedURLException; import java.net.URL; @@ -74,55 +72,8 @@ public static List unpackAndValidateId(String keyId, ClientLogger logger } } - public static LocalKeyCryptographyClient retrieveJwkAndCreateLocalClient(CryptographyClientImpl implClient) { - // Technically the collection portion of a key identifier should never be null/empty, but we still check for it. - if (!CoreUtils.isNullOrEmpty(implClient.getKeyCollection())) { - // Get the JWK from the service and validate it. Then attempt to create a local cryptography client or - // default to using service-side cryptography. - JsonWebKey jsonWebKey = CryptographyUtils.SECRETS_COLLECTION.equals(implClient.getKeyCollection()) - ? implClient.getSecretKey() - : implClient.getKey(Context.NONE).getValue().getKey(); - - if (jsonWebKey == null) { - throw new IllegalStateException( - "Could not retrieve JSON Web Key to perform local cryptographic operations."); - } else if (!jsonWebKey.isValid()) { - throw new IllegalStateException("The retrieved JSON Web Key is not valid."); - } else { - return createLocalClient(jsonWebKey, implClient); - } - } else { - // Couldn't/didn't create a local cryptography client. - throw new IllegalStateException("Could not create a local cryptography client."); - } - } - - public static Mono retrieveJwkAndCreateLocalAsyncClient(CryptographyClientImpl implClient) { - // Technically the collection portion of a key identifier should never be null/empty, but we still check for it. - if (!CoreUtils.isNullOrEmpty(implClient.getKeyCollection())) { - // Get the JWK from the service and validate it. Then attempt to create a local cryptography client or - // default to using service-side cryptography. - Mono jsonWebKeyMono = CryptographyUtils.SECRETS_COLLECTION.equals(implClient.getKeyCollection()) - ? implClient.getSecretKeyAsync() - : implClient.getKeyAsync().map(keyVaultKeyResponse -> keyVaultKeyResponse.getValue().getKey()); - - return jsonWebKeyMono.handle((jsonWebKey, sink) -> { - if (!jsonWebKey.isValid()) { - sink.error(new IllegalStateException("The retrieved JSON Web Key is not valid.")); - } else { - sink.next(createLocalClient(jsonWebKey, implClient)); - } - }); - } else { - // Couldn't/didn't create a local cryptography client. - return Mono.error(new IllegalStateException( - "Could not create a local cryptography client. Key collection is null or empty.")); - } - } - - public static LocalKeyCryptographyClient createLocalClient(JsonWebKey jsonWebKey, - CryptographyClientImpl implClient) { - + public static LocalKeyCryptographyClient initializeLocalClient(JsonWebKey jsonWebKey, + CryptographyClientImpl implClient) { if (!KeyType.values().contains(jsonWebKey.getKeyType())) { throw new IllegalArgumentException(String.format( "The JSON Web Key type: %s is not supported.", jsonWebKey.getKeyType().toString())); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/LifetimeActionsType.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/LifetimeActionsType.java index da0e6509c80e4..e7465db72a320 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/LifetimeActionsType.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/LifetimeActionsType.java @@ -17,7 +17,7 @@ @Fluent public final class LifetimeActionsType implements JsonSerializable { /* - * The type of the action. The value should be compared case-insensitively. + * The type of the action. */ private KeyRotationPolicyAction type; @@ -25,7 +25,7 @@ public final class LifetimeActionsType implements JsonSerializable { assertKeyEquals(keyToCreate, createdKey); - - if (!isHsmEnabled) { - assertEquals("0", createdKey.getProperties().getHsmPlatform()); - } + assertEquals("0", createdKey.getProperties().getHsmPlatform()); }) .verifyComplete()); } @@ -216,20 +210,14 @@ public void getKey(HttpClient httpClient, KeyServiceVersion serviceVersion) { StepVerifier.create(keyAsyncClient.createKey(keyToSetAndGet)) .assertNext(createdKey -> { assertKeyEquals(keyToSetAndGet, createdKey); - - if (!isHsmEnabled) { - assertEquals("0", createdKey.getProperties().getHsmPlatform()); - } + assertEquals("0", createdKey.getProperties().getHsmPlatform()); }) .verifyComplete(); StepVerifier.create(keyAsyncClient.getKey(keyToSetAndGet.getName())) .assertNext(retrievedKey -> { assertKeyEquals(keyToSetAndGet, retrievedKey); - - if (!isHsmEnabled) { - assertEquals("0", retrievedKey.getProperties().getHsmPlatform()); - } + assertEquals("0", retrievedKey.getProperties().getHsmPlatform()); }) .verifyComplete(); }); @@ -850,7 +838,7 @@ private void pollOnKeyPurge(String keyName) { } } - LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Key " + keyName + " was not purged"); + System.err.printf("Deleted Key %s was not purged \n", keyName); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java index fb8b4c69e83ea..10ace970322b4 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java @@ -7,8 +7,6 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.keys.cryptography.CryptographyClient; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; @@ -42,8 +40,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class KeyClientTest extends KeyClientTestBase { - private static final ClientLogger LOGGER = new ClientLogger(KeyClientTest.class); - protected KeyClient keyClient; @Override @@ -74,10 +70,7 @@ public void createKey(HttpClient httpClient, KeyServiceVersion serviceVersion) { KeyVaultKey createdKey = keyClient.createKey(keyToCreate); assertKeyEquals(keyToCreate, createdKey); - - if (!isHsmEnabled) { - assertEquals("0", createdKey.getProperties().getHsmPlatform()); - } + assertEquals("0", createdKey.getProperties().getHsmPlatform()); }); } @@ -199,10 +192,7 @@ public void getKey(HttpClient httpClient, KeyServiceVersion serviceVersion) { KeyVaultKey retrievedKey = keyClient.getKey(keyToSetAndGet.getName()); assertKeyEquals(keyToSetAndGet, retrievedKey); - - if (!isHsmEnabled) { - assertEquals("0", retrievedKey.getProperties().getHsmPlatform()); - } + assertEquals("0", retrievedKey.getProperties().getHsmPlatform()); }); } @@ -761,6 +751,6 @@ private void pollOnKeyPurge(String keyName) { } } - LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Key " + keyName + " was not purged"); + System.err.printf("Deleted Key %s was not purged \n", keyName); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTestBase.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTestBase.java index 74256900baf45..404d27db4bc58 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTestBase.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTestBase.java @@ -22,8 +22,7 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.json.JsonProviders; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -120,10 +119,19 @@ KeyClientBuilder getKeyClientBuilder(HttpClient httpClient, String testTenantId, KeyServiceVersion serviceVersion) { TokenCredential credential; - if (interceptorManager.isLiveMode()) { - credential = new AzurePowerShellCredentialBuilder().build(); - } else if (interceptorManager.isRecordMode()) { - credential = new DefaultAzureCredentialBuilder().build(); + if (!interceptorManager.isPlaybackMode()) { + String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID"); + String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET"); + String tenantId = testTenantId == null + ? Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID") + : testTenantId; + + credential = new ClientSecretCredentialBuilder() + .clientSecret(Objects.requireNonNull(clientKey, "The client key cannot be null")) + .clientId(Objects.requireNonNull(clientId, "The client id cannot be null")) + .tenantId(Objects.requireNonNull(tenantId, "The tenant id cannot be null")) + .additionallyAllowedTenants("*") + .build(); } else { credential = new MockTokenCredential(); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java index 01e37bb6cdac5..419c079e7854f 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java @@ -4,8 +4,6 @@ package com.azure.security.keyvault.keys.cryptography; import com.azure.core.http.HttpClient; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.logging.LogLevel; import com.azure.security.keyvault.keys.KeyClient; import com.azure.security.keyvault.keys.cryptography.models.EncryptParameters; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; @@ -42,8 +40,6 @@ import static org.junit.jupiter.api.Assertions.fail; public class CryptographyClientTest extends CryptographyClientTestBase { - private static final ClientLogger LOGGER = new ClientLogger(CryptographyClientTest.class); - private KeyClient client; @Override @@ -353,7 +349,7 @@ public void signDataVerifyEcLocal() { } catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException e) { // Could not generate a KeyPair from the given JsonWebKey. // It's likely this happened for key curve secp256k1, which is not supported on Java 16+. - LOGGER.log(LogLevel.VERBOSE, () -> "Failed to generate key pair from JsonWebKey.", e); + e.printStackTrace(); return; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java index a5bc83250abf7..91e7ed3f2276a 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java @@ -15,9 +15,7 @@ import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.security.keyvault.keys.KeyClientBuilder; import com.azure.security.keyvault.keys.KeyServiceVersion; import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; @@ -54,8 +52,6 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; public abstract class CryptographyClientTestBase extends TestProxyTestBase { - private static final ClientLogger LOGGER = new ClientLogger(CryptographyClientTestBase.class); - protected boolean isHsmEnabled = false; protected boolean runManagedHsmTest = false; @@ -75,11 +71,18 @@ void beforeTestSetup() { KeyClientBuilder getKeyClientBuilder(HttpClient httpClient, String endpoint, KeyServiceVersion serviceVersion) { TokenCredential credential; - if (interceptorManager.isLiveMode()) { - credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build(); - } else if (interceptorManager.isRecordMode()) { - credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build(); - } else { + if (!interceptorManager.isPlaybackMode()) { + String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID"); + String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET"); + String tenantId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID"); + + credential = new ClientSecretCredentialBuilder() + .clientSecret(Objects.requireNonNull(clientKey, "The client key cannot be null")) + .clientId(Objects.requireNonNull(clientId, "The client id cannot be null")) + .tenantId(Objects.requireNonNull(tenantId, "The tenant id cannot be null")) + .additionallyAllowedTenants("*") + .build(); + } else { credential = new MockTokenCredential(); List customMatchers = new ArrayList<>(); @@ -109,10 +112,17 @@ CryptographyClientBuilder getCryptographyClientBuilder(HttpClient httpClient, CryptographyServiceVersion serviceVersion) { TokenCredential credential; - if (interceptorManager.isLiveMode()) { - credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build(); - } else if (interceptorManager.isRecordMode()) { - credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build(); + if (!interceptorManager.isPlaybackMode()) { + String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID"); + String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET"); + String tenantId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID"); + + credential = new ClientSecretCredentialBuilder() + .clientSecret(Objects.requireNonNull(clientKey, "The client key cannot be null")) + .clientId(Objects.requireNonNull(clientId, "The client id cannot be null")) + .tenantId(Objects.requireNonNull(tenantId, "The tenant id cannot be null")) + .additionallyAllowedTenants("*") + .build(); } else { credential = new MockTokenCredential(); @@ -328,6 +338,10 @@ public String getEndpoint() { } public void sleep(long millis) { - sleepIfRunningAgainstService(millis); + try { + Thread.sleep(millis); + } catch (InterruptedException e) { + e.printStackTrace(); + } } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java index 4701f46f5d9ff..5b32117981dd8 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java @@ -35,11 +35,6 @@ private void setupSecretKeyAndClient(byte[] kek, HttpClient httpClient, Cryptogr HttpClient actualHttpClient = buildSyncAssertingClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient); - if (!interceptorManager.isLiveMode()) { - // Remove `id` and `name` sanitizers from the list of common sanitizers. - interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); - } - String keyId = getEndpoint(); keyId = keyId.endsWith("/") ? keyId + "secrets/" + secretName : keyId + "/secrets/" + secretName; CryptographyClientImpl implClient = getCryptographyClientImpl(actualHttpClient, keyId, serviceVersion); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTestBase.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTestBase.java index bc21ad50d4cea..e0aab302e4fb2 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTestBase.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTestBase.java @@ -14,8 +14,7 @@ import com.azure.core.test.models.TestProxyRequestMatcher; import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.security.keyvault.keys.KeyClientBuilder; import com.azure.security.keyvault.keys.KeyServiceVersion; import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyClientImpl; @@ -105,11 +104,18 @@ CryptographyClientImpl getCryptographyClientImpl(HttpClient httpClient, String k } private TokenCredential getTokenCredentialAndSetMatchers() { - if (interceptorManager.isLiveMode()) { - return new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build(); - } else if (interceptorManager.isRecordMode()) { - return new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build(); - } else { + if (!interceptorManager.isPlaybackMode()) { + String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID"); + String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET"); + String tenantId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID"); + + return new ClientSecretCredentialBuilder() + .clientSecret(Objects.requireNonNull(clientKey, "The client key cannot be null")) + .clientId(Objects.requireNonNull(clientId, "The client id cannot be null")) + .tenantId(Objects.requireNonNull(tenantId, "The tenant id cannot be null")) + .additionallyAllowedTenants("*") + .build(); + } else { List customMatchers = new ArrayList<>(); customMatchers.add(new BodilessMatcher()); customMatchers.add(new CustomMatcher().setExcludedHeaders(Collections.singletonList("Authorization"))); diff --git a/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md index 798832d19a676..14e6cfb2b2982 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md +++ b/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md @@ -33,7 +33,7 @@ autorest use: '@autorest/java@4.1.22' output-folder: ../ java: true -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/keys.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/551275acb80e1f8b39036b79dfc35a8f63b601a7/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.4/keys.json title: KeyClient namespace: com.azure.security.keyvault.keys models-subpackage: implementation.models diff --git a/sdk/keyvault/azure-security-keyvault-perf/pom.xml b/sdk/keyvault/azure-security-keyvault-perf/pom.xml index 64acc79c3ba39..020ac11f168d3 100644 --- a/sdk/keyvault/azure-security-keyvault-perf/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-perf/pom.xml @@ -26,17 +26,17 @@ com.azure azure-security-keyvault-certificates - 4.7.0-beta.1 + 4.6.5 com.azure azure-security-keyvault-keys - 4.9.0-beta.1 + 4.8.6 com.azure azure-security-keyvault-secrets - 4.9.0-beta.1 + 4.8.5 com.azure diff --git a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md index 578c98f9188d5..0913d274e9646 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md @@ -1,14 +1,14 @@ # Release History -## 4.9.0-beta.1 (Unreleased) +## 4.8.5 (2024-07-29) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`. +- Upgraded `azure-json` from `1.1.0` to version `1.2.0`. +- Upgraded `azure-core` from `1.49.1` to version `1.50.0`. ## 4.8.4 (2024-06-27) @@ -589,11 +589,11 @@ For details on the Azure SDK for Java (August 2019 Preview) release refer to the - Removed static builder method from clients. Builders are now instantiable. ## 4.0.0-preview.1 (2019-06-28) -Version 4.0.0-preview.1 is a preview of our efforts in creating a client library that is developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as possible. The principles that guide our efforts can be found in the [Azure SDK Design Guidelines for Java](https://aka.ms/azsdk/guide/java). +Version 4.0.0-preview.1 is a preview of our efforts in creating a client library that is developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as possible. The principles that guide our efforts can be found in the [Azure SDK Design Guidelines for Java](https://azuresdkspecs.z5.web.core.windows.net/JavaSpec.html). For details on the Azure SDK for Java (July 2019 Preview) release, you can refer to the [release announcement](https://aka.ms/azure-sdk-preview1-java). -This library is not a direct replacement for secrets management operations from microsoft-azure-keyvault. Applications using that library would require code changes to use `azure-keyvault-secrets`. +This library is not a direct replacement for secrets management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.7.3/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-secrets`. This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-keyvault-secrets_4.0.0-preview.1/keyvault/client/secrets/README.md) and diff --git a/sdk/keyvault/azure-security-keyvault-secrets/README.md b/sdk/keyvault/azure-security-keyvault-secrets/README.md index 945361aec566f..2b679101117d4 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/README.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/README.md @@ -46,7 +46,7 @@ If you want to take dependency on a particular version of the library that is no com.azure azure-security-keyvault-secrets - 4.8.3 + 4.8.5 ``` [//]: # ({x-version-update-end}) @@ -54,7 +54,6 @@ If you want to take dependency on a particular version of the library that is no ### Prerequisites - A [Java Development Kit (JDK)][jdk_link], version 8 or later. - - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis). - An [Azure Subscription][azure_subscription]. - An existing [Azure Key Vault][azure_keyvault]. If you need to create a key vault, you can do so in the Azure Portal by following the steps in [this document][azure_keyvault_portal]. Alternatively, you can use the Azure CLI by following the steps in [this document][azure_keyvault_cli]. diff --git a/sdk/keyvault/azure-security-keyvault-secrets/assets.json b/sdk/keyvault/azure-security-keyvault-secrets/assets.json index 2363851274cfb..7acd1df9cf286 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/assets.json +++ b/sdk/keyvault/azure-security-keyvault-secrets/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/keyvault/azure-security-keyvault-secrets", - "Tag": "java/keyvault/azure-security-keyvault-secrets_5c7c80d234" + "Tag": "java/keyvault/azure-security-keyvault-secrets_28e407b475" } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/perf-tests.yml b/sdk/keyvault/azure-security-keyvault-secrets/perf-tests.yml index 8e20c7046f94e..68072cff1771c 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/perf-tests.yml +++ b/sdk/keyvault/azure-security-keyvault-secrets/perf-tests.yml @@ -5,18 +5,20 @@ Project: sdk/keyvault/azure-security-keyvault-perf PrimaryPackage: 'com.azure:azure-security-keyvault-secrets' PackageVersions: -- 'com.azure:azure-security-keyvault-certificates': 4.5.9 # {x-version-update;com.azure:azure-security-keyvault-certificates;dependency} - 'com.azure:azure-security-keyvault-keys': 4.7.3 # {x-version-update;com.azure:azure-security-keyvault-keys;dependency} - 'com.azure:azure-security-keyvault-secrets': 4.7.3 # {x-version-update;com.azure:azure-security-keyvault-secrets;dependency} - 'com.azure:azure-core': 1.46.0 # {x-version-update;com.azure:azure-core;dependency} - 'com.azure:azure-core-http-netty': 1.14.0 # {x-version-update;com.azure:azure-core-http-netty;dependency} - 'com.azure:azure-identity': 1.11.2 # {x-version-update;com.azure:azure-identity;dependency} +- 'com.azure:azure-security-keyvault-certificates': 4.3.5 + 'com.azure:azure-security-keyvault-keys': 4.4.6 + 'com.azure:azure-security-keyvault-secrets': 4.4.6 + 'com.azure:azure-core': 1.31.0 + 'com.azure:azure-core-http-netty': 1.12.4 + 'com.azure:azure-identity': 1.5.4 + 'io.projectreactor:reactor-core': 3.4.9 - 'com.azure:azure-security-keyvault-certificates': source 'com.azure:azure-security-keyvault-keys': source 'com.azure:azure-security-keyvault-secrets': source 'com.azure:azure-core': source 'com.azure:azure-core-http-netty': source 'com.azure:azure-identity': source + 'io.projectreactor:reactor-core': source Tests: - Test: get-secret diff --git a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml index db5fb606268e0..82858caa28e45 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml @@ -11,7 +11,7 @@ com.azure azure-security-keyvault-secrets - 4.9.0-beta.1 + 4.8.5 Microsoft Azure client library for KeyVault Secrets This module contains client library for Microsoft Azure KeyVault Secrets. @@ -68,12 +68,6 @@ 1.12.1 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.19 - test - org.junit.jupiter junit-jupiter-api @@ -120,21 +114,4 @@ test - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.14 - test - - - - diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretServiceVersion.java b/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretServiceVersion.java index 8ddee9cb149b5..15f47b6b8e988 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretServiceVersion.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretServiceVersion.java @@ -37,12 +37,7 @@ public enum SecretServiceVersion implements ServiceVersion { /** * Service version {@code 7.5}. */ - V7_5("7.5"), - - /** - * Service version {@code 7.6-preview.1}. - */ - V7_6_PREVIEW_1("7.6-preview.1"); + V7_5("7.5"); private final String version; @@ -64,6 +59,6 @@ public String getVersion() { * @return the latest {@link SecretServiceVersion} */ public static SecretServiceVersion getLatest() { - return V7_6_PREVIEW_1; + return V7_5; } } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java index 73dc808a6c6a2..155f022e979af 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java @@ -7,8 +7,6 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.http.AssertingHttpClientBuilder; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.PollerFlux; import com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy; @@ -31,8 +29,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class SecretAsyncClientTest extends SecretClientTestBase { - private static final ClientLogger LOGGER = new ClientLogger(SecretAsyncClientTest.class); - private SecretAsyncClient secretAsyncClient; @Override @@ -49,10 +45,6 @@ private void createSecretAsyncClient(HttpClient httpClient, SecretServiceVersion secretAsyncClient = getClientBuilder(buildAsyncAssertingClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), testTenantId, getEndpoint(), serviceVersion) .buildAsyncClient(); - if (!interceptorManager.isLiveMode()) { - // Remove `id` and `name` sanitizers from the list of common sanitizers. - interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); - } } private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { @@ -582,6 +574,6 @@ private void pollOnSecretPurge(String secretName) { } } - LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Secret " + secretName + " was not purged"); + System.err.printf("Deleted Secret %s was not purged \n", secretName); } } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java index 452a1ecaa34f8..0e8309f0b9ce9 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java @@ -7,8 +7,6 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.http.AssertingHttpClientBuilder; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy; import com.azure.security.keyvault.secrets.implementation.models.KeyVaultErrorException; @@ -29,8 +27,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class SecretClientTest extends SecretClientTestBase { - private static final ClientLogger LOGGER = new ClientLogger(SecretClientTest.class); - private SecretClient secretClient; @Override @@ -46,11 +42,6 @@ private void createClient(HttpClient httpClient, SecretServiceVersion serviceVer secretClient = getClientBuilder(buildSyncAssertingClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), testTenantId, getEndpoint(), serviceVersion) .buildClient(); - - if (!interceptorManager.isLiveMode()) { - // Remove `id` and `name` sanitizers from the list of common sanitizers. - interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); - } } private HttpClient buildSyncAssertingClient(HttpClient httpClient) { @@ -503,6 +494,6 @@ private void pollOnSecretPurge(String secretName) { } } - LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Secret " + secretName + " was not purged"); + System.err.printf("Deleted Secret %s was not purged \n", secretName); } } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTestBase.java b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTestBase.java index 058abe8c7d347..cb6d7237d966a 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTestBase.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTestBase.java @@ -16,8 +16,7 @@ import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy; import com.azure.security.keyvault.secrets.models.KeyVaultSecret; import com.azure.security.keyvault.secrets.models.SecretProperties; @@ -70,12 +69,26 @@ SecretClientBuilder getClientBuilder(HttpClient httpClient, String testTenantId, SecretServiceVersion serviceVersion) { TokenCredential credential; - if (interceptorManager.isLiveMode()) { - credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build(); - } else if (interceptorManager.isRecordMode()) { - credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build(); + if (!interceptorManager.isPlaybackMode()) { + String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID"); + String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET"); + String tenantId = testTenantId == null + ? Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID") + : testTenantId; + + Objects.requireNonNull(clientId, "The client id cannot be null"); + Objects.requireNonNull(clientKey, "The client key cannot be null"); + Objects.requireNonNull(tenantId, "The tenant id cannot be null"); + + credential = new ClientSecretCredentialBuilder() + .clientSecret(clientKey) + .clientId(clientId) + .tenantId(tenantId) + .additionallyAllowedTenants("*") + .build(); } else { credential = new MockTokenCredential(); + List customMatchers = new ArrayList<>(); customMatchers.add(new BodilessMatcher()); customMatchers.add(new CustomMatcher().setExcludedHeaders(Collections.singletonList("Authorization"))); diff --git a/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md index 8f4eefa758dc7..9a355aa4e7149 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md @@ -33,7 +33,7 @@ autorest use: '@autorest/java@4.1.22' output-folder: ../ java: true -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/secrets.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/secrets.json title: SecretClient namespace: com.azure.security.keyvault.secrets models-subpackage: implementation.models