diff --git a/sdk/keyvault/azure-security-keyvault-administration/README.md b/sdk/keyvault/azure-security-keyvault-administration/README.md index f5293070284d..6cd8fad7cdeb 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/README.md +++ b/sdk/keyvault/azure-security-keyvault-administration/README.md @@ -111,9 +111,15 @@ 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. @@ -340,20 +346,47 @@ 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 = "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 sasToken = ""; SyncPoller backupPoller = keyVaultBackupClient.beginBackup(blobStorageUrl, sasToken); - PollResponse pollResponse = backupPoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); @@ -371,26 +404,49 @@ 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 = "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 sasToken = ""; -SyncPoller backupPoller = +SyncPoller restorePoller = keyVaultBackupClient.beginRestore(folderUrl, sasToken); - -PollResponse pollResponse = backupPoller.poll(); +PollResponse pollResponse = restorePoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); -PollResponse finalPollResponse = backupPoller.waitForCompletion(); +PollResponse finalPollResponse = restorePoller.waitForCompletion(); if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { System.out.printf("Backup restored successfully.%n"); } else { - KeyVaultRestoreOperation operation = backupPoller.poll().getValue(); + KeyVaultRestoreOperation operation = restorePoller.poll().getValue(); System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage()); } @@ -401,22 +457,21 @@ 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 = "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 sasToken = ""; String keyName = "myKey"; -SyncPoller backupPoller = +SyncPoller restorePoller = keyVaultBackupClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName); - -PollResponse pollResponse = backupPoller.poll(); +PollResponse pollResponse = restorePoller.poll(); System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()); -PollResponse finalPollResponse = backupPoller.waitForCompletion(); +PollResponse finalPollResponse = restorePoller.waitForCompletion(); if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { System.out.printf("Key restored successfully.%n"); } else { - KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue(); + KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue(); System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage()); } @@ -424,18 +479,38 @@ 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 = "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 sasToken = ""; keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken) .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. @@ -448,12 +523,29 @@ 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 = "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 sasToken = ""; keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken) .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval. @@ -470,7 +562,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 = "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 sasToken = ""; 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 2edac6dd53d7..16819beda18c 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_95d2cbb133" + "Tag": "java/keyvault/azure-security-keyvault-administration_18fc6d4e27" } 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 9da3c1ae7476..f816b886c8cb 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,7 +27,12 @@ public enum KeyVaultAdministrationServiceVersion implements ServiceVersion { /** * Service version {@code 7.5}. */ - V7_5("7.5"); + V7_5("7.5"), + + /** + * Service version {@code 7.6-preview.1}. + */ + V7_6_PREVIEW_1("7.6-preview.1"); private final String version; @@ -46,6 +51,6 @@ public String getVersion() { * @return The latest {@link KeyVaultAdministrationServiceVersion}. */ public static KeyVaultAdministrationServiceVersion getLatest() { - return V7_5; + return V7_6_PREVIEW_1; } } 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 d4ed2f1d1f92..e49ae353a98b 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,6 +18,8 @@ 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; @@ -89,8 +91,7 @@ * *
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * 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 sasToken = "<sas-token>";
  *
  * client.beginBackup(blobStorageUrl, sasToken)
  *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -120,8 +121,7 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * 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 sasToken = "<sas-token>";
  *
  * client.beginRestore(folderUrl, sasToken)
  *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -150,8 +150,7 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * 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 sasToken = "<sas-token>";
  * String keyName = "myKey";
  *
  * client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
@@ -249,8 +248,7 @@ HttpPipeline getHttpPipeline() {
      * 
      * 
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * 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 sasToken = "<sas-token>";
      *
      * client.beginBackup(blobStorageUrl, sasToken)
      *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -400,6 +398,101 @@ 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. * @@ -409,8 +502,7 @@ private static Mono> processBackupOperatio * *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * 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 sasToken = "<sas-token>";
      *
      * client.beginRestore(folderUrl, sasToken)
      *     .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -554,6 +646,116 @@ 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. @@ -564,8 +766,7 @@ static Mono> processRestoreOperationRespo * *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * 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 sasToken = "<sas-token>";
      * 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 3dafe20bf84a..52bb3f35d5a8 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,6 +22,10 @@
 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;
@@ -92,11 +96,9 @@
  * 
  * 
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * 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 sasToken = "<sas-token>";
  *
  * 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());
