Skip to content

Commit cbaed9b

Browse files
Merge pull request #106132 from wmgries/files-refactor
Add private endpoint and DNS forwarding guidance for Azure Files
2 parents 20932be + d3eec33 commit cbaed9b

14 files changed

+838
-215
lines changed

articles/storage/files/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
href: storage-how-to-use-files-mac.md
9797
- name: Network
9898
items:
99+
- name: Configure Azure Files network endpoints
100+
href: storage-files-networking-endpoints.md
101+
- name: Configuring DNS forwarding for Azure Files
102+
href: storage-files-networking-dns.md
99103
- name: Configure Site-to-Site VPN
100104
href: storage-files-configure-s2s-vpn.md
101105
- name: Configure Point-to-Site VPN on Windows
84.9 KB
Loading
36.9 KB
Loading
47.2 KB
Loading
117 KB
Loading
119 KB
Loading

articles/storage/files/storage-files-configure-p2s-vpn-linux.md

Lines changed: 3 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ The article details the steps to configure a Point-to-Site VPN on Linux to mount
1919
## Prerequisites
2020
- The most recent version of the Azure CLI. For more information on how to install the Azure CLI, see [Install the Azure PowerShell CLI](https://docs.microsoft.com/cli/azure/install-azure-cli) and select your operating system. If you prefer to use the Azure PowerShell module on Linux, you may, however the instructions below are presented for Azure CLI.
2121

22-
- An Azure file share you would like to mount on-premises. You may use either a [standard](storage-how-to-create-file-share.md) or a [premium Azure file share](storage-how-to-create-premium-fileshare.md) with your Point-to-Site VPN.
22+
- An Azure file share you would like to mount on-premises. Azure file shares are deployed within storage accounts, which are management constructs that represent a shared pool of storage in which you can deploy multiple file shares, as well as other storage resources, such as blob containers or queues. You can learn more about how to deploy Azure file shares and storage accounts in [Create an Azure file share](storage-how-to-create-file-share.md).
23+
24+
- A private endpoint for the storage account containing the Azure file share you want to mount on-premises. To learn more about how to create a private endpoint, see [Configuring Azure Files network endpoints](storage-files-networking-endpoints.md?tabs=azure-cli).
2325

2426
## Install required software
2527
The Azure virtual network gateway can provide VPN connections using several VPN protocols, including IPsec and OpenVPN. This guide shows how to use IPsec and uses the strongSwan package to provide the support on Linux.
@@ -74,85 +76,6 @@ gatewaySubnet=$(az network vnet subnet create \
7476
--query "id" | tr -d '"')
7577
```
7678

77-
## Restrict the storage account to the virtual network
78-
By default when you create a storage account, you can access it from anywhere in the world as long as you have the means to authenticate your request (such as with your Active Directory identity or with the storage account key). To restrict access to this storage account to the virtual network you just created, you need to create a network rule set that allows access within the virtual network and denies all other access.
79-
80-
Restricting the storage account to the virtual network requires the use of a service endpoint. The service endpoint is a networking construct by which the public DNS/public IP can be accessed only from within the virtual network. Since the public IP address is not guaranteed to remain the same, we ultimately want to use a private endpoint rather than a service endpoint for the storage account, however it is not possible to restrict the storage account unless a service endpoint is also exposed.
81-
82-
Remember to replace `<storage-account-name>` with the storage account you want to access.
83-
84-
```bash
85-
storageAccountName="<storage-account-name>"
86-
87-
az storage account network-rule add \
88-
--resource-group $resourceGroupName \
89-
--account-name $storageAccountName \
90-
--subnet $serviceEndpointSubnet > /dev/null
91-
92-
az storage account update \
93-
--resource-group $resourceGroupName \
94-
--name $storageAccountName \
95-
--bypass "AzureServices" \
96-
--default-action "Deny" > /dev/null
97-
```
98-
99-
## Create a private endpoint (preview)
100-
Creating a private endpoint for your storage account gives your storage account an IP address within the IP address space of your virtual network. When you mount your Azure file share from on-premises using this private IP address, the routing rules autodefined by the VPN installation will route your mount request to the storage account via the VPN.
101-
102-
```bash
103-
zoneName="privatelink.file.core.windows.net"
104-
105-
storageAccount=$(az storage account show \
106-
--resource-group $resourceGroupName \
107-
--name $storageAccountName \
108-
--query "id" | tr -d '"')
109-
110-
az resource update \
111-
--ids $privateEndpointSubnet \
112-
--set properties.privateEndpointNetworkPolicies=Disabled > /dev/null
113-
114-
az network private-endpoint create \
115-
--resource-group $resourceGroupName \
116-
--name "$storageAccountName-PrivateEndpoint" \
117-
--location $region \
118-
--subnet $privateEndpointSubnet \
119-
--private-connection-resource-id $storageAccount \
120-
--group-ids "file" \
121-
--connection-name "privateEndpointConnection" > /dev/null
122-
123-
az network private-dns zone create \
124-
--resource-group $resourceGroupName \
125-
--name $zoneName > /dev/null
126-
127-
az network private-dns link vnet create \
128-
--resource-group $resourceGroupName \
129-
--zone-name $zoneName \
130-
--name "$virtualNetworkName-link" \
131-
--virtual-network $virtualNetworkName \
132-
--registration-enabled false > /dev/null
133-
134-
networkInterfaceId=$(az network private-endpoint show \
135-
--name "$storageAccountName-PrivateEndpoint" \
136-
--resource-group $resourceGroupName \
137-
--query 'networkInterfaces[0].id' | tr -d '"')
138-
139-
storageAccountPrivateIP=$(az resource show \
140-
--ids $networkInterfaceId \
141-
--api-version 2019-04-01 \
142-
--query "properties.ipConfigurations[0].properties.privateIPAddress" | tr -d '"')
143-
144-
fqdnQuery="properties.ipConfigurations[0].properties.privateLinkConnectionProperties.fqdns[0]"
145-
fqdn=$(az resource show \
146-
--ids $networkInterfaceId \
147-
--api-version 2019-04-01 \
148-
--query $fqdnQuery | tr -d '"')
149-
150-
az network private-dns record-set a create \
151-
--name $storageAccountName \
152-
--zone-name $zoneName \
153-
--resource-group $resourceGroupName > /dev/null
154-
```
155-
15679
## Create certificates for VPN authentication
15780
In order for VPN connections from your on-premises Linux machines to be authenticated to access your virtual network, you must create two certificates: a root certificate, which will be provided to the virtual machine gateway, and a client certificate, which will be signed with the root certificate. The following script creates the required certificates.
15881

articles/storage/files/storage-files-configure-p2s-vpn-windows.md

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,9 @@ The article details the steps to configure a Point-to-Site VPN on Windows (Windo
1919
## Prerequisites
2020
- The most recent version of the Azure PowerShell module. For more information on how to install the Azure PowerShell, see [Install the Azure PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps) and select your operating system. If you prefer to use the Azure CLI on Windows, you may, however the instructions below are presented for Azure PowerShell.
2121

22-
- The Azure Private DNS PowerShell module. This is not currently distributed as part of the Azure PowerShell module, so this may be installed with the following method:
23-
```PowerShell
24-
if ($PSVersionTable.PSVersion -ge [System.Version]::new(6, 0)) {
25-
Install-Module -Name Az.PrivateDns -AllowClobber -AllowPrerelease
26-
} else {
27-
Install-Module -Name Az.PrivateDns -RequiredVersion "0.1.3"
28-
}
29-
30-
Import-Module -Name Az.PrivateDns
31-
```
22+
- An Azure file share you would like to mount on-premises. Azure file shares are deployed within storage accounts, which are management constructs that represent a shared pool of storage in which you can deploy multiple file shares, as well as other storage resources, such as blob containers or queues. You can learn more about how to deploy Azure file shares and storage accounts in [Create an Azure file share](storage-how-to-create-file-share.md).
3223

33-
- An Azure file share you would like to mount on-premises. You may use either a [standard](storage-how-to-create-file-share.md) or a [premium Azure file share](storage-how-to-create-premium-fileshare.md) with your Point-to-Site VPN.
24+
- A private endpoint for the storage account containing the Azure file share you want to mount on-premises. To learn more about how to create a private endpoint, see [Configuring Azure Files network endpoints](storage-files-networking-endpoints.md?tabs=azure-powershell).
3425

3526
## Deploy a virtual network
3627
To access your Azure file share and other Azure resources from on-premises via a Point-to-Site VPN, you must create a virtual network, or VNet. The P2S VPN connection you will automatically create is a bridge between your on-premises Windows machine and this Azure virtual network.
@@ -82,91 +73,6 @@ $gatewaySubnet = $virtualNetwork.Subnets | `
8273
Where-Object { $_.Name -eq "GatewaySubnet" }
8374
```
8475

85-
## Restrict the storage account to the virtual network
86-
By default when you create a storage account, you can access it from anywhere in the world as long as you have the means to authenticate your request (such as with your Active Directory identity or with the storage account key). To restrict access to this storage account to the virtual network you just created, you need to create a network rule set that allows access within the virtual network and denies all other access.
87-
88-
Restricting the storage account to the virtual network requires the use of a service endpoint. The service endpoint is a networking construct by which the public DNS/public IP can be accessed only from within the virtual network. Since the public IP address is not guaranteed to remain the same, we ultimately want to use a private endpoint rather than a service endpoint for the storage account, however it is not possible to restrict the storage account unless a service endpoint is also exposed.
89-
90-
Remember to replace `<storage-account-name>` with the storage account you want to access.
91-
92-
```PowerShell
93-
$storageAccountName = "<storage-account-name>"
94-
95-
$storageAccount = Get-AzStorageAccount `
96-
-ResourceGroupName $resourceGroupName `
97-
-Name $storageAccountName
98-
99-
$networkRule = Add-AzStorageAccountNetworkRule `
100-
-ResourceGroupName $resourceGroupName `
101-
-Name $storageAccountName `
102-
-VirtualNetworkResourceId $serviceEndpointSubnet.Id
103-
104-
Update-AzStorageAccountNetworkRuleSet `
105-
-ResourceGroupName $resourceGroupName `
106-
-Name $storageAccountName `
107-
-Bypass AzureServices `
108-
-DefaultAction Deny `
109-
-VirtualNetworkRule $networkRule | Out-Null
110-
```
111-
112-
## Create a private endpoint (preview)
113-
Creating a private endpoint for your storage account gives your storage account an IP address within the IP address space of your virtual network. When you mount your Azure file share from on-premises using this private IP address, the routing rules autodefined by the VPN installation will route your mount request to the storage account via the VPN.
114-
115-
```PowerShell
116-
$internalVnet = Get-AzResource `
117-
-ResourceId $virtualNetwork.Id `
118-
-ApiVersion "2019-04-01"
119-
120-
$internalVnet.Properties.subnets[1].properties.privateEndpointNetworkPolicies = "Disabled"
121-
$internalVnet | Set-AzResource -Force | Out-Null
122-
123-
$privateEndpointConnection = New-AzPrivateLinkServiceConnection `
124-
-Name "myConnection" `
125-
-PrivateLinkServiceId $storageAccount.Id `
126-
-GroupId "file"
127-
128-
$privateEndpoint = New-AzPrivateEndpoint `
129-
-ResourceGroupName $resourceGroupName `
130-
-Name "$storageAccountName-privateEndpoint" `
131-
-Location $region `
132-
-Subnet $privateEndpointSubnet `
133-
-PrivateLinkServiceConnection $privateEndpointConnection
134-
135-
$zone = Get-AzPrivateDnsZone -ResourceGroupName $resourceGroupName
136-
if ($null -eq $zone) {
137-
$zone = New-AzPrivateDnsZone `
138-
-ResourceGroupName $resourceGroupName `
139-
-Name "privatelink.file.core.windows.net"
140-
} else {
141-
$zone = $zone[0]
142-
}
143-
144-
$link = New-AzPrivateDnsVirtualNetworkLink `
145-
-ResourceGroupName $resourceGroupName `
146-
-ZoneName $zone.Name `
147-
-Name ($virtualNetwork.Name + "-link") `
148-
-VirtualNetworkId $virtualNetwork.Id
149-
150-
$internalNic = Get-AzResource `
151-
-ResourceId $privateEndpoint.NetworkInterfaces[0].Id `
152-
-ApiVersion "2019-04-01"
153-
154-
foreach($ipconfig in $internalNic.Properties.ipConfigurations) {
155-
foreach($fqdn in $ipconfig.properties.privateLinkConnectionProperties.fqdns) {
156-
$recordName = $fqdn.split('.', 2)[0]
157-
$dnsZone = $fqdn.split('.', 2)[1]
158-
New-AzPrivateDnsRecordSet `
159-
-ResourceGroupName $resourceGroupName `
160-
-Name $recordName `
161-
-RecordType A `
162-
-ZoneName $zone.Name `
163-
-Ttl 600 `
164-
-PrivateDnsRecords (New-AzPrivateDnsRecordConfig `
165-
-IPv4Address $ipconfig.properties.privateIPAddress) | Out-Null
166-
}
167-
}
168-
```
169-
17076
## Create root certificate for VPN authentication
17177
In order for VPN connections from your on-premises Windows machines to be authenticated to access your virtual network, you must create two certificates: a root certificate, which will be provided to the virtual machine gateway, and a client certificate, which will be signed with the root certificate. The following PowerShell creates the root certificate; the client certificate will be created after the Azure virtual network gateway is created with information from the gateway.
17278

articles/storage/files/storage-files-configure-s2s-vpn.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ We strongly recommend that you read [Azure Files networking overview](storage-fi
1919
The article details the steps to configure a Site-to-Site VPN to mount Azure file shares directly on-premises. If you're looking to route sync traffic for Azure File Sync over a Site-to-Site VPN, please see [configuring Azure File Sync proxy and firewall settings](storage-sync-files-firewall-and-proxy.md).
2020

2121
## Prerequisites
22-
- An Azure file share you would like to mount on-premises. You may use either a [standard](storage-how-to-create-file-share.md) or a [premium Azure file share](storage-how-to-create-premium-fileshare.md) with your Site-to-Site VPN.
22+
- An Azure file share you would like to mount on-premises. Azure file shares are deployed within storage accounts, which are management constructs that represent a shared pool of storage in which you can deploy multiple file shares, as well as other storage resources, such as blob containers or queues. You can learn more about how to deploy Azure file shares and storage accounts in [Create an Azure file share](storage-how-to-create-file-share.md).
23+
24+
- A private endpoint for the storage account containing the Azure file share you want to mount on-premises. To learn more about how to create a private endpoint, see [Configuring Azure Files network endpoints](storage-files-networking-endpoints.md?tabs=azure-portal).
2325

2426
- A network appliance or server in your on-premises datacenter that is compatible with Azure VPN Gateway. Azure Files is agnostic of the on-premises network appliance chosen but Azure VPN Gateway maintains a [list of tested devices](../../vpn-gateway/vpn-gateway-about-vpn-devices.md). Different network appliances offer different features, performance characteristics, and management functionalities, so consider these when selecting a network appliance.
2527

@@ -71,23 +73,6 @@ Select **Create** to create the local network gateway resource.
7173
## Configure on-premises network appliance
7274
The specific steps to configure your on-premises network appliance depend based on the network appliance your organization has selected. Depending on the device your organization has chosen, the [list of tested devices](../../vpn-gateway/vpn-gateway-about-vpn-devices.md) may have a link out to your device vendor's instructions for configuring with Azure VPN Gateway.
7375

74-
## Create private endpoint (preview)
75-
Creating a private endpoint for your storage account gives your storage account an IP address within the IP address space of your virtual network. When you mount your Azure file share from on-premises using this private IP address, the routing rules autodefined by the VPN installation will route your mount request to the storage account via the VPN.
76-
77-
In the storage account blade, select **Private endpoint connections** in the left-hand table of contents and **+ Private endpoint** to create a new private endpoint. The resulting wizard has multiple pages to complete:
78-
79-
![A screenshot of the Basics section of the create private endpoint section](media/storage-files-configure-s2s-vpn/create-private-endpoint-1.png)
80-
81-
On the **Basics** tab, select the desired resource group, name, and region for your private endpoint. These can be whatever you want, they don't have to match the storage account in anyway, although you must create the private endpoint in the same region as the virtual network you wish to create the private endpoint in.
82-
83-
On the **Resource** tab, select the radio button for **Connect to an Azure resource in my directory**. Under **Resource type**, select **Microsoft.Storage/storageAccounts** for the resource type. The **Resource** field is the storage account with the Azure file share you wish to connect to. Target sub-resource is **file**, since this is for Azure Files.
84-
85-
The **Configuration** tab allows you to select the specific virtual network and subnet you would like to add your private endpoint to. Select the virtual network you created above. You must select a distinct subnet from the subnet you added your service endpoint to above.
86-
87-
The **Configuration** tab also allows you to set up a private DNS zone. This is not required, but allows you to use a friendly UNC path (such as `\\mystorageaccount.privatelink.file.core.windows.net\myshare`) instead of a UNC path with an IP address to mount the Azure file share. This may also be done with your own DNS servers within your virtual network.
88-
89-
Click **Review + create** to create the private endpoint. Once the private endpoint has been created, you will see two new resources: a private endpoint resource and a paired virtual network interface. The virtual network interface resource will have the dedicated private IP of the storage account.
90-
9176
## Create the Site-to-Site connection
9277
To complete the deployment of a S2S VPN, you must create a connection between your on-premises network appliance (represented by the local network gateway resource) and the VPN Gateway. To do this, navigate to the VPN Gateway you created above. In the table of contents for the VPN Gateway, select **Connections**, and click **Add**. The resulting **Add connection** pane requires the following fields:
9378

@@ -109,4 +94,4 @@ The final step in configuring a S2S VPN is verifying that it works for Azure Fil
10994
## See also
11095
- [Azure Files networking overview](storage-files-networking-overview.md)
11196
- [Configure a Point-to-Site (P2S) VPN on Windows for use with Azure Files](storage-files-configure-p2s-vpn-windows.md)
112-
- [Configure a Point-to-Site (P2S) VPN on Linux for use with Azure Files](storage-files-configure-p2s-vpn-linux.md)
97+
- [Configure a Point-to-Site (P2S) VPN on Linux for use with Azure Files](storage-files-configure-p2s-vpn-linux.md)

0 commit comments

Comments
 (0)