az-303,

How to configure Azure Storage Accounts to Allow Access from Specific Subnets

Sven Malvik Sven Malvik Connect Dec 25, 2020 · 3 mins read
How to configure Azure Storage Accounts to Allow Access from Specific Subnets

Sometimes we store items in a storage account and want to restrict the access to certain services or clients. I will demonstrate how to restrict the access to a subnet where a Windows Server 2016 Datacenter VM is running. Service Endpoints in Azure is part of the AZ-303 exam for becoming an Azure Solution Architect.

AZ-303: Service Endpoints in AzureWatch Service Endpoints in Azure in preparation for the AZ-303 exam

When we create an Azure Storage Account, and store items there, we can access them by using the URL that is provided to us. The traffic is then going over the internet. If we want to restrict the access to certain clients, we can route the traffic over the Azure backbone by using a service connection. It’s more secure and less latency.

Diagram of Service Endpoints in AzureDiagram of Service Endpoints in Azure

In preparation to this step-by-step guide, I already provisioned a few resources that we will need.

  • Storage Account with container and an image
  • Windows Server 2016 Datacenter Virtual Machine in VNet/subnet
  • Azure Bastion and Public IP address

Service Endpoint Resource OverviewService Endpoint Resource Overview

As you can see I have one image stored in the storage account.

Content of container in Azure Storage AccountContent of container in Azure Storage Account

To show you that the traffic is going over the internet for now, I create an URL with a SAS token as the containers access level is private per default.

Create URL with SAS token for item in container in Azure Storage AccountCreate URL with SAS token for item in container in Azure Storage Account

When pasting the URL into the browser of my workstation, you can see that it’s perfectly accessible.

Accessing item in container in Azure Storage Account from workstationAccessing item in container in Azure Storage Account from workstation

I’m now going to select Service endpoints in the virtual network of the Windows Server 2016 Datacenter VM.

Service endpoints menu in virtual networkService endpoints menu in virtual network

Click on Add to create a service endpoint and select the service Microsoft Storage and the subnet of the Windows Server 2016 Datacenter VM.

Adding a service endpoint to subnetAdding a service endpoint to subnet

After creating the service endpoint for the subnet, you should see an entry in the overview of Service Endpoints.

Overview of Service EndpointsOverview of Service Endpoints

We head now over to the storage account, and select Networking. As you see, there is no virtual network selected for now which means that the content isn’t restricted to a location yet. To change this we select networks.

Starting restricting access to networksStarting restricting access to networks

Now we can click on Add existing virtual network and select the subnet in which the VM is we would like to give access.

Restricting access to subnet for Azure Storage AccountRestricting access to subnet for Azure Storage Account

As we now have restricted the access to the Windows Server 2016 Datacenter VM, I am not longer allowed to access the content of the storage account from my own workstation.

No access to Azure Storage AccountNo access to Azure Storage Account

I use Azure Bastion to login to the Windows Server 2016 Datacenter VM.

Login to VM with Azure BastionLogin to VM with Azure Bastion

Vóila. We have access from the subnet where this VM is provisioned to.

Access to Azure Storage AccountAccess to Azure Storage Account

Join Newsletter
Get the latest updates right in your inbox. I never spam!
Sven Malvik
Written by Sven Malvik

Latest Stories

How To Manage Azure Virtual Machines

I will go through the first steps for managing Virtual Machines. We will create a Windows VM, start the Internet Information Service IIS,...

Dec 26, 2020

How to Use Azure Bastion as a Jump Host

Knowing about Azure Bastion is part of the AZ-303 exam for becoming an Azure Solution Architect. Bastion is very useful in cases where yo...

Dec 20, 2020

Serving Website Images from Azure CDN with SSL

In this post I will show you step by step how to serve images on a website from Azure CDN with SSL enabled. My blog has a couple of Azure...

Apr 25, 2020

AZ-303 Self-Study Guide for Becoming an Azure Solution Architect

Microsoft updated it’s role based exam for AZ-300. It’s now called AZ-303 and launched last year. This certification is a great proof for...

Feb 01, 2021

