Skip to content

Commit 95609bb

Browse files
committed
nits
1 parent 009229e commit 95609bb

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed
-46.7 KB
Loading

articles/app-service/tutorial-connect-msi-keyvault.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ Prepare your environment for the Azure CLI.
4848
az group create --name $groupName --location $region
4949
```
5050
51-
1. Create a Cognitive Services resource and get the subscription key (saved in the `csKey1` variable). Replace *\<cs-resource-name>* with a unique name of your choice.
51+
1. Create a Cognitive Services resource. Replace *\<cs-resource-name>* with a unique name of your choice.
5252
5353
```azurecli-interactive
5454
# Save resource name as variable for convenience.
5555
csResourceName=<cs-resource-name>
5656
5757
az cognitiveservices account create --resource-group $groupName --name $csResourceName --location $region --kind TextAnalytics --sku F0 --custom-domain $csResourceName
58-
csKey1=$(az cognitiveservices account keys list --resource-group $groupName --name $csResourceName --query key1 --output tsv)
5958
```
6059
6160
> [!NOTE]
@@ -80,7 +79,7 @@ Prepare your environment for the Azure CLI.
8079
8180
```azurecli-interactive
8281
# Clone and prepare sample application
83-
git clone git clone https://github.com/Azure-Samples/app-service-language-detector.git
82+
git clone https://github.com/Azure-Samples/app-service-language-detector.git
8483
cd app-service-language-detector/php
8584
zip default.zip index.php
8685
@@ -97,6 +96,9 @@ Prepare your environment for the Azure CLI.
9796
1. Configure the Cognitive Services secrets as app settings `CS_ACCOUNT_NAME` and `CS_ACCOUNT_KEY`.
9897
9998
```azurecli-interactive
99+
# Get subscription key for Cognitive Services resource
100+
csKey1=$(az cognitiveservices account keys list --resource-group $groupName --name $csResourceName --query key1 --output tsv)
101+
100102
az webapp config appsettings set --resource-group $groupName --name $appName --settings CS_ACCOUNT_NAME="$csResourceName" CS_ACCOUNT_KEY="$csKey1"
101103
````
102104

articles/app-service/tutorial-networking-isolate-vnet.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The tutorial continues to use the following environment variables from the previ
7373
7474
Because your Key Vault and Cognitive Services resources will sit behind [private endpoints](../private-link/private-endpoint-overview.md), you need to define [private DNS zones](../dns/private-dns-privatednszone.md) for them. These zones are used to host the DNS records for private endpoints and allow the clients to find the back-end services by name.
7575
76-
1. Create two private DNS zones, one of your key vault and one for your Cognitive Services resource.
76+
1. Create two private DNS zones, one one for your Cognitive Services resource and one for your key vault.
7777
7878
```azurecli-interactive
7979
az network private-dns zone create --resource-group $groupName --name privatelink.cognitiveservices.azure.com
@@ -94,7 +94,7 @@ Because your Key Vault and Cognitive Services resources will sit behind [private
9494
1. In the private endpoint subnet of your VNet, create a private endpoint for your key vault.
9595
9696
```azurecli-interactive
97-
# Save Cognitive Services resource ID in a variable for convenience
97+
# Get Cognitive Services resource ID
9898
csResourceId=$(az cognitiveservices account show --resource-group $groupName --name $csResourceName --query id --output tsv)
9999
100100
az network private-endpoint create --resource-group $groupName --name securecstext-pe --location $region --connection-name securecstext-pc --private-connection-resource-id $csResourceId --group-id account --vnet-name $vnetName --subnet private-endpoint-subnet
@@ -109,11 +109,14 @@ Because your Key Vault and Cognitive Services resources will sit behind [private
109109
1. Block public traffic to the Cognitive Services resource.
110110
111111
```azurecli-interactive
112-
az rest --uri $csResourceId?api-version=2017-04-18 --method PATCH --body '{"properties":{"publicNetworkAccess":"Disabled"}}' --headers 'Content-Type=application/json'
112+
az rest --uri $csResourceId?api-version=2021-04-30 --method PATCH --body '{"properties":{"publicNetworkAccess":"Disabled"}}' --headers 'Content-Type=application/json'
113+
114+
# Repeat following command until output is "Succeeded"
115+
az cognitiveservices account show --resource-group $groupName --name $csResourceName --query properties.provisioningState
113116
```
114117
115118
> [!NOTE]
116-
> Within a few minutes of you blocking public traffic, you can observe the behavior change in the sample app. You can still load the app, but if you try click the **Detect** button, you get an `HTTP 500` error. The app has lost its connectivity to the Cognitive Services resource through the shared networking.
119+
> Make sure the provisioning state of your change is `"Succeeded"`. Then you can observe the behavior change in the sample app. You can still load the app, but if you try click the **Detect** button, you get an `HTTP 500` error. The app has lost its connectivity to the Cognitive Services resource through the shared networking.
117120
118121
1. Repeat the steps above for the key vault.
119122
@@ -162,9 +165,7 @@ The two private endpoints are only accessible to clients inside the VNet you cre
162165
163166
VNet integration allows outbound traffic to flow directly into the VNet. By default, only local IP traffic defined in [RFC-1918](https://tools.ietf.org/html/rfc1918#section-3) is routed to the VNet, which is what you need for the private endpoints. To route all your traffic to the VNet, see [Manage virtual network integration routing](configure-vnet-integration-routing.md). Routing all traffic can also be used if you want to route internet traffic through your VNet e.g. through an [Azure VNet NAT](../virtual-network/nat-gateway/nat-overview.md) or an [Azure Firewall](../firewall/overview.md).
164167
165-
1. In the browser, navigate to `<app-name>.azurewebsites.net` again and wait for the integration to take effect. If you get detection results back, then you're connecting to the Cognitive Services endpoint with key vault references. If you get an HTTP 500 error, wait a few minutes and try again.
166-
167-
<!-- TODO - This seems to take a long time to take effect. -->
168+
1. In the browser, navigate to `<app-name>.azurewebsites.net` again and wait for the integration to take effect. If you get an HTTP 500 error, wait a few minutes and try again. If you can load the page and get detection results, then you're connecting to the Cognitive Services endpoint with key vault references.
168169
169170
## Manage the locked down resources
170171

0 commit comments

Comments
 (0)