Blog posts by Erik Lidälv2012-11-10T20:36:00.0000000Z/blogs/Erik-Lidalv/Optimizely WorldRunning EPiServer on Windows Azurehttp://erik.lidalv.se/2012/11/running-episerver-on-windows-azure.html2012-11-10T20:36:00.0000000ZNot long ago Microsoft released their IaaS on Windows Azure, making it possible to run Virtual Machines in the cloud. One of the biggest problems with running EPiServer on Azure has been the license model being bound to either MAC or IP address. Neither of these parameters have been possible to maintain persistent. Until now. :) With the introduction of Virtual Networks in Windows Azure we are now able to specify the internal IP addresses making it possible to run EPiServer on Azure without any license errors. This blog post shows you how to get EPiServer up and running in the cloud in no time!<br /><br />First of all, go and get a free Windows Azure trial here <a href="https://www.windowsazure.com/en-us/pricing/free-trial/" target="_blank">https://www.windowsazure.com/en-us/pricing/free-trial/</a>. Just sign in with your Microsoft account, add some more details and your done! Then navigate to the <a href="https://manage.windowsazure.com/#Workspace/All/dashboard" target="_blank">Portal</a>. The first thing you should do is to create the Virtual Network. This is done by navigating to the Networks section and clicking the "New" button and the bottom left corner.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-6zGC04fSJu4/UJ4igIBzqvI/AAAAAAAAADo/2rH-vpz5KJ4/s1600/7start_create_vn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-6zGC04fSJu4/UJ4igIBzqvI/AAAAAAAAADo/2rH-vpz5KJ4/s1600/7start_create_vn.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-Z3fT4Ivqg9I/UJ4jIwNW15I/AAAAAAAAADw/VRtHt5wIQCU/s1600/7.5create_VNET.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://1.bp.blogspot.com/-Z3fT4Ivqg9I/UJ4jIwNW15I/AAAAAAAAADw/VRtHt5wIQCU/s1600/7.5create_VNET.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Choose <i>Networks > Virtual Network > Custom Create</i>. This will open a three step wizard.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-i4dKGPU4M4s/UJ4jxI5BbCI/AAAAAAAAAD4/w8_qwc6r77k/s1600/8create_VNET_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-i4dKGPU4M4s/UJ4jxI5BbCI/AAAAAAAAAD4/w8_qwc6r77k/s1600/8create_VNET_1.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Step 1: Name your VNET and choose to create a new affinity group. Name that group as well.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/--CnGxJpSpD8/UJ4jxx6Kf3I/AAAAAAAAAEA/Y_og_g5h-GU/s1600/8create_VNET_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/--CnGxJpSpD8/UJ4jxx6Kf3I/AAAAAAAAAEA/Y_og_g5h-GU/s1600/8create_VNET_2.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Step 2: Enter address space and subnets. For simplicity you can use the same as I've entered in the screenshot above.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-qiJTOSdss2Y/UJ4jy2eflCI/AAAAAAAAAEE/mXF52PBdX9s/s1600/8create_VNET_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-qiJTOSdss2Y/UJ4jy2eflCI/AAAAAAAAAEE/mXF52PBdX9s/s1600/8create_VNET_3.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Step 3: DNS server. You can just leave this one empty and Windows Azure will fix it for you.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-h-axCSMOdMU/UJ4l87Lj7gI/AAAAAAAAAEQ/bhwoktzSQak/s1600/9created_VNET.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://3.bp.blogspot.com/-h-axCSMOdMU/UJ4l87Lj7gI/AAAAAAAAAEQ/bhwoktzSQak/s1600/9created_VNET.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Click the Complete button and the Virtual Network will be created! Simple as that.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Now we should create a storage to put the virtual machine in. Click the New button again and navigate to <i>Data Services > Storage > Quick create</i>.</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-Qxi26aajhBs/UJ4nPw6KMFI/AAAAAAAAAEY/4_KnOMUAo74/s1600/10create_storage_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-Qxi26aajhBs/UJ4nPw6KMFI/AAAAAAAAAEY/4_KnOMUAo74/s1600/10create_storage_1.png" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-vJWoxroVRgI/UJ4nQsKIDII/AAAAAAAAAEc/Kp-J6kvufyU/s1600/10create_storage_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-vJWoxroVRgI/UJ4nQsKIDII/AAAAAAAAAEc/Kp-J6kvufyU/s1600/10create_storage_2.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Enter a URL of your own choice and pick the previously created affinity group.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-JqKhVz17T6s/UJ4nRHilFVI/AAAAAAAAAEk/QjnTraGpbsQ/s1600/11created_storage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-JqKhVz17T6s/UJ4nRHilFVI/AAAAAAAAAEk/QjnTraGpbsQ/s1600/11created_storage.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">Click the Create Storage Account button and you're done! Now we should create the actual Virtual Machine and put in into the storage. Navigate to <i>New > Compute > Virtual Machine > From Gallery</i>.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-klYdiAhDty8/UJ4pBdfSdnI/AAAAAAAAAEw/PW1dtOtwXks/s1600/12create_vm_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-klYdiAhDty8/UJ4pBdfSdnI/AAAAAAAAAEw/PW1dtOtwXks/s1600/12create_vm_1.png" width="400" /></a></div> Step 1: Pick the operating system of your choice (Windows Server 2012 of course).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-6DSqrWSC-SE/UJ4pB1dLbaI/AAAAAAAAAE0/fpjPV21NPt4/s1600/12create_vm_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-6DSqrWSC-SE/UJ4pB1dLbaI/AAAAAAAAAE0/fpjPV21NPt4/s1600/12create_vm_2.png" width="400" /></a></div>Step 2: Enter some basic configuration.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-uz-N5MPPmm4/UJ4pCkbfWaI/AAAAAAAAAE8/VxctXP-N09g/s1600/12create_vm_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://3.bp.blogspot.com/-uz-N5MPPmm4/UJ4pCkbfWaI/AAAAAAAAAE8/VxctXP-N09g/s1600/12create_vm_3.png" width="400" /></a></div>Step 3: Enter a DNS name and select your storage account and VNET. Also make sure you're creating a standalone VM.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/--d97d_nEuMs/UJ4pDGof-PI/AAAAAAAAAFE/1cq-cUY76Go/s1600/12create_vm_4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://3.bp.blogspot.com/--d97d_nEuMs/UJ4pDGof-PI/AAAAAAAAAFE/1cq-cUY76Go/s1600/12create_vm_4.png" width="400" /></a></div>Step 4: Select your frontend subnet and click Create.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-XvkGTcLZjj0/UJ4qxpFP-iI/AAAAAAAAAFQ/GGdiGbhGBoY/s1600/13vm_started.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-XvkGTcLZjj0/UJ4qxpFP-iI/AAAAAAAAAFQ/GGdiGbhGBoY/s1600/13vm_started.png" width="400" /></a></div>The new Virtual machine is now created! You can click the Connect button at the bottom to access the VM using Remote desktop.<br /><br />And this is actually pretty much it! From now it's just an ordinary server installation. In my case I had to install the Web Server (IIS) Role, install MVC 4 and of course EPiServer CMS 7.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-v955ezCuz6Y/UJ4ryagoLlI/AAAAAAAAAFY/HXrcQgPmtYk/s1600/14install_IIS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://3.bp.blogspot.com/-v955ezCuz6Y/UJ4ryagoLlI/AAAAAAAAAFY/HXrcQgPmtYk/s1600/14install_IIS.png" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-FrAnK3Riytc/UJ4rzNwfNgI/AAAAAAAAAFc/wOFSHJ-mqP8/s1600/15check_ip.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://2.bp.blogspot.com/-FrAnK3Riytc/UJ4rzNwfNgI/AAAAAAAAAFc/wOFSHJ-mqP8/s1600/15check_ip.png" width="400" /></a></div>Run ipconfig /all and note the internal IP to get the correct license from EPiServer...<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-FDU2ABT_7Q4/UJ4rzx1En4I/AAAAAAAAAFk/zj3TUAtMun0/s1600/16site_up_running.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-FDU2ABT_7Q4/UJ4rzx1En4I/AAAAAAAAAFk/zj3TUAtMun0/s1600/16site_up_running.png" width="400" /></a></div> ...and we're done! :)<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-Cv6Qq1ao_VM/UJ4r0tpsjvI/AAAAAAAAAFs/iPKwilyeWgA/s1600/17view_ip_after_restart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://1.bp.blogspot.com/-Cv6Qq1ao_VM/UJ4r0tpsjvI/AAAAAAAAAFs/iPKwilyeWgA/s1600/17view_ip_after_restart.png" width="400" /></a></div>After a restart you can notice that the internal IP is still the same...<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-5-Q9dFrl_rY/UJ4r1ejJZZI/AAAAAAAAAF0/NfKQDcsySqk/s1600/18site_still_up_running.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://3.bp.blogspot.com/-5-Q9dFrl_rY/UJ4r1ejJZZI/AAAAAAAAAF0/NfKQDcsySqk/s1600/18site_still_up_running.png" width="400" /></a></div>...and that the site is still running.<br /><br />I think that this is really cool! We're now able to easily and really fast get a development/test/staging environment up and running without having to think about aspects of hardware at all. Instead of choosing a default VM from Microsoft it is possible to upload and use an image of your own, making it really fast to set up new development environments for new projects or project members.EPiServer cache invalidation over net.tcphttp://erik.lidalv.se/2012/11/episerver-cache-invalidation-over-nettcp.html2012-11-02T11:17:00.0000000ZI was recently struggling to get cache invalidation to work in EPiServer over net.tcp instead of UDP, which is default in EPiServer. There are a couple of good blog posts out there (for example http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/), and this post aims to clarify some aspects. I'm using EPiServer CMS 6 R2 on Windows Server 2008 R2 / IIS 7.5<br /><br />First of all I want to configure the use of port sharing. This config should be applyed to all three web.configs:<br /><pre class="language-xml"><code><!-- In all three web.configs --><br /><system.serviceModel> <br /> <bindings><br /> <netTcpBinding><br /> <binding name="RemoteEventsBinding"<br /> portSharingEnabled="true"><br /> <security mode="None" /><br /> </binding><br /> </netTcpBinding><br /> </bindings><br /></code></pre><br />Then I want to configure the site used by the editors ie. the site that should publish events of updates to the other server:<br /><br /><pre class="language-xml"><code><!-- web.config of the publisher site --><br /><system.serviceModel><br /> <client><br /> <endpoint name="WEBFRONT1"<br /> contract="EPiServer.Events.ServiceModel.IEventReplication"<br /> bindingConfiguration="RemoteEventsBinding"<br /> address="net.tcp://[SERVER1]/RemoteEventService1"<br /> binding="netTcpBinding" /><br /><br /> <endpoint name="WEBFRONT2"<br /> contract="EPiServer.Events.ServiceModel.IEventReplication"<br /> bindingConfiguration="RemoteEventsBinding"<br /> address="net.tcp://[SERVER2]/RemoteEventService2"<br /> binding="netTcpBinding" /><br /> </client> </code></pre><br />The other two servers do not need any client configuration for the cache invalidation to work. They however needs some endpoints:<br /><pre class="language-xml"><code><!-- web.config of WEBFRONT1 (subscriber) --><br /><services><br /> <service name="[EPiServerSiteIdWebFront1]/EPiServer.Events.Remote.EventReplication"<br /> behaviorConfiguration="DebugServiceBehaviour"><br /> <endpoint name="RemoteEventServiceEndPoint"<br /> contract="EPiServer.Events.ServiceModel.IEventReplication"<br /> bindingConfiguration="RemoteEventsBinding"<br /> address="net.tcp://localhost/RemoteEventService1"<br /> binding="netTcpBinding" /><br /> </service><br /></code></pre><br />and: <br /><pre class="language-xml"><code><!-- web.config of WEBFRONT2 (subscriber) --><br /><services><br /> <service name="[EPiServerSiteIdWebFront2]/EPiServer.Events.Remote.EventReplication"<br /> behaviorConfiguration="DebugServiceBehaviour"><br /> <endpoint name="RemoteEventServiceEndPoint"<br /> contract="EPiServer.Events.ServiceModel.IEventReplication"<br /> bindingConfiguration="RemoteEventsBinding"<br /> address="net.tcp://localhost/RemoteEventService2"<br /> binding="netTcpBinding" /><br /> </service><br /></code></pre><br /><span style="background-color: yellow;">[UPDATE: THIS IIS SECTION IS NOT NEEDED!]</span><br />And that's the only web.config needed! You do need to set two settings in the IIS of the to subscriber sites:<br />Site > Bindings...<br /><a href="http://1.bp.blogspot.com/-shPNRqW8Cf0/UJfiRamCSZI/AAAAAAAAAAs/xyR4qRfduJA/s1600/site_bindings.png" imageanchor="1"><img border="0" src="http://1.bp.blogspot.com/-shPNRqW8Cf0/UJfiRamCSZI/AAAAAAAAAAs/xyR4qRfduJA/s400/site_bindings.png" height="188" width="400" /></a><br /><br />Right-click the site in IIS > Manage Web Site > Advanced Settings... <br /><br /><a href="http://2.bp.blogspot.com/-I-s1SnHMSNI/UJfirqEeSLI/AAAAAAAAAA4/6kl01pxHpME/s1600/advanced_settings.png" imageanchor="1"><img border="0" src="http://2.bp.blogspot.com/-I-s1SnHMSNI/UJfirqEeSLI/AAAAAAAAAA4/6kl01pxHpME/s400/advanced_settings.png" height="225" width="400" /></a><br /><span style="background-color: yellow;">[END UPDATE] </span>