Wednesday, April 23, 2014

Microsoft Azure: Reducing Cost

If you plan to use IaaS make sure you have a sound monitoring strategy that you have reporting on the load and performance of your Virtual Machines.



 

As the above graph shows that the virtual machine is not used during the last 7 days. This is a very good candidate to look a little bit deeper into. After doing some root cause analysis it is a standard small vm running linux costing your company around € 33.25 / a month. If we would scale down this application from Standard to Basic we would save € 5.54 / month which would be a cost reduction of ~17%. Since it seems that this virtual machine is underutilized for most of the time (CPU anyways) we could scale it down from S to XS bring down the cost even further from € 27.71 to € 9.98 which would save us an additional 64 %. Doing this it would mean that we would bring down out monthly cost from €33.25 to € 9.98 saving us 70%.
If we would take it a step further we could investigate the type of application that is running on this serer and maybe migrate it to a PaaS solution bringing the cost even further down. In this case the VM was running a very simple website hosting this in a shared website we could even bring the cost further down to € 7.21 which would our bring our total savings to 92%.

The cloud is not only about up scaling it is all about optimizing cost! This means that if needed you can scale up and or out but it means you can scale down and in as well saving your company money. This is a very very simple example. But if you would closely analyze usage and optimize your scaling strategy, the potential cost savings can be quite significant. This was a case which I came across in my company, the figures are representative and taken from the Microsoft pricing calculator which can be found at: http://azure.microsoft.com/en-us/pricing/calculator/, not taken into account any EA reductions.

 


Monday, March 24, 2014

Sunday, February 23, 2014

Problem Running application in IISExpress in Visual Studio over SSL

I Currently set up an Azure VM to use as a development machine, I used MSDN's Default Visual Studio 2013 Image.

When I try to run my web application locally Internet Explorer gives me a "This page can't be displayed" error... firefox gives me "The connection was reset".
When browsing to the default non https port everything works as expected though...


so the solution:

1. uninstall iisexpress 8.0 (Control Panel > Uninstall a program)
2. mmc.exe, Add/Remove snapp-in, Certificates, select  Local Computer (Click Next), Finish
   here look under Personal, Certificates and delete the certificate Friendly Name = "IIS Express Development Certificate"
3. Reinstall IIS Express 8.0
4. following actions outlined in step 2. find the new "IIS Express Development Certificate", double click and goto details, find the thumbprint and copy the hash: ‎38 b3 05 a5 d2 1c ba 8b cb 45 fa 03 06 9a d4 b6 94 00 97 f9
5. remove the spaces from the hash: ‎38b305a5d21cba8bcb45fa03069ad4b6940097f9
open an elevated command prompt.
netsh http show sslcert > sslcert.txt

look for the entry matching your port. In my case it was this:
    IP:port                      : 0.0.0.0:44303
    Certificate Hash             : f5584bb1e88d4240d962bec7120e5a90302ff3b9
    Application ID               : {214124cd-d05b-4309-9af9-9caa44b2b74a}
    Certificate Store Name       : MY
    Verify Client Certificate Revocation : Enabled
    Verify Revocation Using Cached Client Certificate Only : Disabled
    Usage Check                  : Enabled
    Revocation Freshness Time    : 0
    URL Retrieval Timeout        : 0
    Ctl Identifier               : (null)
    Ctl Store Name               : (null)
    DS Mapper Usage              : Disabled
    Negotiate Client Certificate : Disabled


run:
netsh http delete sslcert ipport=0.0.0.0:44303
netsh http add sslcert ipport=0.0.0.0:44303 appid={214124cd-d05b-4309-9af9-9caa44b2b74a} certhash=38b305a5d21cba8bcb45fa03069ad4b6940097f9

references:
Hanselman's blog

Wednesday, February 19, 2014

Bootstrap: 404 Not Found on .woff files

When using bootstrap I got the following message in my firefox console:

"NetworkError: 404 Not Found - http://jellebens.azurewebsites.net/fonts/fontawesome-webfont.woff?v=4.0.3"

Add the following lines to your web.config

references:

  • http://ideasof.andersaberg.com/idea/23/quick-fix-iis-woff-font-file-404-not-found-in-aspnet-mvc



Friday, September 06, 2013

Windows Identity Framework Signing out

When using claims based security and you implement the sign out functionality do not forget to delete the sessions cookie... otherwise when playing around with the back button you are able to sign in again... this is something you don't want...


Loading ....

Monday, June 17, 2013

MVC: Intellisense for custom HtmlHelpers or if you want to avoid @using to import namespaces

If you write custom HtmlHelpers its quite tedious to have to add @using your.namespace.to.your.htmlHelpers on top of each page. To be able to use your newly written htmlhelpers

to avoid this just find the web.config in your views folder and locate the following section:
<system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
            <namespaces>
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization"/>
                <add namespace="System.Web.Routing" />
                <add namespace="SharpSolutions..MvcApplication.Helpers.BootStrap"/>
                <add namespace="SharpSolutions.MvcApplication.Helpers"/>
            </namespaces>
        </pages>
    </system.web.webPages.razor>

