You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/key-vault/general/tutorial-net-create-vault-azure-web-app.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Tutorial - Use Azure Key Vault with an Azure web app in .NET | Microsoft Docs
2
+
title: Tutorial - Use Azure Key Vault with an Azure webapp in .NET | Microsoft Docs
3
3
description: In this tutorial, you configure an ASP.NET core application to read a secret from your key vault.
4
4
services: key-vault
5
5
author: msmbaldwin
@@ -13,7 +13,7 @@ ms.author: mbaldwin
13
13
ms.custom: mvc
14
14
#Customer intent: As a developer I want to use Azure Key Vault to store secrets for my app, so that they are kept secure.
15
15
---
16
-
# Tutorial: Use Azure Key Vault with an Azure web app in .NET
16
+
# Tutorial: Use Azure Key Vault with an Azure webapp in .NET
17
17
18
18
Get started with the Azure Key Vault client library for .NET. Follow the steps below to install the package and try out example code for basic tasks.
19
19
@@ -50,7 +50,7 @@ This quickstart assumes you are running `dotnet`, [Azure CLI](/cli/azure/install
50
50
51
51
A resource group is a logical container into which Azure resources are deployed and managed.
52
52
53
-
Your first step is to create a resource group to house both your key vault and your web app. You can do so with the [az group create](/cli/azure/group?view=azure-cli-latest#az-group-create) command:
53
+
Your first step is to create a resource group to house both your key vault and your webapp. You can do so with the [az group create](/cli/azure/group?view=azure-cli-latest#az-group-create) command:
54
54
55
55
```azurecli
56
56
az group create --name "myResourceGroup" -l "EastUS"
@@ -75,7 +75,7 @@ You can now place a secret in your key vault with the [az keyvault secret set](/
75
75
az keyvault secret set --vault-name <your-unique-keyvault-name> -name "MySecret" -value "Success!"
76
76
```
77
77
78
-
## Create a .NET web app
78
+
## Create a .NET webapp
79
79
80
80
### Create a local app
81
81
@@ -116,7 +116,7 @@ git commit -m "first commit"
116
116
117
117
### Configure a deployment user
118
118
119
-
FTP and local Git can deploy to an Azure web app by using a *deployment user*. Once you configure your deployment user, you can use it for all your Azure deployments. Your account-level deployment username and password are different from your Azure subscription credentials.
119
+
FTP and local Git can deploy to an Azure webapp by using a *deployment user*. Once you configure your deployment user, you can use it for all your Azure deployments. Your account-level deployment username and password are different from your Azure subscription credentials.
120
120
121
121
To configure the deployment user, run the [az webapp deployment user set](/cli/azure/webapp/deployment/user?view=azure-cli-latest#az-webapp-deployment-user-set) command in Azure Cloud Shell. Replace \<username> and \<password> with a deployment user username and password.
122
122
@@ -129,7 +129,7 @@ az webapp deployment user set --user-name <username> --password <password>
129
129
130
130
The JSON output shows the password as `null`. If you get a `'Conflict'. Details: 409` error, change the username. If you get a `'Bad Request'. Details: 400` error, use a stronger password.
131
131
132
-
Record your username and password to use to deploy your web apps.
132
+
Record your username and password to use to deploy your webapps.
133
133
134
134
### Create an app service plan
135
135
@@ -162,18 +162,18 @@ When the App Service plan has been created, the Azure CLI shows information simi
162
162
</pre>
163
163
164
164
165
-
### Create a remote web app
165
+
### Create a remote webapp
166
166
167
-
Create a [web app](../articles/app-service/containers/app-service-linux-intro.md) in the `myAppServicePlan` App Service plan.
167
+
Create a [webapp](../../app-service/containers/app-service-linux-intro.md) in the `myAppServicePlan` App Service plan.
168
168
169
169
```azurecli-interactive
170
-
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --deployment-local-git
170
+
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <your-webapp-name> --deployment-local-git
171
171
```
172
172
173
-
When the web app has been created, the Azure CLI shows output similar to the following example:
173
+
When the webapp has been created, the Azure CLI shows output similar to the following example:
174
174
175
175
<pre>
176
-
Local git is configured with url of 'https://<username>@<app-name>.scm.azurewebsites.net/<app-name>.git'
176
+
Local git is configured with url of 'https://<username>@<your-webapp-name>.scm.azurewebsites.net/<ayour-webapp-name>.git'
177
177
{
178
178
"availabilityState": "Normal",
179
179
"clientAffinityEnabled": true,
@@ -182,30 +182,29 @@ Local git is configured with url of 'https://<username>@<app-name>.s
> The URL of the Git remote is shown in the `deploymentLocalGitUrl` property, with the format `https://<username>@<app-name>.scm.azurewebsites.net/<app-name>.git`. Save this URL as you need it later.
193
+
> The URL of the Git remote is shown in the `deploymentLocalGitUrl` property, with the format `https://<username>@<your-webapp-name>.scm.azurewebsites.net/<your-webapp-name>.git`. Save this URL as you need it later.
194
194
>
195
195
196
-
197
-
Browse to your newly created app. Replace _<app-name>_ with your app name.
196
+
Browse to your newly created app. Replace _<your-webapp-name>_ with your app name.
Back in the local terminal window, add an Azure remote to your local Git repository. Replace *\<deploymentLocalGitUrl-from-create-step>* with the URL of the Git remote that you saved from [Create a web app](#create-a-web-app).
207
+
Back in the local terminal window, add an Azure remote to your local Git repository. Replace *\<deploymentLocalGitUrl-from-create-step>* with the URL of the Git remote that you saved from [Create a remote webapp](#create-a-remote-webapp).
Find and open the Startup.cs file in your akvwebapp project. Add these three lines before the `app.UseEndpoints` call, updating the URI to reflect your unique webapp name:
301
300
302
301
```cpp
303
-
var client = new SecretClient(new Uri("https://<your-unique-webapp-name>.vault.azure.net/"), new DefaultAzureCredential());
302
+
var client = new SecretClient(new Uri("https://<your-webapp-name>.vault.azure.net/"), new DefaultAzureCredential());
0 commit comments