Azure Databricks With existing DNS, Azure Networks & on-premises network

You can find a PowerShell script at my Automation repository to automatically create all required routes and a template csv with all IPs for West & East Europe Regions.

Link to GitHub: automation/DatabricksRoutes at master · proximagr/automation (github.com)

Script:

$location = ''
$routeTableRGName = ''
$routeTable = ''
$vnetRGName = ''
$vnetName = ''
$subnetName = ''
$subnetAddressPfx = ''
$routeTableName = ''
$dataBricksRouteName = ''
$routesPath = 'C:\...\routes.csv'
$i = 1


# Create or Get Azure Route Table
if ($routeTable = $null) {
    $routeTable = New-AzRouteTable -ResourceGroupName $routeTableRGName -Location $location -Name $routeTableName
    } else {
        $routeTable = Get-AzRouteTable -ResourceGroupName $routeTableRGName -Name $routeTableName
    }

# Create Routes
$routes = import-csv $routesPath
foreach ($route in $routes)
    {
        Add-AzRouteConfig -Name "$($dataBricksRouteName)-$($i)" -AddressPrefix $route.route -RouteTable $routeTable -NextHopType internet
        $i = $i+1
    }

# Commit the changes
Set-AzRouteTable -RouteTable $routeTable

# Associate the Route Table with Subnets
$vnet = Get-AzVirtualNetwork -ResourceGroupName $vnetRGName -Name $vnetName
Set-AzVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name $subnetName -AddressPrefix $subnetAddressPfx -RouteTable $routeTable

# Commit the changes
Set-AzVirtualNetwork -VirtualNetwork $vnet

Template CSV with West & North Europe Regions IPs:

route
52.232.19.246/32
20.38.84.81/32
23.97.201.41/32
40.127.147.196/32
20.73.215.48/28
51.138.96.158/32
52.138.224.7/32
52.138.224.6/32
52.239.137.164/32
20.60.246.65/32
20.150.26.228/32
20.150.104.100/32
52.239.138.100/32
52.236.40.36/32
20.150.104.4/32
20.150.76.228/32
52.239.141.36/32
13.69.64.0/32
52.169.18.8/32
104.40.169.187/32
13.69.105.208/32
20.60.223.36/32
20.60.222.107/32
20.150.122.36/32
52.239.242.196/32
20.60.26.196/32
20.60.223.68/32
20.60.222.129/32
20.150.74.100/32
20.150.122.68/32
52.239.141.68/32
20.60.196.33/32
20.60.250.196/32
20.38.108.228/32
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.