@@ -131,22 +133,20 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * 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 sasToken = "<sas-token>";
  *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
  *     client.beginRestore(folderUrl, sasToken);
- *
- * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Backup restored successfully.%n");
  * } else {
- *     KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
+ *     KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
  *
  *     System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
  * }
@@ -169,23 +169,21 @@
  * 
  * 
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * 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 sasToken = "<sas-token>";
  * String keyName = "myKey";
  *
- * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
+ * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
  *     client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- *
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Key restored successfully.%n");
  * } else {
- *     KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
+ *     KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
  *
  *     System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
  * }
@@ -271,11 +269,9 @@ public String getVaultUrl() {
      * 
      * 
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * 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 sasToken = "<sas-token>";
      *
      * 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());
@@ -414,6 +410,112 @@ 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. * @@ -423,11 +525,9 @@ private static PollResponse processBackupOperationRespo * *
      * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-     * 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 sasToken = "<sas-token>";
      *
      * 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());
@@ -569,6 +669,121 @@ 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. @@ -579,23 +794,21 @@ private static PollResponse processRestoreOperationRes * *
      * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-     * 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 sasToken = "<sas-token>";
      * String keyName = "myKey";
      *
-     * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
+     * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
      *     client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-     *
-     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
+     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
      *
      * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
      *
