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/app-service/app-service-key-vault-references.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Alternatively:
85
85
86
86
## Rotation
87
87
88
-
If a version is not specified in the reference, then the app will use the latest version that exists in Key Vault. When newer versions become available, such as with a rotation event, the app will automatically update and begin using the latest version within one day. Any configuration changes made to the app will cause an immediate update to the latest versions of all referenced secrets.
88
+
If a version is not specified in the reference, then the app will use the latest version that exists in the key vault. When newer versions become available, such as with a rotation event, the app will automatically update and begin using the latest version within 24 hours. The delay is because App Service caches the values of the key vault references and re-fetches it every 24 hours. Any configuration changes to the app causes an immediate re-fetch of all referenced secrets.
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-networking-isolate-vnet.md
+29-25Lines changed: 29 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,14 @@ What you will learn:
32
32
33
33
The tutorial assumes that you have followed the [Tutorial: Secure Cognitive Service connection from App Service using Key Vault](tutorial-connect-msi-keyvault.md) and created the language detector app.
34
34
35
-
The tutorial continues to use the following environment variables. Make sure you set them properly.
35
+
The tutorial continues to use the following environment variables from the previous tutorial. Make sure you set them properly.
36
36
37
37
```azurecli-interactive
38
38
groupName=myKVResourceGroup
39
39
region=westeurope
40
40
csResourceName=<cs-resource-name>
41
41
appName=<app-name>
42
42
vaultName=<vault-name>
43
-
vaultResourceId=...
44
43
```
45
44
46
45
## Create VNet and subnets
@@ -95,46 +94,51 @@ Because your Key Vault and Cognitive Services resources will sit behind [private
95
94
1. In the private endpoint subnet of your VNet, create a private endpoint for your key vault.
# Save Cognitive Services resource ID in a variable for convenience
98
+
csResourceId=$(az cognitiveservices account show --resource-group $groupName --name $csResourceName --query id --output tsv)
100
99
101
-
> [!TIP]
102
-
> The `$vaultResourceId` variable is set in the [prerequisite](#prerequisites) tutorial (in [Secure back-end connectivity](tutorial-connect-msi-keyvault.md#secure-back-end-connectivity)).
1. Create a DNS zone group for the key vault private endpoint. DNS zone group is a link between the private DNS zone and the private endpoint. This link helps you to auto update the private DNS Zone when there is an update to the private endpoint.
103
+
1. Create a DNS zone group for the Cognitive Services private endpoint. DNS zone group is a link between the private DNS zone and the private endpoint. This link helps you to auto update the private DNS Zone when there is an update to the private endpoint.
1. Block public traffic to the key vault endpoint.
109
+
1. Block public traffic to the Cognitive Services resource.
111
110
112
111
```azurecli-interactive
113
-
az keyvault update --name $vaultName --default-action Deny
112
+
az rest --uri $csResourceId?api-version=2017-04-18 --method PATCH --body '{"properties":{"publicNetworkAccess":"Disabled"}}' --headers 'Content-Type=application/json'
114
113
```
115
114
116
-
1. Repeat the steps above for the Cognitive Services resource.
115
+
> [!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.
117
117
118
-
```azurecli-interactive
119
-
# Save Cognitive Services resource ID in a variable for convenience
120
-
csResourceId=$(az cognitiveservices account show --resource-group $groupName --name $csResourceName --query id --output tsv)
118
+
1. Repeat the steps above for the key vault.
121
119
122
-
# Create private endpoint for Cognitive Services resource
az keyvault update --name $vaultName --default-action Deny
128
128
```
129
129
130
-
> [!TIP]
131
-
> `$csResourceName` is set in the [prerequisite](#prerequisites) tutorial (in [Create app with connectivity to Cognitive Services](tutorial-connect-msi-keyvault.md#create-app-with-connectivity-to-Cognitive-Services)).
130
+
1. Force an immediate re-fetch of the [key vault references](app-service-key-vault-references.md) in your app by resetting the app settings (for more information, see [Rotation](app-service-key-vault-references.md#rotation)).
131
+
132
+
```azurecli-interactive
133
+
az webapp config appsettings set --resource-group $groupName --name $appName --settings CS_ACCOUNT_NAME="@Microsoft.KeyVault(SecretUri=$csResourceKVUri)" CS_ACCOUNT_KEY="@Microsoft.KeyVault(SecretUri=$csKeyKVUri)"
134
+
```
132
135
133
-
It may take some time for the setting to take effect, but all traffic to the key vault and the Cognitive Services resource are now blocked. If you try out the language detection page now, you'll get an HTTP 500 error.
136
+
<!-- If above is not run then it takes a whole day for references to update? https://docs.microsoft.com/en-us/azure/app-service/app-service-key-vault-references#rotation -->
134
137
135
-
<!-- TODO - This seems to take a long time to take effect. -->
138
+
> [!NOTE]
139
+
> Again, you can observe the behavior change in the sample app. You can no longer load the app because it can no longer access the key vault references. The app has lost its connectivity to the key vault through the shared networking.
136
140
137
-
These two endpoints are only accessible to clients inside the VNet you created. You can't even access the secrets in the key vault through **Secrets** page in the Azure portal, because the portal accesses them through the public internet (see [Manage the locked down resources](#manage-the-locked-down-resources)).
141
+
The two private endpoints are only accessible to clients inside the VNet you created. You can't even access the secrets in the key vault through **Secrets** page in the Azure portal, because the portal accesses them through the public internet (see [Manage the locked down resources](#manage-the-locked-down-resources)).
138
142
139
143
## Configure VNet integration in your app
140
144
@@ -156,7 +160,7 @@ These two endpoints are only accessible to clients inside the VNet you created.
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, set the [`WEBSITE_VNET_ROUTE_ALL` app setting](reference-app-settings.md#networking). 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).
163
+
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).
160
164
161
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.
0 commit comments