diff --git a/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py b/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py index 01edd5b77df3..6f461a02929a 100644 --- a/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py +++ b/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py @@ -46,29 +46,29 @@ async def run_sample(): # if the key already exists in the Key Vault, then a new version of the key is created. print("\n.. Create Key") key = await client.create_key("keyNameAsync", "RSA") - print("Key with name '{0}' created with key type '{1}'".format(key.name, key.key_type)) + print(f"Key with name '{key.name}' created with key type '{key.key_type}'") # Backups are good to have, if in case keys gets deleted accidentally. # For long term storage, it is ideal to write the backup to a file. print("\n.. Create a backup for an existing Key") key_backup = await client.backup_key(key.name) - print("Backup created for key with name '{0}'.".format(key.name)) + print(f"Backup created for key with name '{key.name}'.") # The rsa key is no longer in use, so you delete it. deleted_key = await client.delete_key(key.name) - print("Deleted key with name '{0}'".format(deleted_key.name)) + print(f"Deleted key with name '{deleted_key.name}'") # Purge the deleted key. # The purge will take some time, so wait before restoring the backup to avoid a conflict. print("\n.. Purge the key") await client.purge_deleted_key(key.name) await asyncio.sleep(60) - print("Purged key with name '{0}'".format(deleted_key.name)) + print(f"Purged key with name '{deleted_key.name}'") # In the future, if the key is required again, we can use the backup value to restore it in the Key Vault. print("\n.. Restore the key using the backed up key bytes") key = await client.restore_key_backup(key_backup) - print("Restored key with name '{0}'".format(key.name)) + print(f"Restored key with name '{key.name}'") print("\nrun_sample done") await credential.close()