Skip to content

Commit 3acb267

Browse files
Merge pull request #223405 from alexwolfmsft/key-vault-passwordless-quickstarts
new passwordless content
2 parents 2607fa3 + e83b5d8 commit 3acb267

File tree

3 files changed

+36
-31
lines changed

3 files changed

+36
-31
lines changed

articles/key-vault/certificates/quick-create-net.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Quickstart - Azure Key Vault certificates client library for .NET (version 4)
3-
description: Learn how to create, retrieve, and delete certificates from an Azure key vault using the .NET client library (version 4)
2+
title: Quickstart - Azure Key Vault certificates client library for .NET
3+
description: Learn how to create, retrieve, and delete certificates from an Azure key vault using the .NET client library
44
author: msmbaldwin
55
ms.author: mbaldwin
66
ms.date: 11/14/2022
77
ms.service: key-vault
88
ms.subservice: certificates
99
ms.topic: quickstart
1010
ms.devlang: csharp
11-
ms.custom: devx-track-csharp, mode-api
11+
ms.custom: devx-track-csharp, mode-api, passwordless-dotnet
1212
---
1313

14-
# Quickstart: Azure Key Vault certificate client library for .NET (SDK v4)
14+
# Quickstart: Azure Key Vault certificate client library for .NET
1515

1616
Get started with the Azure Key Vault certificate client library for .NET. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for certificates. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete certificates from an Azure key vault using the .NET client library
1717

@@ -26,7 +26,7 @@ For more information about Key Vault and certificates, see:
2626
## Prerequisites
2727

