Skip to main content

Azure File (Day 21 or 31)

List of all posts from this series:

Short Description 
Azure File Storage is a shared storage for any kind of applications and systems. Is constructed over Azure Storage and is used to share data and files across applications components. Content from this repository can be accessed not only by applications using mounted shares but also via File Storage API.

Main Features 
Cloud applications and On-premises
The content from Azure File Storage can be accessed not only by virtual machines that are running on Azure, but also from On-premises system using sharing capabilities (over File Storage API).
SMB 2.1 Protocol
Azure File Storage support Service Message Protocol version 2.1 that can be used to access shared file from different networks nodes and system.  This protocol was introduced with Windows 7 and Windows Server 2008 R2 and is used worldwide for file sharing.
Simultaneously Shares
Multiple applications can connect to (mount) the same share in the same time. We are not limited to only one applications. SMB protocol handle a part of the locking headaches that appear with simultaneously read and write access.
Virtual Machine 
If you are using Azure File Storage, it is very simple to integrate this file sharing and mount it as a normal drive/directory. From the OS you will be able to access the files from it like normal files/folders. In this way you can share content to multiple virtual machines.
Because of SMB 2.1 protocol, it has full support from PowerShell. System administrators can manage and mount this storage directly from command line or PowerShell.
Azure Applications
All application hosted on Microsoft Azure can access the file storage like using simple I/O operations. Migrating application from normal storage to Azure Files is very simple and natural, with minimal integration costs.
A Share is like a container for files and directory. As base concept is the same share concept from SMB protocol. A Storage Account can have unlimited number of shares. Usually I compare a Share with the partition concept. It is not the same thing but is very similar in the way how files and director are grouped under the same root.
All shares can be accessed not only using SMB 2.1 protocol but also via REST API. This can be used with success by on-premises system that need to access this content.
Shares for Linux
Yes, there are some versions of Linux that support Azure File Storage. For example Ubuntu allow us to mount the shares.
Queue Storage give us multiple options when we talk about redundancy. By default we have redundancy at data center level – this mean that all the time there are 3 copies of the same content (and you pay only one). On top of this there are other 3 options of redundancy that I will describe below (plus the one that we already talk about):

  • LRS (Local Redundant Storage) – Content is replicate 3 times in the same data center (facility unit from region) 
  • GRS (Geo Redundant Storage) – Content is replicated 6 times across 2 regions (3 times in the same region and 3 times across different regions
Pay only what you use 
At the end of the month you will pay only the space that you used. Because of this, clients don’t pay in advance the space that will be used or to pay for the space that is not used anymore.


  • In this moment there is a capacity limit per share of 5TB (even if Azure Blobs can go to 500TB).
  • Maximum size of a file is 1TB.
  • Current IOPS speed limitation per share is 1K.
  • Maximum data transfer bandwidth per share is 60MB. 
  • SMB 2.1 protocol can be used to access content only from applications a system from the same region. For external application we need to use the REST API protocol.

Applicable Use Cases 
Below you can find some use cases when I would use Azure Files.
Audit and Diagnostics information
We can use Shares to write crash dump, logs and system metrics. In this way we can have a real time sharing mechanism between systems that create the audit and diagnostic content and the systems that analyze them.
Kits and Tools distribution
Azure File can be used as a place where we can share content to different machines and users. In this way we can have our tools shared cross machines without having copy/paste them or downloading them from a central repository.
Extend storage capabilities
On a normal VM or on-premises machine the storage capabilities are limited. On top of this there are times when you want to share the same content on multiple machines. For example a picture directory that you want to share with all the machines. Azure Files allow to do this, having content shared across the globe with multiple systems.

Code Sample 
// Get a reference to storage content
$ctx=New-AzureStorageContext fooAccount fooAccountKey
// Create a new share
$s = New-AzureStorageShare fooshare -Context $ctx
// Create a directory called car
New-AzureStorageDirectory -Share $s -Path car
// Upload a picture with a BMW
Set-AzureStorageFileContent -Share $s -Source C:\cars\bmw.jpg -Path car
// List all files and directories under car folder 
Get-AzureStorageFile -Share $s -Path car
// Download bmw.jpg picture on the local storage
Get-AzureStorageFileContent -Share $s -Path car/bmw.jpg -Destination C:\myCar
// Remove bmw.jpg pictures from our share
Remove-AzureStorageFile -Share $s -Path car/bmw.jpg 

Pros and Cons 

  • Maxim size of a file is 1TB.
  • SMB 2.1 support


  • Azure Emulator doesn’t support Azure Files in this moment.
  • No support for AD based authentication.   

When you start to calculate the cost of Azure Blob Storage you should take into account the following things:

  • Capacity (size) 
  • Number of Transactions 
  • Outbound traffic 
  • Traffic between facilities (data centers)

Azure Files can be used with success when you need to share content over multiple Virtual Machines. With support of SMB 2.1 it is a good option when you need to share a file on machines that are hosted on Azure.


Popular posts from this blog

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine:
threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration:

TeamCity.NET 4.51EF 6.0.2VS2013
It seems that there …

How to check in AngularJS if a service was register or not

There are cases when you need to check in a service or a controller was register in AngularJS.
For example a valid use case is when you have the same implementation running on multiple application. In this case, you may want to intercept the HTTP provider and add a custom step there. This step don’t needs to run on all the application, only in the one where the service exist and register.
A solution for this case would be to have a flag in the configuration that specify this. In the core you would have an IF that would check the value of this flag.
Another solution is to check if a specific service was register in AngularJS or not. If the service was register that you would execute your own logic.
To check if a service was register or not in AngularJS container you need to call the ‘has’ method of ‘inhector’. It will return TRUE if the service was register.
if ($injector.has('httpInterceptorService')) { $httpProvider.interceptors.push('httpInterceptorService&#…

Fundamental Books of a Software Engineer (version 2018)

More then six years ago I wrote a blog post about fundamental books that any software engineer (developer) should read. Now it is an excellent time to update this list with new entries.

There are 5 different categories of books, that represent the recommended path. For example, you start with Coding books, after that, you read books about Programming, Design and so on.
There are some books about C++ that I recommend not because you shall know C++, only because the concepts that you can learn from it.


Writing solid codeCode completeProgramming Pearls, more programming pearls(recommended)[NEW] Introduction to Algorithms


Refactoring (M. Fowler)Pragmatic ProgrammerClean code[NEW] Software Engineering: A Practitioner's Approach[NEW] The Mythical Man-Month[NEW] The Art of Computer Programming


Applying UML and Patterns (GRASP patterns)C++ coding standards (Sutter, Alexandrescu)The C++ programming language (Stroustrup, Part IV)Object-oriented programming (Peter Coad)P…