and add your custom namespace to it.

After you have done this reload your mvc project (or close Visual Studio and reopen it).

Tuesday, June 11, 2013

Windows Azure Logging not working Trace.TraceError throws: Not running in a hosted service or the Development Fabric.

I had the following line in my web.config:

<system.diagnostics>
    <trace>
      <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   name="AzureDiagnostics">
     <filter type="" />
    </add>
      </listeners>
    </trace>
  </system.diagnostics>

After removing this: it created WAWSAppLogTable as expected.
More info can be found here: www.windowsazure.com


for local debugging I left the line untouched... I created a new config transformation where I added:

<system.diagnostics>
  <trace>
   <listeners>
    <add name="AzureDiagnostics" xdt:Locator="Match(name)" xdt:Transform="Remove" />
   </listeners>
  </trace>
 </system.diagnostics>


Which is quite logic since Azure websites is not hosted in the AppFabrik

Friday, June 07, 2013

Team Foundation 2012: Run xUnit unit tests

Currently I am using https://tfs.visualstudio.com/ and writing my unit tests with xUnit. To enable this follow the steps outlined on MSDN.


You can find the binaries in the packages folder in your solution directory

Wednesday, December 19, 2012

Windows 8 RDP with blank password

If you want to enable Remote Desktop with a blank password on window 8, this is the same procedure as enabling rdp on windows 7 instructions can be found here

As a collegue suggested enabling this is a security risk.

Saturday, July 28, 2012

Migrating Legacy Applications

Legacy Systems

Legacy systems are systems that have grown over the years and became harder and harder to change and or are build on outdated technologies. Since business is changing rapidly these systems no longer can keep up the pace. Certainly in people that sell services products that are sold can be very complex, take for instance insurances.
Often these systems are the core of the systems, if these systems go down you the company looses money, in certain areas you can loose thousands of dollars per minute you are down.

Symptoms

Signs that tell you that your current system will become unstable can be:
  • Downtime
  • More and more bugs, regression
  • Implementing new features takes longer and longer
  • Solving bugs takes longer
  • Unable to scale up your system
  • Upstaffing of your operational team
More about these symptoms you can read about here.
Usually when you start experiencing the negatives effects of these systems your legacy system will need to be changed quite urgently.
These symptoms will result into an increased TCO. Keeping the system operational will become increasingly difficult since people that operate these systems become older, skills required will become very rare.

 

Approaches

There are several different approaches that can be taken to modernize your legacy system.
  • Garbage in-garbage out: for certain languages there are tools that convert your source code from one language to another like vb6 to vb .net, vb .net to c#
  • Big Bang Migration: full migration of a system, you rewrite your whole application at once and one magic day you put everything at once in production.
  • Incremental Migration: You partition your system in smaller subsystems and you put your system in production increment per increment.

 

Migration by tool

This approach can work if for instance you need to upgrade your system from one version to another. The biggest risk here is that when you do this you will not solve the fact that your software is difficult to adapt. It's an illusion that a system will be easier to adapt in a new technology than it was in the older one. What can be an added value of new technology is better development tools helping you with better support for refactoring to bring your system in a condition that is more suited to change and easier to change.
 

Big Bang Migration

This approach where you rewrite application from scratch and migrate your data from the old system to the new system. The biggest risk here is that when your project fails the entire project fails, the outcome becomes more unpredictable the bigger the project gets. The risk in this undertaking are generally huge and need to be assessed carefully.
This approach can be successful in projects that are quite small, your data is of high quality, you know your data structures and don't have a lot of dependencies on other systems.
There also is no guarantee that the new system you build will not start to show the same symptoms as your old one. If you do not put in place good programming techniques and adhere very strict quality guidelines the chance is big that the new system will become hard to change quite quickly.
Another downside is that business will not stop the evolve either you will be faced with the fact that you will need to implement old functionalities and in the mean time keep track of new developments also.
The cost is very high since you need to be operating your legacy system and in the meanwhile develop a new one which requires input from the people that are operating your legacy system which will have low availability due to the fact the need to keep the business afloat.
This approach is often chosen but often fails or costs enormous amounts of money.

Incremental Migration

When performing an incremental migration. You will have to divide your legacy system into smaller functional components and migrate each one step by step. The partitioning needs to be done just-in-time, enough to keep you busy.
The huge upside of this approach is that its the risks are highly controllable and that if something goes wrong the feedback is rapid and the impact of the failure is limited and predictable.
Another big advantage is also that you will be forced to build your system in such a way that is easily extended and changed.
The downside of this is that the people that operate your legacy system need to be actively involved with the new developments since they have indispensable knowledge about how the old system and the business operates, since they are responsible for operating the old system their availability might be quite limited. Combined with a significant increase in cost having to keep two teams.
It need to be taken in mind also that when doing an incremental modernization that every step you take needs to able to be rolled back so in the beginning this will require a significant effort to easily and rapidly deploy and rollback your changes.