2828
* An Azure subscription - [create one for free](https://azure.microsoft.com/free/dotnet)
29-
* [.NET Core 3.1 SDK or later](https://dotnet.microsoft.com/download/dotnet-core)
29+
* [.NET 6 SDK or later](https://dotnet.microsoft.com/download)
3030
* [Azure CLI](/cli/azure/install-azure-cli)
3131
* A Key Vault - you can create one using [Azure portal](../general/quick-create-portal.md), [Azure CLI](../general/quick-create-cli.md), or [Azure PowerShell](../general/quick-create-powershell.md).
3232

@@ -89,7 +89,7 @@ From the command shell, install the Azure Key Vault certificate client library f
8989
dotnet add package Azure.Security.KeyVault.Certificates
9090
```
9191

92-
For this quickstart, you'll also need to install the Azure SDK client library for Azure Identity:
92+
For this quickstart, you'll also need to install the Azure Identity client library:
9393

9494
```dotnetcli
9595
dotnet add package Azure.Identity
@@ -131,9 +131,11 @@ using Azure.Security.KeyVault.Certificates;
131131

132132
### Authenticate and create a client
133133

134-
In this quickstart, logged in user is used to authenticate to key vault, which is preferred method for local development. For applications deployed to Azure, managed identity should be assigned to App Service or Virtual Machine, for more information, see [Managed Identity Overview](../../active-directory/managed-identities-azure-resources/overview.md).
134+
Application requests to most Azure services must be authorized. Using the [DefaultAzureCredential](/dotnet/azure/sdk/authentication#defaultazurecredential) class provided by the [Azure Identity client library](/dotnet/api/overview/azure/identity-readme) is the recommended approach for implementing passwordless connections to Azure services in your code. `DefaultAzureCredential` supports multiple authentication methods and determines which method should be used at runtime. This approach enables your app to use different authentication methods in different environments (local vs. production) without implementing environment-specific code.
135135

136-
In below example, the name of your key vault is expanded to the key vault URI, in the format "https://\<your-key-vault-name\>.vault.azure.net". This example is using ['DefaultAzureCredential()'](/dotnet/api/azure.identity.defaultazurecredential) class from [Azure Identity Library](/dotnet/api/overview/azure/identity-readme), which allows to use the same code across different environments with different options to provide identity. For more information about authenticating to key vault, see [Developer's Guide](../general/developers-guide.md#authenticate-to-key-vault-in-code).
136+
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
137+
138+
In this example, the name of your key vault is expanded to the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
137139

138140
```csharp
139141
string keyVaultName = Environment.GetEnvironmentVariable("KEY_VAULT_NAME");
@@ -178,7 +180,7 @@ await client.PurgeDeletedCertificateAsync("myCertificate");
178180

179181
## Sample code
180182

181-
Modify the .NET Core console app to interact with the Key Vault by completing the following steps:
183+
Modify the .NET console app to interact with the Key Vault by completing the following steps:
182184

183185
- Replace the code in *Program.cs* with the following code:
184186

articles/key-vault/keys/quick-create-net.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Quickstart - Azure Key Vault keys client library for .NET (version 4)
3-
description: Learn how to create, retrieve, and delete keys from an Azure key vault using the .NET client library (version 4)
2+
title: Quickstart - Azure Key Vault keys client library for .NET
3+
description: Learn how to create, retrieve, and delete keys from an Azure key vault using the .NET client library
44
author: msmbaldwin
55
ms.author: mbaldwin
66
ms.date: 01/04/2023
77
ms.service: key-vault
88
ms.subservice: keys
99
ms.topic: quickstart
1010
ms.devlang: csharp
11-
ms.custom: devx-track-csharp, devx-track-azurepowershell, mode-api
11+
ms.custom: devx-track-csharp, devx-track-azurepowershell, mode-api, passwordless-dotnet
1212
---
1313

14-
# Quickstart: Azure Key Vault key client library for .NET (SDK v4)
14+
# Quickstart: Azure Key Vault key client library for .NET
1515

1616
Get started with the Azure Key Vault key client library for .NET. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for cryptographic keys. You can securely store cryptographic keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete keys from an Azure key vault using the .NET key client library
1717

@@ -26,7 +26,7 @@ For more information about Key Vault and keys, see:
2626
## Prerequisites
2727

2828
* An Azure subscription - [create one for free](https://azure.microsoft.com/free/dotnet)
29-
* [.NET Core 3.1 SDK or later](https://dotnet.microsoft.com/download/dotnet-core)
29+
* [.NET 6 SDK or later](https://dotnet.microsoft.com/download)
3030
* [Azure CLI](/cli/azure/install-azure-cli)
3131
* A Key Vault - you can create one using [Azure portal](../general/quick-create-portal.md), [Azure CLI](../general/quick-create-cli.md), or [Azure PowerShell](../general/quick-create-powershell.md).
3232

@@ -89,7 +89,7 @@ From the command shell, install the Azure Key Vault key client library for .NET:
8989
dotnet add package Azure.Security.KeyVault.Keys
9090
```
9191

92-
For this quickstart, you'll also need to install the Azure SDK client library for Azure Identity:
92+
For this quickstart, you'll also need to install the Azure Identity client library:
9393

9494
```dotnetcli
9595
dotnet add package Azure.Identity
@@ -131,13 +131,15 @@ using Azure.Security.KeyVault.Keys;
131131

132132
### Authenticate and create a client
133133

134-
In this quickstart, logged in user is used to authenticate to key vault, which is preferred method for local development. For applications deployed to Azure, managed identity should be assigned to App Service or Virtual Machine, for more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
134+
Application requests to most Azure services must be authorized. Using the [DefaultAzureCredential](/dotnet/azure/sdk/authentication#defaultazurecredential) class provided by the [Azure Identity client library](/dotnet/api/overview/azure/identity-readme) is the recommended approach for implementing passwordless connections to Azure services in your code. `DefaultAzureCredential` supports multiple authentication methods and determines which method should be used at runtime. This approach enables your app to use different authentication methods in different environments (local vs. production) without implementing environment-specific code.
135135

136-
In this example, the name of your key vault is expanded to the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. This example is using ['DefaultAzureCredential()'](/dotnet/api/azure.identity.defaultazurecredential) class from [Azure Identity Library](/dotnet/api/overview/azure/identity-readme), which allows to use the same code across different environments with different options to provide identity. Fore more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
136+
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
137+
138+
In this example, the name of your key vault is expanded to the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
137139

138140
```csharp
139141
var keyVaultName = Environment.GetEnvironmentVariable("KEY_VAULT_NAME");
140-
var kvUri = "https://" + keyVaultName + ".vault.azure.net";
142+
var kvUri = $"https://{keyVaultName}.vault.azure.net";
141143

142144
var client = new KeyClient(new Uri(kvUri), new DefaultAzureCredential());
143145
```
@@ -177,7 +179,7 @@ await client.PurgeDeletedKeyAsync("myKey");
177179

178180
## Sample code
179181

180-
Modify the .NET Core console app to interact with the Key Vault by completing the following steps:
182+
Modify the .NET console app to interact with the Key Vault by completing the following steps:
181183

182184
- Replace the code in *Program.cs* with the following code:
183185

articles/key-vault/secrets/quick-create-net.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Quickstart - Azure Key Vault secrets client library for .NET (version 4)
3-
description: Learn how to create, retrieve, and delete secrets from an Azure key vault using the .NET client library (version 4)
2+
title: Quickstart - Azure Key Vault secrets client library for .NET
3+
description: Learn how to create, retrieve, and delete secrets from an Azure key vault using the .NET client library
44
author: msmbaldwin
55
ms.author: mbaldwin
66
ms.date: 09/23/2020
77
ms.service: key-vault
88
ms.subservice: secrets
99
ms.topic: quickstart
1010
ms.devlang: csharp
11-
ms.custom: devx-track-csharp, mode-api
11+
ms.custom: devx-track-csharp, mode-api, passwordless-dotnet
1212
---
1313

14-
# Quickstart: Azure Key Vault secret client library for .NET (SDK v4)
14+
# Quickstart: Azure Key Vault secret client library for .NET
1515

1616
Get started with the Azure Key Vault secret client library for .NET. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete secrets from an Azure key vault using the .NET client library
1717

@@ -26,10 +26,9 @@ For more information about Key Vault and secrets, see:
2626
## Prerequisites
2727

2828
* An Azure subscription - [create one for free](https://azure.microsoft.com/free/dotnet)
29-
* [.NET Core 3.1 SDK or later](https://dotnet.microsoft.com/download/dotnet-core)
30-
* [Azure CLI](/cli/azure/install-azure-cli)
31-
* [Azure PowerShell](/powershell/azure/install-az-ps)
32-
* A Key Vault - you can create one using [Azure portal](../general/quick-create-portal.md) [Azure CLI](../general/quick-create-cli.md), or [Azure PowerShell](../general/quick-create-powershell.md)
29+
* [.NET 6 SDK or later](https://dotnet.microsoft.com/download)
30+
* [Azure CLI](/cli/azure/install-azure-cli) or [Azure PowerShell](/powershell/azure/install-az-ps)
31+
* A Key Vault - you can create one using [Azure portal](../general/quick-create-portal.md), [Azure CLI](../general/quick-create-cli.md), or [Azure PowerShell](../general/quick-create-powershell.md)
3332

3433
This quickstart is using `dotnet` and Azure CLI or Azure PowerShell.
3534

@@ -121,7 +120,7 @@ From the command shell, install the Azure Key Vault secret client library for .N
121120
dotnet add package Azure.Security.KeyVault.Secrets
122121
```
123122

124-
For this quickstart, you'll also need to install the Azure SDK client library for Azure Identity:
123+
For this quickstart, you'll also need to install the Azure Identity client library:
125124

126125
```dotnetcli
127126
dotnet add package Azure.Identity
@@ -158,9 +157,11 @@ Add the following directives to the top of *Program.cs*:
158157

159158
### Authenticate and create a client
160159

161-
In this quickstart, logged in user is used to authenticate to key vault, which is preferred method for local development. For applications deployed to Azure, managed identity should be assigned to App Service or Virtual Machine, for more information, see [Managed Identity Overview](../../active-directory/managed-identities-azure-resources/overview.md).
160+
Application requests to most Azure services must be authorized. Using the [DefaultAzureCredential](/dotnet/azure/sdk/authentication#defaultazurecredential) class provided by the [Azure Identity client library](/dotnet/api/overview/azure/identity-readme) is the recommended approach for implementing passwordless connections to Azure services in your code. `DefaultAzureCredential` supports multiple authentication methods and determines which method should be used at runtime. This approach enables your app to use different authentication methods in different environments (local vs. production) without implementing environment-specific code.
162161

163-
In below example, the name of your key vault is expanded to the key vault URI, in the format "https://\<your-key-vault-name\>.vault.azure.net". This example is using ['DefaultAzureCredential()'](/dotnet/api/azure.identity.defaultazurecredential) class from [Azure Identity Library](/dotnet/api/overview/azure/identity-readme), which allows to use the same code across different environments with different options to provide identity. For more information about authenticating to key vault, see [Developer's Guide](../general/developers-guide.md#authenticate-to-key-vault-in-code).
162+
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
163+
164+
In this example, the name of your key vault is expanded to the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
164165

165166
[!code-csharp[](~/samples-key-vault-dotnet-quickstart/key-vault-console-app/Program.cs?name=authenticate)]
166167

@@ -200,7 +201,7 @@ await client.PurgeDeletedSecretAsync("mySecret");
200201

201202
## Sample code
202203

203-
Modify the .NET Core console app to interact with the Key Vault by completing the following steps:
204+
Modify the .NET console app to interact with the Key Vault by completing the following steps:
204205

205206
1. Replace the code in *Program.cs* with the following code:
206207

0 commit comments

Comments
 (0)