Skip to content

Commit 70e8744

Browse files
committed
Addressed acrolinx feedback
1 parent 7b918b6 commit 70e8744

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

articles/key-vault/tutorial-rotation.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ This tutorial demonstrates how to automate the periodic rotation of secrets for
2121

2222
![Rotation diagram](./media/rotate1.png)
2323

24-
1. Thirty days before 30 days before the expiration date of a secret, Key Vault publish the "near expiry" event to Event Grid .
24+
1. Thirty days before the expiration date of a secret, Key Vault publish the "near expiry" event to Event Grid.
2525
1. Event Grid checks the event subscriptions and, using http post, calls the Function App endpoint subscribed to this event.
26-
1. The function App receives secret information, generates new random password, and create a new version for the secret with a new password in Key Vault.
26+
1. The function App receives the secret information, generates a new random password, and creates a new version for the secret with a new password in Key Vault.
2727
1. The function App updates SQL with new password.
2828

2929
> [!NOTE]
@@ -63,7 +63,7 @@ simplerotation-sql/master simplerotation eastus Microsoft.S
6363

6464
## Create Function App
6565

66-
Create a Function App with a with system managed identity, as well as the additional required components:
66+
Create a Function App with a system-managed identity, as well as the additional required components:
6767

6868
Function app requires below components and configuration:
6969
- App Service Plan
@@ -141,27 +141,27 @@ public class SecretRotator
141141
var client = new SecretClient(new Uri(kvUri), new DefaultAzureCredential());
142142
KeyVaultSecret secret = client.GetSecret(secretName, secretVersion);
143143
log.LogInformation("Secret Info Retrieved");
144-
144+
145145
//Retrieve Secret Info
146146
var userId = secret.Properties.Tags.ContainsKey(UserIdTagName) ?
147147
secret.Properties.Tags[UserIdTagName] : "";
148148
var datasource = secret.Properties.Tags.ContainsKey(DataSourceTagName) ?
149149
secret.Properties.Tags[DataSourceTagName] : "";
150150
log.LogInformation($"Data Source Name: {datasource}");
151151
log.LogInformation($"User Id Name: {userId}");
152-
152+
153153
//create new password
154154
var randomPassword = CreateRandomPassword();
155155
log.LogInformation("New Password Generated");
156-
156+
157157
//Check db connection using existing secret
158158
CheckServiceConnection(secret);
159159
log.LogInformation("Service Connection Validated");
160-
160+
161161
//Create new secret with generated password
162162
CreateNewSecretVersion(client, secret, randomPassword);
163163
log.LogInformation("New Secret Version Generated");
164-
164+
165165
//Update db password
166166
UpdateServicePassword(secret, randomPassword);
167167
log.LogInformation("Password Changed");
@@ -177,7 +177,7 @@ https://github.com/jlichwa/azure-keyvault-basicrotation-tutorial/tree/master/rot
177177
1. Download function app zip file:
178178
https://github.com/jlichwa/azure-keyvault-basicrotation-tutorial/raw/master/simplerotationsample-fn.zip
179179

180-
1. Upload file simplerotationsample-fn.zip to Cloud Shell.
180+
1. Upload file simplerotationsample-fn.zip to Azure Cloud Shell.
181181

182182
1. Use below CLI command to deploy zip file to function app:
183183

@@ -188,17 +188,17 @@ az functionapp deployment source config-zip -g simplerotation -n simplerotation-
188188

189189
After deployment you should notice two functions under simplerotation-fn:
190190

191-
![Cloud Shell](./media/rotate5.png)
191+
![Azure Cloud Shell](./media/rotate5.png)
192192

193-
### Add event subscription for SecretNearExpiry event
193+
### Add event subscription for "SecretNearExpiry" event
194194

195195
Copy the function app eventgrid_extension key.
196196

197-
![Cloud Shell](./media/rotate6.png)
197+
![Azure Cloud Shell](./media/rotate6.png)
198198

199199
![Test and verify](./media/rotate7.png)
200200

201-
Use the copied eventgrid extension key and your subscription id in below command to create an event grid subscription for SecretNearExpiry events.
201+
Use the copied eventgrid extension key and your subscription ID in below command to create an event grid subscription for SecretNearExpiry events.
202202

203203
```azurecli
204204
az eventgrid event-subscription create --name simplerotation-eventsubscription --source-resource-id "/subscriptions/<subscription-id>/resourceGroups/simplerotation/providers/Microsoft.KeyVault/vaults/simplerotation-kv" --endpoint "https://simplerotation-fn.azurewebsites.net/runtime/webhooks/EventGrid?functionName=SimpleRotation&code=<extension-key>" --endpoint-type WebHook --included-event-types "Microsoft.KeyVault.SecretNearExpiry"
@@ -211,7 +211,7 @@ Set your access policy to give "manage secrets" permission to users.
211211
az keyvault set-policy --upn <email-address-of-user> --name simplerotation-kv --secret-permissions set delete get list
212212
```
213213

214-
Now create a new secret with tags containing sql database datasource and user id, with the expiration date set for tomorrow.
214+
Now create a new secret with tags containing sql database datasource and user ID, with the expiration date set for tomorrow.
215215

216216
```azurecli
217217
$tomorrowDate = (get-date).AddDays(+1).ToString("yyy-MM-ddThh:mm:ssZ")
@@ -236,12 +236,12 @@ Open the "sqluser" secret and view the original and rotated version
236236
To verify SQL credentials, create a web application. This web application will get the secret from key vault, extract sql database information and credentials from the secret, and test the connection to sql.
237237

238238
The web app requires below components and configuration:
239-
- Web App with System Managed Identity
239+
- Web App with System-Managed Identity
240240
- Access policy to access secrets in Key Vault using Web App Managed Identity
241241

242242
1. Click Azure template deployment link:
243243
<br><a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjlichwa%2Fazure-keyvault-basicrotation-tutorial%2Fmaster%2Farm-templates%2Fweb-app%2Fazuredeploy.json" target="_blank"> <img src="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.png"/></a>
244-
1. Select simplerotation resource group
244+
1. Select the **simplerotation** resource group
245245
1. Click Purchase
246246

247247
### Deploy Web App
@@ -251,7 +251,7 @@ For deployment of the web app, do the following:
251251

252252
1. Download the function app zip file from
253253
https://github.com/jlichwa/azure-keyvault-basicrotation-tutorial/raw/master/simplerotationsample-app.zip
254-
1. Upload the file "simplerotationsample-app.zip" to Cloud Shell.
254+
1. Upload the file `simplerotationsample-app.zip` to Azure Cloud Shell.
255255
1. Use this Azure CLI command to deploy the zip file to the function app:
256256

257257
```azurecli

0 commit comments

Comments
 (0)