Skip to content

Commit 705caa4

Browse files
authored
Key Vault keys/secrets/certificates Samples names improvement (Azure#25161)
1 parent 53688ab commit 705caa4

15 files changed

+24
-24
lines changed

sdk/keyvault/azure-keyvault-certificates/samples/backup_restore_operations_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run_sample():
4343
client = CertificateClient(vault_url=vault_url, credential=credential)
4444

4545
print("\n.. Create Certificate")
46-
cert_name = "BackupRestoreCertificate"
46+
cert_name = "BackupRestoreCertificateAsync"
4747

4848
# Let's create a certificate for your key vault.
4949
# if the certificate already exists in the Key Vault, then a new version of the certificate is created.

sdk/keyvault/azure-keyvault-certificates/samples/hello_world_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def run_sample():
6262
content_type=CertificateContentType.pkcs12,
6363
validity_in_months=24,
6464
)
65-
cert_name = "HelloWorldCertificate"
65+
cert_name = "HelloWorldCertificateAsync"
6666

6767
# Awaiting create_certificate will return the certificate as a KeyVaultCertificate
6868
# if creation is successful, and the CertificateOperation if not.

sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run_sample():
4343
# Assuming you already have a PFX containing your key pair, you can import it into Key Vault.
4444
# You can do this without setting a policy, but the policy is needed if you want the private key to be exportable
4545
# or to configure actions when a certificate is close to expiration.
46-
pfx_cert_name = "pfxCert"
46+
pfx_cert_name = "pfxCertAsync"
4747
with open(os.environ["PFX_CERT_PATH"], "rb") as f:
4848
pfx_cert_bytes = f.read()
4949
imported_pfx_cert = await client.import_certificate(
@@ -54,7 +54,7 @@ async def run_sample():
5454
# Now let's import a PEM-formatted certificate.
5555
# To import a PEM-formatted certificate, you must provide a CertificatePolicy that sets the content_type to
5656
# CertificateContentType.pem or the certificate will fail to import (the default content type is PFX).
57-
pem_cert_name = "pemCert"
57+
pem_cert_name = "pemCertAsync"
5858
with open(os.environ["PEM_CERT_PATH"], "rb") as f:
5959
pem_cert_bytes = f.read()
6060
pem_cert_policy = CertificatePolicy(issuer_name=WellKnownIssuerNames.self, content_type=CertificateContentType.pem)

sdk/keyvault/azure-keyvault-certificates/samples/list_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ async def run_sample():
4444
# Let's create a certificate for holding storage and bank accounts credentials. If the certificate
4545
# already exists in the Key Vault, then a new version of the certificate is created.
4646
print("\n.. Create Certificate")
47-
bank_cert_name = "BankListCertificate"
48-
storage_cert_name = "StorageListCertificate"
47+
bank_cert_name = "BankListCertificateAsync"
48+
storage_cert_name = "StorageListCertificateAsync"
4949

5050
bank_certificate = await client.create_certificate(
5151
certificate_name=bank_cert_name, policy=CertificatePolicy.get_default()

sdk/keyvault/azure-keyvault-certificates/samples/parse_certificate_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def run_sample():
5757

5858
# Before creating your certificate, let's create the management policy for your certificate.
5959
# Here we use the default policy.
60-
cert_name = "PrivateKeyCertificate"
60+
cert_name = "PrivateKeyCertificateAsync"
6161
cert_policy = CertificatePolicy.get_default()
6262

6363
# Awaiting create_certificate will return the certificate as a KeyVaultCertificate

sdk/keyvault/azure-keyvault-certificates/samples/recover_purge_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ async def run_sample():
4343
# Let's create certificates holding storage and bank accounts credentials. If the certificate
4444
# already exists in the Key Vault, then a new version of the certificate is created.
4545
print("\n.. Create Certificates")
46-
bank_cert_name = "BankRecoverCertificate"
47-
storage_cert_name = "ServerRecoverCertificate"
46+
bank_cert_name = "BankRecoverCertificateAsync"
47+
storage_cert_name = "ServerRecoverCertificateAsync"
4848

4949
bank_certificate = await client.create_certificate(
5050
certificate_name=bank_cert_name, policy=CertificatePolicy.get_default()

sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def run_sample():
4545
# Let's create a Key of type RSA.
4646
# if the key already exists in the Key Vault, then a new version of the key is created.
4747
print("\n.. Create Key")
48-
key = await client.create_key("keyName", "RSA")
48+
key = await client.create_key("keyNameAsync", "RSA")
4949
print("Key with name '{0}' created with key type '{1}'".format(key.name, key.key_type))
5050

5151
# Backups are good to have, if in case keys gets deleted accidentally.

sdk/keyvault/azure-keyvault-keys/samples/hello_world_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ async def run_sample():
4848
print("\n.. Create an RSA Key")
4949
key_size = 2048
5050
key_ops = ["encrypt", "decrypt", "sign", "verify", "wrapKey", "unwrapKey"]
51-
key_name = "rsaKeyName"
51+
key_name = "rsaKeyNameAsync"
5252
rsa_key = await client.create_rsa_key(key_name, size=key_size, key_operations=key_ops)
5353
print("RSA Key with name '{0}' created of type '{1}'.".format(rsa_key.name, rsa_key.key_type))
5454

5555
# Let's create an Elliptic Curve key with algorithm curve type P-256.
5656
# if the key already exists in the Key Vault, then a new version of the key is created.
5757
print("\n.. Create an EC Key")
5858
key_curve = "P-256"
59-
key_name = "ECKeyName"
59+
key_name = "ECKeyNameAsync"
6060
ec_key = await client.create_ec_key(key_name, curve=key_curve)
6161
print("EC Key with name '{0}' created of type {1}.".format(ec_key.name, ec_key.key_type))
6262

sdk/keyvault/azure-keyvault-keys/samples/key_rotation_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def run_sample():
4444
client = KeyClient(vault_url=VAULT_URL, credential=credential)
4545

4646
# First, create a key
47-
key_name = "rotation-sample-key"
47+
key_name = "rotation-sample-key-async"
4848
key = await client.create_rsa_key(key_name)
4949
print("\nCreated a key; new version is {}".format(key.properties.version))
5050

sdk/keyvault/azure-keyvault-keys/samples/list_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ async def run_sample():
4646
# Let's create keys with RSA and EC type. If the key
4747
# already exists in the Key Vault, then a new version of the key is created.
4848
print("\n.. Create Key")
49-
rsa_key = await client.create_rsa_key("rsaKeyName")
50-
ec_key = await client.create_ec_key("ecKeyName")
49+
rsa_key = await client.create_rsa_key("rsaKeyNameAsync")
50+
ec_key = await client.create_ec_key("ecKeyNameAsync")
5151
print("Key with name '{0}' was created of type '{1}'.".format(rsa_key.name, rsa_key.key_type))
5252
print("Key with name '{0}' was created of type '{1}'.".format(ec_key.name, ec_key.key_type))
5353

sdk/keyvault/azure-keyvault-keys/samples/recover_purge_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ async def run_sample():
4040
client = KeyClient(vault_url=VAULT_URL, credential=credential)
4141

4242
print("\n.. Create keys")
43-
rsa_key = await client.create_rsa_key("rsaKeyName")
44-
ec_key = await client.create_ec_key("ecKeyName")
43+
rsa_key = await client.create_rsa_key("rsaKeyNameAsync")
44+
ec_key = await client.create_ec_key("ecKeyNameAsync")
4545
print("Created key '{0}' of type '{1}'.".format(rsa_key.name, rsa_key.key_type))
4646
print("Created key '{0}' of type '{1}'.".format(ec_key.name, ec_key.key_type))
4747

sdk/keyvault/azure-keyvault-secrets/samples/backup_restore_operations_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run_sample():
4343
# Let's create a secret holding storage account credentials.
4444
# if the secret already exists in the Key Vault, then a new version of the secret is created.
4545
print("\n.. Create Secret")
46-
secret = await client.set_secret("backupRestoreSecretName", "backupRestoreSecretValue")
46+
secret = await client.set_secret("backupRestoreSecretNameAsync", "backupRestoreSecretValue")
4747
print("Secret with name '{0}' created with value '{1}'".format(secret.name, secret.value))
4848

4949
# Backups are good to have, if in case secrets gets deleted accidentally.

sdk/keyvault/azure-keyvault-secrets/samples/hello_world_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run_sample():
4343
# if the secret already exists in the key vault, then a new version of the secret is created.
4444
print("\n.. Create Secret")
4545
expires_on = datetime.datetime.utcnow() + datetime.timedelta(days=365)
46-
secret = await client.set_secret("helloWorldSecretName", "helloWorldSecretValue", expires_on=expires_on)
46+
secret = await client.set_secret("helloWorldSecretNameAsync", "helloWorldSecretValue", expires_on=expires_on)
4747
print("Secret with name '{0}' created with value '{1}'".format(secret.name, secret.value))
4848
print("Secret with name '{0}' expires on '{1}'".format(secret.name, secret.properties.expires_on))
4949

@@ -72,7 +72,7 @@ async def run_sample():
7272
# Bank forced a password update for security purposes. Let's change the value of the secret in the key vault.
7373
# To achieve this, we need to create a new version of the secret in the key vault. The update operation cannot
7474
# change the value of the secret.
75-
new_secret = await client.set_secret(secret.name, "newSecretValue")
75+
new_secret = await client.set_secret(secret.name, "newSecretValueAsync")
7676
print("Secret with name '{0}' created with value '{1}'".format(new_secret.name, new_secret.value))
7777

7878
# The bank account was closed, need to delete its credentials from the Key Vault.

sdk/keyvault/azure-keyvault-secrets/samples/list_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ async def run_sample():
4444
# Let's create secrets holding storage and bank accounts credentials. If the secret
4545
# already exists in the Key Vault, then a new version of the secret is created.
4646
print("\n.. Create Secret")
47-
bank_secret = await client.set_secret("listOpsBankSecretName", "listOpsSecretValue1")
48-
storage_secret = await client.set_secret("listOpsStorageSecretName", "listOpsSecretValue2")
47+
bank_secret = await client.set_secret("listOpsBankSecretNameAsync", "listOpsSecretValue1")
48+
storage_secret = await client.set_secret("listOpsStorageSecretNameAsync", "listOpsSecretValue2")
4949
print("Secret with name '{0}' was created.".format(bank_secret.name))
5050
print("Secret with name '{0}' was created.".format(storage_secret.name))
5151

sdk/keyvault/azure-keyvault-secrets/samples/recover_purge_operations_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ async def run_sample():
4242
# Let's create secrets holding storage and bank accounts credentials. If the secret
4343
# already exists in the Key Vault, then a new version of the secret is created.
4444
print("\n.. Create Secret")
45-
bank_secret = await client.set_secret("recoverPurgeBankSecretName", "recoverPurgeSecretValue1")
46-
storage_secret = await client.set_secret("recoverPurgeStorageSecretName", "recoverPurgeSecretValue2")
45+
bank_secret = await client.set_secret("recoverPurgeBankSecretNameAsync", "recoverPurgeSecretValue1")
46+
storage_secret = await client.set_secret("recoverPurgeStorageSecretNameAsync", "recoverPurgeSecretValue2")
4747
print("Secret with name '{0}' was created.".format(bank_secret.name))
4848
print("Secret with name '{0}' was created.".format(storage_secret.name))
4949

0 commit comments

Comments
 (0)