-     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
+     * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
      *
      * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
      *     System.out.printf("Key restored successfully.%n");
      * } else {
-     *     KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
+     *     KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.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 4cf02ee63d5f..88a7c6f61f0d 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,6 +33,10 @@
 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;
@@ -57,7 +61,7 @@ public final class KeyVaultBackupClientImpl {
 
     /**
      * Gets Api Version.
-     * 
+     *
      * @return the apiVersion value.
      */
     public String getApiVersion() {
@@ -71,7 +75,7 @@ public String getApiVersion() {
 
     /**
      * Gets The HTTP pipeline to send requests through.
-     * 
+     *
      * @return the httpPipeline value.
      */
     public HttpPipeline getHttpPipeline() {
@@ -85,7 +89,7 @@ public HttpPipeline getHttpPipeline() {
 
     /**
      * Gets The serializer to serialize an object into a string.
-     * 
+     *
      * @return the serializerAdapter value.
      */
     public SerializerAdapter getSerializerAdapter() {
@@ -94,7 +98,7 @@ public SerializerAdapter getSerializerAdapter() {
 
     /**
      * Initializes an instance of KeyVaultBackupClient client.
-     * 
+     *
      * @param apiVersion Api Version.
      */
     public KeyVaultBackupClientImpl(String apiVersion) {
@@ -104,7 +108,7 @@ public KeyVaultBackupClientImpl(String apiVersion) {
 
     /**
      * Initializes an instance of KeyVaultBackupClient client.
-     * 
+     *
      * @param httpPipeline The HTTP pipeline to send requests through.
      * @param apiVersion Api Version.
      */
@@ -114,7 +118,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.
@@ -150,6 +154,22 @@ 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)
@@ -164,6 +184,22 @@ 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)
@@ -215,7 +251,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
@@ -235,7 +271,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
@@ -255,7 +291,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
@@ -274,7 +310,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
@@ -294,7 +330,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
@@ -315,7 +351,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
@@ -330,9 +366,115 @@ 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.
@@ -349,7 +491,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.
@@ -367,7 +509,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.
@@ -382,7 +524,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.
@@ -399,7 +541,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.
@@ -417,7 +559,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.
@@ -430,9 +572,125 @@ 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.
@@ -451,7 +709,7 @@ public FullBackupOperation fullBackupStatus(String vaultBaseUrl, String jobId) {
 
     /**
      * 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.
@@ -470,7 +728,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.
@@ -488,7 +746,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.
@@ -507,7 +765,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.
@@ -527,7 +785,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.
@@ -543,7 +801,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.
@@ -560,7 +818,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.
@@ -578,7 +836,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.
@@ -593,7 +851,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.
@@ -610,7 +868,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.
@@ -627,7 +885,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.
@@ -643,7 +901,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
@@ -665,7 +923,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
@@ -688,7 +946,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
@@ -708,7 +966,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
@@ -729,7 +987,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
@@ -752,7 +1010,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
new file mode 100644
index 000000000000..c8a6be3a6278
--- /dev/null
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java
@@ -0,0 +1,144 @@
+// 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
new file mode 100644
index 000000000000..9a2f0a0902ba
--- /dev/null
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java
@@ -0,0 +1,81 @@
+// 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
new file mode 100644
index 000000000000..4a44da9e1280
--- /dev/null
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java
@@ -0,0 +1,81 @@
+// 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
new file mode 100644
index 000000000000..a720ab06700d
--- /dev/null
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java
@@ -0,0 +1,113 @@
+// 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 1132a91286a5..b753f047dcb9 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,6 +312,45 @@
  * 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 @@ -326,11 +365,9 @@ * *
  * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * 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 sasToken = "<sas-token>";
  *
  * 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());
@@ -354,6 +391,46 @@
  * 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 @@ -368,22 +445,20 @@ * *
  * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * 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 sasToken = "<sas-token>";
  *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
  *     client.beginRestore(folderUrl, sasToken);
- *
- * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
  *
  * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
  *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
  *
  * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
  *     System.out.printf("Backup restored successfully.%n");
  * } else {
- *     KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
+ *     KeyVaultRestoreOperation operation = restorePoller.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 7fa3c2c0dad7..f7d0108edc7a 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,17 +293,44 @@ 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 = "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 sasToken = "";
 
         SyncPoller backupPoller =
             keyVaultBackupClient.beginBackup(blobStorageUrl, sasToken);
-
         PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -322,27 +349,52 @@ 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 = "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 sasToken = "";
 
-        SyncPoller backupPoller =
+        SyncPoller restorePoller =
             keyVaultBackupClient.beginRestore(folderUrl, sasToken);
-
-        PollResponse pollResponse = backupPoller.poll();
+        PollResponse pollResponse = restorePoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = backupPoller.waitForCompletion();
+        PollResponse finalPollResponse = restorePoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Backup restored successfully.%n");
         } else {
-            KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
+            KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
 
             System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
         }
@@ -355,35 +407,54 @@ public void beginRestore() {
     public void beginSelectiveKeyRestore() {
         // BEGIN: readme-sample-beginSelectiveKeyRestore
         String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
-        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 sasToken = "";
         String keyName = "myKey";
 
-        SyncPoller backupPoller =
+        SyncPoller restorePoller =
             keyVaultBackupClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-
-        PollResponse pollResponse = backupPoller.poll();
+        PollResponse pollResponse = restorePoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = backupPoller.waitForCompletion();
+        PollResponse finalPollResponse = restorePoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Key restored successfully.%n");
         } else {
-            KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
+            KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.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 = "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 sasToken = "";
 
         keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -397,13 +468,32 @@ 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 = "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 sasToken = "";
 
         keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -423,7 +513,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 = "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 sasToken = "";
         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 57e9b916a1c0..158569649064 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,6 +50,27 @@ 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)}.
      */
@@ -58,8 +79,7 @@ public void beginBackup() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginBackup#String-String
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        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 sasToken = "";
 
         client.beginBackup(blobStorageUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -73,6 +93,27 @@ 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)}.
      */
@@ -81,8 +122,7 @@ 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 = "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 sasToken = "";
 
         client.beginRestore(folderUrl, sasToken)
             .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -104,8 +144,7 @@ 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 = "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 sasToken = "";
         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 a0a0b8f1dab8..1c0788b0b3c2 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,6 +34,33 @@ 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)}.
      */
@@ -42,11 +69,9 @@ public void beginBackup() {
 
         // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginBackup#String-String
         String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
-        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 sasToken = "";
 
         SyncPoller backupPoller = client.beginBackup(blobStorageUrl, sasToken);
-
         PollResponse pollResponse = backupPoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -65,6 +90,34 @@ 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)}.
      */
@@ -73,22 +126,20 @@ 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 = "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 sasToken = "";
 
-        SyncPoller backupPoller =
+        SyncPoller restorePoller =
             client.beginRestore(folderUrl, sasToken);
-
-        PollResponse pollResponse = backupPoller.poll();
+        PollResponse pollResponse = restorePoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = backupPoller.waitForCompletion();
+        PollResponse finalPollResponse = restorePoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Backup restored successfully.%n");
         } else {
-            KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
+            KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
 
             System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
         }
@@ -103,23 +154,21 @@ 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 = "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 sasToken = "";
         String keyName = "myKey";
 
-        SyncPoller backupPoller =
+        SyncPoller restorePoller =
             client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
-
-        PollResponse pollResponse = backupPoller.poll();
+        PollResponse pollResponse = restorePoller.poll();
 
         System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
 
-        PollResponse finalPollResponse = backupPoller.waitForCompletion();
+        PollResponse finalPollResponse = restorePoller.waitForCompletion();
 
         if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
             System.out.printf("Key restored successfully.%n");
         } else {
-            KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
+            KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.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/KeyVaultAccessControlClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
index 1912b0a0d083..bcddfaf61d1e 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", "3a107ba6-6cc0-40cf-9fed-22b612269c92");
+        Configuration.getGlobalConfiguration().get("CLIENT_OBJECTID", "f84ae8f9-c979-4750-a2fe-b350a00bebff");
 
     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/KeyVaultBackupAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
index 6c3be6ed35a8..1e8baaddd810 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,24 +5,20 @@
 import com.azure.core.http.HttpClient;
 import com.azure.core.test.http.AssertingHttpClientBuilder;
 import com.azure.core.util.polling.AsyncPollResponse;
-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.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.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 {
@@ -49,13 +45,34 @@ private HttpClient buildAsyncAssertingClient(HttpClient httpClient) {
     public void beginBackup(HttpClient httpClient) {
         getAsyncClient(httpClient, false);
 
-        AsyncPollResponse backupPollResponse =
-            setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken)).blockLast();
+        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);
 
-        String backupBlobUri = backupPollResponse.getFinalResult().block();
+        StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginPreBackup(blobStorageUrl, sasToken))
+                .last()
+                .flatMap(AsyncPollResponse::getFinalResult)
+                .mapNotNull(backupBlobUri -> {
+                    assertNull(backupBlobUri);
 
-        assertNotNull(backupBlobUri);
-        assertTrue(backupBlobUri.startsWith(blobStorageUrl));
+                    return backupBlobUri;
+                }))
+            .verifyComplete();
     }
 
     /**
@@ -67,26 +84,49 @@ public void beginBackup(HttpClient httpClient) {
     public void beginRestore(HttpClient httpClient) {
         getAsyncClient(httpClient, false);
 
-        // Create a backup
-        AsyncPollResponse backupPollResponse =
-            setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, 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.beginRestore(backupBlobUri, sasToken)
+                    .last()
+                    .map(AsyncPollResponse::getValue)))
+            .assertNext(Assertions::assertNotNull)
+            .verifyComplete();
 
-        KeyVaultBackupOperation backupOperation = backupPollResponse.getValue();
-        assertNotNull(backupOperation);
+        // 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);
+    }
 
-        // Restore the backup
-        String backupFolderUrl = backupOperation.getAzureStorageBlobContainerUrl();
-        AsyncPollResponse restorePollResponse =
-            setPlaybackPollerFluxPollInterval(asyncClient.beginRestore(backupFolderUrl, sasToken))
-                .takeUntil(asyncPollResponse ->
-                    asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
-                .blockLast();
+    /**
+     * 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);
 
-        KeyVaultRestoreOperation restoreOperation = restorePollResponse.getValue();
-        assertNotNull(restoreOperation);
+        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();
 
         // 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.
@@ -100,42 +140,35 @@ public void beginRestore(HttpClient httpClient) {
     @ParameterizedTest(name = DISPLAY_NAME)
     @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
     public void beginSelectiveKeyRestore(HttpClient httpClient) {
-        KeyAsyncClient keyClient = new KeyClientBuilder()
+        KeyClient keyClient = new KeyClientBuilder()
             .vaultUrl(getEndpoint())
-            .serviceVersion(KeyServiceVersion.V7_2)
             .pipeline(getPipeline(httpClient, false))
-            .buildAsyncClient();
+            .buildClient();
 
         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).block();
+        KeyVaultKey createdKey = keyClient.createRsaKey(rsaKeyOptions);
 
         getAsyncClient(httpClient, false);
 
-        // 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);
+        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();
 
         // 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 62b4d8e7cf2c..362e36ff1299 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,7 +14,6 @@
 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;
@@ -25,6 +24,7 @@
 
 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,8 +52,9 @@ public void beginBackup(HttpClient httpClient) {
 
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
+        PollResponse pollResponse = backupPoller.waitForCompletion();
 
-        backupPoller.waitForCompletion();
+        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
 
         String backupBlobUri = backupPoller.getFinalResult();
 
@@ -61,6 +62,25 @@ 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.
      */
@@ -72,8 +92,9 @@ public void beginRestore(HttpClient httpClient) {
         // Create a backup
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
+        PollResponse pollResponse = backupPoller.waitForCompletion();
 
-        backupPoller.waitForCompletion();
+        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
 
         // Restore the backup
         String backupFolderUrl = backupPoller.getFinalResult();
@@ -91,6 +112,34 @@ 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.
      */
@@ -99,7 +148,6 @@ public void beginRestore(HttpClient httpClient) {
     public void beginSelectiveKeyRestore(HttpClient httpClient) {
         KeyClient keyClient = new KeyClientBuilder()
             .vaultUrl(getEndpoint())
-            .serviceVersion(KeyServiceVersion.V7_2)
             .pipeline(getPipeline(httpClient, false))
             .buildClient();
 
@@ -115,20 +163,19 @@ public void beginSelectiveKeyRestore(HttpClient httpClient) {
         // Create a backup
         SyncPoller backupPoller =
             setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
+        PollResponse backupPollResponse = backupPoller.waitForCompletion();
 
-        backupPoller.waitForCompletion();
+        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, backupPollResponse.getStatus());
 
         // Restore one key from said backup
         String backupFolderUrl = backupPoller.getFinalResult();
         SyncPoller selectiveKeyRestorePoller =
             setPlaybackSyncPollerPollInterval(client.beginSelectiveKeyRestore(createdKey.getName(), backupFolderUrl,
                 sasToken));
+        PollResponse restorePollResponse =
+            selectiveKeyRestorePoller.waitForCompletion();
 
-        selectiveKeyRestorePoller.waitForCompletion();
-
-        PollResponse response = selectiveKeyRestorePoller.poll();
-
-        assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.getStatus());
+        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.
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 0b5c5110844b..37adff2fc63a 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://ta70c2fe596f0a0dfprim.blob.core.windows.net/backup";
+        : "https://tb5d8675f0aa83a18prim.blob.core.windows.net/backup";
     protected final String sasToken = IS_MANAGED_HSM_DEPLOYED ? generateSasToken() : "REDACTED";
 
     KeyVaultBackupClientBuilder getClientBuilder(HttpClient httpClient, boolean forCleanup) {
@@ -31,9 +31,15 @@ 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/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
index 39e47f91030e..7d1eeb09dfb6 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/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/rbac.json
+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
 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/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/backuprestore.json
+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
 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/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/settings.json
+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
 title: KeyVaultSettingsClient
 custom-types: KeyVaultSettingType
 customization-class: src/main/java/SettingsCustomizations.java
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/assets.json b/sdk/keyvault/azure-security-keyvault-certificates/assets.json
index 22243c30c53e..7235a61b39fc 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_2816fc1705"
+  "Tag": "java/keyvault/azure-security-keyvault-certificates_e018897fab"
 }
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 461be4837c41..c9be34b86aa7 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,7 +37,12 @@ public enum CertificateServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5");
+    V7_5("7.5"),
+
+    /**
+     * Service version {@code 7.6-preview.1}.
+     */
+    V7_6_PREVIEW_1("7.6-preview.1");
 
     private final String version;
 
@@ -59,6 +64,6 @@ public String getVersion() {
      * @return the latest {@link CertificateServiceVersion}
      */
     public static CertificateServiceVersion getLatest() {
-        return V7_5;
+        return V7_6_PREVIEW_1;
     }
 }
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 94612cd2c6bc..926609d0bbd9 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("db1497bc2c82b365c5c7c73f611513ee117790a9"
+                    assertTrue("73b4319cdf38e0797084535d9c02fd04d4b2b2e6"
                         .equalsIgnoreCase(importedCertificate.getProperties().getX509ThumbprintAsString()));
                     assertEquals(importCertificateOptions.isEnabled(), importedCertificate.getProperties().isEnabled());
 
@@ -881,8 +881,10 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
                     X509Certificate x509Certificate = assertDoesNotThrow(
                         () -> loadCerToX509Certificate(importedCertificate.getCer()));
 
-                    assertEquals("CN=KeyVaultTest", x509Certificate.getSubjectX500Principal().getName());
-                    assertEquals("CN=KeyVaultTest", x509Certificate.getIssuerX500Principal().getName());
+                    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"));
                 })
                 .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 176841ed1efa..00cff103b635 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
@@ -861,7 +861,7 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
             KeyVaultCertificateWithPolicy importedCertificate =
                 certificateClient.importCertificate(importCertificateOptions);
 
-            assertTrue("db1497bc2c82b365c5c7c73f611513ee117790a9"
+            assertTrue("73b4319cdf38e0797084535d9c02fd04d4b2b2e6"
                 .equalsIgnoreCase(importedCertificate.getProperties().getX509ThumbprintAsString()));
             assertEquals(importCertificateOptions.isEnabled(), importedCertificate.getProperties().isEnabled());
 
@@ -869,8 +869,10 @@ public void importCertificate(HttpClient httpClient, CertificateServiceVersion s
             X509Certificate x509Certificate = assertDoesNotThrow(
                 () -> loadCerToX509Certificate(importedCertificate.getCer()));
 
-            assertEquals("CN=KeyVaultTest", x509Certificate.getSubjectX500Principal().getName());
-            assertEquals("CN=KeyVaultTest", x509Certificate.getIssuerX500Principal().getName());
+            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"));
         });
     }
 
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 67557bb45c07..d51e8d7c971e 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,56 +11,63 @@ public class FakeCredentialsForTests {
      * Fake certificate content
      */
     public static final String FAKE_CERTIFICATE =
-        "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";
+        "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"
+        + "ULN2mZ4ECN9bsOpidibOAgIIAA==";
 
     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 535eb0f0d9fd..077bab94790b 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/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/certificates.json
+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
 title: CertificateClient
 namespace: com.azure.security.keyvault.certificates
 models-subpackage: implementation.models
diff --git a/sdk/keyvault/azure-security-keyvault-keys/assets.json b/sdk/keyvault/azure-security-keyvault-keys/assets.json
index f14b27d364ed..31f6f88f48d3 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_72fb58ae91"
+  "Tag": "java/keyvault/azure-security-keyvault-keys_d9bef0f806"
 }
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 500375096e3a..c335fdc6e383 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,7 +37,12 @@ public enum KeyServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5");
+    V7_5("7.5"),
+
+    /**
+     * Service version {@code 7.6-preview.1}.
+     */
+    V7_6_PREVIEW_1("7.6-preview.1");
 
     private final String version;
 
@@ -59,6 +64,6 @@ public String getVersion() {
      * @return the latest {@link KeyServiceVersion}
      */
     public static KeyServiceVersion getLatest() {
-        return V7_5;
+        return V7_6_PREVIEW_1;
     }
 }
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 c3694a542c5a..728b1b316463 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,7 +37,12 @@ public enum CryptographyServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5");
+    V7_5("7.5"),
+
+    /**
+     * Service version {@code 7.6-preview.1}.
+     */
+    V7_6_PREVIEW_1("7.6-preview.1");
 
     private final String version;
 
@@ -59,6 +64,6 @@ public String getVersion() {
      * @return the latest {@link CryptographyServiceVersion}
      */
     public static CryptographyServiceVersion getLatest() {
-        return V7_5;
+        return V7_6_PREVIEW_1;
     }
 }
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 e7465db72a32..da0e6509c80e 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 type of the action. The value should be compared case-insensitively.
      */
     private KeyRotationPolicyAction type;
 
@@ -25,7 +25,7 @@ public final class LifetimeActionsType implements JsonSerializable {
                     assertKeyEquals(keyToCreate, createdKey);
-                    assertEquals("0", createdKey.getProperties().getHsmPlatform());
+
+                    if (!isHsmEnabled) {
+                        assertEquals("0", createdKey.getProperties().getHsmPlatform());
+                    }
                 })
                 .verifyComplete());
     }
