Saturday, October 26, 2019

Adding your Managed Instance Subnet in your storage Account's Network and Firewall settings

Hello Readers!

The below blog content is to highlight an azure limitation and a workaround to fix that till Azure came up with a direct solution for it. Its about enabling access for managed instance in the network and firewall settings of a storage account , if you are choosing the 'Public- Selected Networks ' configuration.

If you have noticed, when we add a particular VNet/Subnet to the settings, it will first enable service end points onto the subnet we are adding as the first step. This is not really possible for the dedicated subnet we create and maintain for Azure managed instances . As per design or existing configurations, managed instances' subnet can not have service end point enabled.

So how do we enable it?

There is a workaround for this limitation. 

We can find the managed endpoint IP address for the managed instances and whitelist that. It will be accepted in the network and firewall settings of the storage account , just like how we add a public IP to it. But the important part is having both your storage account and Managed instance in different Regions.

Below is how you do it.


Step1 : Finding the managed endpoint IP
Connect to Cloudshell (Powershell client embedded in the azure portal) or your own PowerShell client.

If you are logging in from your own Powershell client, make sure you have Az module installed by running the below commands and you are logged into your subscription.

Install-Module -Name Az #Installing Az module

connect-Azaccount #Logging into Azure subscription

resolve-dnsname 'xxxxx-mi1.xxxxx.database.windows.net' | select -first 1  | %{ resolve-dnsname $_.NameHost.Replace(".vnet","")}  #Finding the managed endpoint IP of your managed instance.

Please replace "xxxxx-mi1.xxxxx.database.windows.net" in the above script with the private endpoint URL of your managed instance which you get from the "Connection strings" of your managed instance in the Azure portal.

Managed endpoint address is common for all the instances in your MI subnet. 

Step2: Adding the IP into the firewall settings of the storage account.

This was covered in the bottom of my previous blog on storage account . Access it from here. 

May be in future, microsoft will come with a better solution which would support enabling service end point in MI Subnet. Let us all keep checking azure updates page 

Thats the end of this blog. Please follow if you are finding my blogs knowledgeable. If you do , you will receive notifications when I post something new here. Thanks for reading and Connecting ! 

No comments:

Post a Comment