How to Establish a VPN Point to Site Connection in Azure

I will demonstrate how to establish a point to site connection in Azure, and connect from a Windows workstation to a virtual machine via ...

Dec 17, 2020

How to Create Custom Routes in Azure

Custom Routes, or user defined routing, is part of the az-303 certification for becoming an Azure Solution Architect. In this video I tel...

Dec 24, 2020

How to Peer Virtual Networks in Azure

When we have two services running in two different virtual networks, they cannot communicate. To fix this, both VNet’s have to be peered....

Dec 23, 2020

How to do a Failover of a Windows Server VM with Azure Site Recovery

In this post I will create a Windows Server 2016 Datacenter and then do an automatic failover to another region with Azure Site Recovery....

Jan 04, 2021

AZ-900 Self-Study Guide for Azure Fundamentals

There are many good reasons to become Microsoft Azure Certified and take the Microsoft Azure AZ-900 exam. If you are reading this blog po...

Feb 03, 2021

Event-Driven Infrastructure with App Configuration

Azure App Configuration is great for externalizing application configurations. But what if an application is our infrastructure? How coul...

Sep 12, 2020

How to Recover a Virtual Machine with Azure Backup Service

This episode is about the Azure Backup Service, and how we can restore a virtual machine. I have already a Windows Server 2016 Datacenter...

Dec 29, 2020

Latest Stories

How To Manage Azure Virtual Machines

How To Manage Azure Virtual Machines

I will go through the first steps for managing Virtual Machines. We will create a Windows VM, start the Internet Information Service IIS,...

Dec 26, 2020

How to Use Azure Bastion as a Jump Host

How to Use Azure Bastion as a Jump Host

Knowing about Azure Bastion is part of the AZ-303 exam for becoming an Azure Solution Architect. Bastion is very useful in cases where yo...

Dec 20, 2020

Serving Website Images from Azure CDN with SSL

Serving Website Images from Azure CDN with SSL

In this post I will show you step by step how to serve images on a website from Azure CDN with SSL enabled. My blog has a couple of Azure...

Apr 25, 2020

AZ-303 Self-Study Guide for Becoming an Azure Solution Architect

AZ-303 Self-Study Guide for Becoming an Azure Solution Architect

Microsoft updated it’s role based exam for AZ-300. It’s now called AZ-303 and launched last year. This certification is a great proof for...

Feb 01, 2021

How to Establish a VPN Point to Site Connection in Azure

How to Establish a VPN Point to Site Connection in Azure

I will demonstrate how to establish a point to site connection in Azure, and connect from a Windows workstation to a virtual machine via ...

Dec 17, 2020

How to Create Custom Routes in Azure

How to Create Custom Routes in Azure

Custom Routes, or user defined routing, is part of the az-303 certification for becoming an Azure Solution Architect. In this video I tel...

Dec 24, 2020

How to Peer Virtual Networks in Azure

How to Peer Virtual Networks in Azure

When we have two services running in two different virtual networks, they cannot communicate. To fix this, both VNet’s have to be peered....

Dec 23, 2020

How to do a Failover of a Windows Server VM with Azure Site Recovery

How to do a Failover of a Windows Server VM with Azure Site Recovery

In this post I will create a Windows Server 2016 Datacenter and then do an automatic failover to another region with Azure Site Recovery....

Jan 04, 2021

AZ-900 Self-Study Guide for Azure Fundamentals

AZ-900 Self-Study Guide for Azure Fundamentals

There are many good reasons to become Microsoft Azure Certified and take the Microsoft Azure AZ-900 exam. If you are reading this blog po...

Feb 03, 2021

Event-Driven Infrastructure with App Configuration

Event-Driven Infrastructure with App Configuration

Azure App Configuration is great for externalizing application configurations. But what if an application is our infrastructure? How coul...

Sep 12, 2020

How to Recover a Virtual Machine with Azure Backup Service

How to Recover a Virtual Machine with Azure Backup Service

This episode is about the Azure Backup Service, and how we can restore a virtual machine. I have already a Windows Server 2016 Datacenter...

Dec 29, 2020