Skip to main content

How to use Azure file share in IIS Shared Configuration?

IIS Shared Configuration allows system administrators to use multiple IIS servers sharing the same configuration file. If you want to keep this configuration file in an Azure file share, there is a specific procedure you need to follow. Step-by-step procedure is in the Solution section below.

You can also try to use “Map network drive” feature in Windows File Explorer or the New-PSDrive command below. In my case, neither of these options provided a permanent solution.

New-PSDrive -Name Z -PSProvider FileSystem -Root "\\name.file.core.windows.net\sms-standard-storage" -Credential $credential -Persist -Scope global

If you are seeing too many requests from an Azure service in your IIS server, check this post out: IIS receives too many requests from the user-agent Edge+Health+Probe

Step-by-step instructions for using Azure file share in IIS Shared Configuration

Please use the steps below to link your Azure file share to your IIS.

  1. Go to your Azure dashboard
  2. Click “Storage accounts > name-of-the-storage > Access keys
  3. Copy the storage account name and key to notepad
  4. Login to the web server in which IIS is installed
  5. Run the command below to create a network share that will be used by IIS Shared Configuration
    net use * \\name.file.core.windows.net\sms-standard-storage /User:your-storage-account-name your-key
  6. Create a local user account in “Windows Server (Computer Management > Local Users and Groups > Users > Right click > New User)
  7. The user name should be exactly the same as your storage account name
  8. The password should be exactly the same as your storage account’s key
  9. Check “User cannot change password” and “Password never expires” options. Click OK
  10. Add this account to the IIS_IUSRS group (Computer Management > Local Users and Groups > Groups > IIS_IUSRS > Properties > Add)
  11. The rest of the steps are for setting up IIS Shared Configuration. Let me know please if you want to have detailed instructions (The article explains as well)
How to use Azure file share in IIS Shared Configuration?
Step 3: Copy storage account name and key

The main point is that creating a local user account that has the same username and password (key) as your storage account in Azure.

After configuring your application in Azure, you may run into a connection issue while trying to publish your application in Visual Studio. Check this post out for a solution: (Solved) Could not reach the Web Deploy endpoint on the specified virtual machine

Leave a Reply

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