@@ -210,14 +213,20 @@ public void getKey(HttpClient httpClient, KeyServiceVersion serviceVersion) {
             StepVerifier.create(keyAsyncClient.createKey(keyToSetAndGet))
                 .assertNext(createdKey -> {
                     assertKeyEquals(keyToSetAndGet, createdKey);
-                    assertEquals("0", createdKey.getProperties().getHsmPlatform());
+
+                    if (!isHsmEnabled) {
+                        assertEquals("0", createdKey.getProperties().getHsmPlatform());
+                    }
                 })
                 .verifyComplete();
 
             StepVerifier.create(keyAsyncClient.getKey(keyToSetAndGet.getName()))
                 .assertNext(retrievedKey -> {
                     assertKeyEquals(keyToSetAndGet, retrievedKey);
-                    assertEquals("0", retrievedKey.getProperties().getHsmPlatform());
+
+                    if (!isHsmEnabled) {
+                        assertEquals("0", retrievedKey.getProperties().getHsmPlatform());
+                    }
                 })
                 .verifyComplete();
         });
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 10ace970322b..f42395611aac 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
@@ -70,7 +70,10 @@ public void createKey(HttpClient httpClient, KeyServiceVersion serviceVersion) {
             KeyVaultKey createdKey = keyClient.createKey(keyToCreate);
 
             assertKeyEquals(keyToCreate, createdKey);
-            assertEquals("0", createdKey.getProperties().getHsmPlatform());
+
+            if (!isHsmEnabled) {
+                assertEquals("0", createdKey.getProperties().getHsmPlatform());
+            }
         });
     }
 
