{"id":869,"date":"2017-12-29T16:08:56","date_gmt":"2017-12-29T15:08:56","guid":{"rendered":"https:\/\/www.em-soft.si\/myblog\/elvis\/?p=869"},"modified":"2017-12-29T16:12:27","modified_gmt":"2017-12-29T15:12:27","slug":"installing-azure-file-sharing","status":"publish","type":"post","link":"https:\/\/em-soft.si\/myblog\/elvis\/?p=869","title":{"rendered":"Installing Azure File Sharing"},"content":{"rendered":"<p>Azure File Sharing (AFS) is a new technology, currently in public preview, used for caching files or syncing file servers or cluster around the datacentres. If you want to know more about useful scenarios where to use AFS, I suggest you to read <a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?p=842\">this blogpost<\/a> or <a href=\"https:\/\/www.youtube.com\/watch?v=Zm2w8-TRn-o\">watch this video<\/a>.<br \/>\nIn this post, I will explain how to install AFS on a server to be synchronized with Azure. I will go thru installation of the first server, but installing agent on the second or any other server is just the same process as for the first one. Of course, you must have an active Azure subscription (you can open a trial, but this will be time limited \u2013 maybe just for testing) and a supported server OS \u2013 Windows server 2012R2 or Windows Server 2016.<br \/>\nFirst step is done in Azure. Here we have to prepare the Storage account:<\/p>\n<ol>\n<li>Login to Azure portal<\/li>\n<li>On the Left side menu select <strong>+New<\/strong>, in Marketplace select <strong>Storage<\/strong> and then <strong>Storage account<\/strong> and click <strong>Create<\/strong>.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=873\" rel=\"attachment wp-att-873\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-873\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure1-287x300.png\" alt=\"\" width=\"287\" height=\"300\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure1-287x300.png 287w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure1-768x803.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure1.png 808w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/a><\/li>\n<li>Write the <strong>Name<\/strong> of the account, the <strong>Account kind<\/strong> MUST BE \u00bbGeneral purpose\u00ab and <strong>Replication<\/strong> \u00bbLocally-redundant storage (LRS)\u00ab. Set <strong>Storage Service encryption<\/strong> and <strong>Storage Transfer required<\/strong> to \u00bbTrue\u00ab.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=874\" rel=\"attachment wp-att-874\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-874\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure2-196x300.png\" alt=\"\" width=\"196\" height=\"300\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure2-196x300.png 196w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure2.png 543w\" sizes=\"auto, (max-width: 196px) 100vw, 196px\" \/><\/a><\/li>\n<li>You can create a new Resource group or use the existing one.<\/li>\n<li>Use one of the supported Locations. (<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/storage\/files\/storage-sync-files-planning\">list<\/a>)<\/li>\n<\/ol>\n<p>Now we have to create an Azure File Share:<\/p>\n<ol>\n<li>Navigate to Storage account that we have created previously<\/li>\n<li>In <strong>Overview<\/strong> find section <strong>Files<\/strong> and click on <strong>+ File Share<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=875\" rel=\"attachment wp-att-875\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-875\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure3-300x154.png\" alt=\"\" width=\"300\" height=\"154\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure3-300x154.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure3-768x394.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure3-1024x525.png 1024w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure3.png 1660w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/strong><\/li>\n<li>Write the <strong>Name<\/strong> and click <strong>Create<\/strong>.<\/li>\n<\/ol>\n<p>As last, we have to create Storage Sync Service:<\/p>\n<ol>\n<li>In Azure Portal, click on <strong>+New<\/strong>, in search box type \u00bb Azure File Sync\u00ab, select <strong>Azure File Sync (preview)<\/strong> and click <strong>Create<\/strong>.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=876\" rel=\"attachment wp-att-876\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-876\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure4-300x192.png\" alt=\"\" width=\"300\" height=\"192\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure4-300x192.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure4.png 540w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Fill all fields, use the same Resource group as in Storage account and click <strong>Create<\/strong>.<\/li>\n<\/ol>\n<p>For now, we have finished to prepare the Azure part and we will move to our on premises server. We will install Agent here and test prerequisites.<br \/>\nFirst, we have to find if our server has all that we need to install the agent:<\/p>\n<ol>\n<li>We will need PowerShell version 5.1 or higher. You can check this from PowerShell with cmdlet <em><strong>$PSVersionTable<\/strong><\/em>. If PSVersion is lower than 5.1, then you must upgrade PowerShell by installing <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=54616\">WMF 5.1 Package<\/a> (install <em><strong>Win8.1AndW2K12R2-KB3191564-x64.msu<\/strong><\/em>)<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=879\" rel=\"attachment wp-att-879\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-879\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell1-300x108.png\" alt=\"\" width=\"300\" height=\"108\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell1-300x108.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell1.png 443w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Install AzureRM cmdlets with installing PowerShell module: <em><strong>Install-Module AzureRM<\/strong><\/em> (Answer Yes to continue and to install from untrusted repository \u2013 it is a preview).<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=880\" rel=\"attachment wp-att-880\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-880\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell2-300x77.png\" alt=\"\" width=\"300\" height=\"77\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell2-300x77.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell2-768x197.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell2.png 841w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Register AFS provider: <em><strong>Register-AzureRmResourceProvider -ProviderNamespace Microsoft.StorageSync<\/strong><\/em>.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=881\" rel=\"attachment wp-att-881\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-881\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell3-300x48.png\" alt=\"\" width=\"300\" height=\"48\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell3-300x48.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell3-768x123.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell3.png 841w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> In case that you receive this error, run cmdlet <em><strong>Login-AzureRmAccount<\/strong><\/em>\u00a0<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=883\" rel=\"attachment wp-att-883\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-883\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell5-300x116.png\" alt=\"\" width=\"300\" height=\"116\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell5-300x116.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell5.png 405w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Disable Internet Explorer Enhanced Security Configuration (you should do this because you have to login into Azure later).<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=882\" rel=\"attachment wp-att-882\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-882\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell4-300x222.png\" alt=\"\" width=\"300\" height=\"222\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell4-300x222.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-PowerShell4.png 576w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<\/ol>\n<p>Now we will install the agent on the server that we want to sync:<\/p>\n<ol>\n<li>Download agent installation from Azure portal<\/li>\n<li>Run the installation wizard<\/li>\n<li>On a welcome page click <strong>Next<\/strong>, accept the license agreement and click <strong>Next<\/strong>.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=871\" rel=\"attachment wp-att-871\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-871\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent1-300x235.png\" alt=\"\" width=\"300\" height=\"235\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent1-300x235.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent1.png 495w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>On the Feature selection you can change the location for the files and click <strong>Next<\/strong><\/li>\n<li>Consider using Windows Update services to update the AFS agent (it is already a part of MS Updates) and click <strong>Next<\/strong><\/li>\n<li>Click<strong> Install<\/strong><\/li>\n<li>After the installation is finished, the server registration will run. If this will not happen or you want to run it manually later, you can search for file <strong>ServerRegistration.exe<\/strong> and run it.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=872\" rel=\"attachment wp-att-872\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-872\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent2-300x234.png\" alt=\"\" width=\"300\" height=\"234\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent2-300x234.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Agent2.png 497w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In Server Registration, sign in to Azure with your Azure subscription (this step will open an Internet Explorer window to sign in process)<\/li>\n<li>Select the needed data (Subscription \u2013 if you have more than one, Resource group that you used in previous steps and Sorage sync service that you created before)<\/li>\n<li>Click <strong>Register<\/strong>.<\/li>\n<li>After successful registration, you completed a server agent installation, server registration to AFS service.<\/li>\n<\/ol>\n<p>We have now created Storage Sync Service, installed agent on our server and registered our server to created Storage Sync Service, but we haven&#8217;t yet configured the synchronization between Azure and on premises servers \u2013 so synchronization is not working in this moment.<br \/>\nWe have to add Azure server as an endpoint in Sync Service. The easiest way to do this is in the Azure portal:<\/p>\n<ol>\n<li>Login to Azure portal<\/li>\n<li>Navigate to <strong>Storage Sync Service<\/strong> we created and in Overview click on <strong>+Sync group<\/strong>.<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=877\" rel=\"attachment wp-att-877\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-877\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure5-300x164.png\" alt=\"\" width=\"300\" height=\"164\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure5-300x164.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure5-768x419.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure5.png 806w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Type all data and click <strong>Create<\/strong>.<\/li>\n<li>Click on Sync group you created and add <strong>Server Endpoint<a href=\"https:\/\/em-soft.si\/myblog\/elvis\/?attachment_id=878\" rel=\"attachment wp-att-878\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-878\" src=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure6-300x82.png\" alt=\"\" width=\"300\" height=\"82\" srcset=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure6-300x82.png 300w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure6-768x209.png 768w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure6-1024x279.png 1024w, https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2017\/12\/AFS-Azure6.png 1681w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/strong><\/li>\n<li>When you are adding server Endpoint, you have to enter FULL LOCAL PATH on the server and the percent of free disk space on local server (can be different for any server).<\/li>\n<\/ol>\n<p>Done! You have now created Azure File sync and you have just to wait for the first sync. Of course, it can take some time \u2013 depends on the amount of data, but after this you will have all your files safe in Cloud. For this reason, you can use this service as a DR scenario.<br \/>\nIf you want to add an additional server to the same AFS service, just repeat all steps that were done on the local server and register it to existing AFS account. Different server scan host locally different files (depends on usage), can be member of different domains or workgroups \u2013 so you can use this technology for some collaboration projects as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure File Sharing (AFS) is a new technology, currently in public preview, used for caching files or syncing file servers or cluster around the datacentres. If you want to know more about useful scenarios where to use AFS, I suggest you to read this blogpost or watch this video. In this post, I will explain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[35],"class_list":["post-869","post","type-post","status-publish","format-standard","hentry","category-azure","tag-azure"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=869"}],"version-history":[{"count":2,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/869\/revisions"}],"predecessor-version":[{"id":887,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/869\/revisions\/887"}],"wp:attachment":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}