@@ -192,7 +195,10 @@ public void getKey(HttpClient httpClient, KeyServiceVersion serviceVersion) {
             KeyVaultKey retrievedKey = keyClient.getKey(keyToSetAndGet.getName());
 
             assertKeyEquals(keyToSetAndGet, retrievedKey);
-            assertEquals("0", retrievedKey.getProperties().getHsmPlatform());
+
+            if (!isHsmEnabled) {
+                assertEquals("0", retrievedKey.getProperties().getHsmPlatform());
+            }
         });
     }
 
diff --git a/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-keys/swagger/autorest.md
index 14e6cfb2b298..798832d19a67 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/551275acb80e1f8b39036b79dfc35a8f63b601a7/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.4/keys.json
+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
 title: KeyClient
 namespace: com.azure.security.keyvault.keys
 models-subpackage: implementation.models
diff --git a/sdk/keyvault/azure-security-keyvault-secrets/assets.json b/sdk/keyvault/azure-security-keyvault-secrets/assets.json
index 7acd1df9cf28..2363851274cf 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_28e407b475"
+  "Tag": "java/keyvault/azure-security-keyvault-secrets_5c7c80d234"
 }
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 15f47b6b8e98..8ddee9cb149b 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,7 +37,12 @@ public enum SecretServiceVersion implements ServiceVersion {
     /**
      * Service version {@code 7.5}.
      */
-    V7_5("7.5");
+    V7_5("7.5"),
+
+    /**
+     * Service version {@code 7.6-preview.1}.
+     */
+    V7_6_PREVIEW_1("7.6-preview.1");
 
     private final String version;
 
@@ -59,6 +64,6 @@ public String getVersion() {
      * @return the latest {@link SecretServiceVersion}
      */
     public static SecretServiceVersion getLatest() {
-        return V7_5;
+        return V7_6_PREVIEW_1;
     }
 }
diff --git a/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-secrets/swagger/autorest.md
index 9a355aa4e714..8f4eefa758dc 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/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/secrets.json
+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
 title: SecretClient
 namespace: com.azure.security.keyvault.secrets
 models-subpackage: implementation.models