Feb
19
Filed Under (Uncategorized) by jcisneros on 19-02-2010

Usually, when Windows Azure fails to initialize the services, the portal shows the services cycling between the Initializing, Busy and Stopping states and it gets stuck in an infinite loop between these states. The following list are the most common causes for a deployment to Windows Azure may fail (even if it works locally) and how to fix them:

  1. Missing referenced assemblies: set CopyLocal = True for referenced assemblies not in .NET Framework 3.5 or Microsoft.WindowsAzure.ServiceRuntime (these assemblies are the only ones present in Windows Azure).
    clip_image001
  2. Project built for 32bits only: Use Platform target = Any CPU (or x64). Windows Azure runs on 64 bits. 
    image
  3. Path too long: Use project names with less than 28 characters. Sometimes no exception is shown, to know if this is the issue, exclude all the roles but one from the Cloud Service project and run once each time to be able to view the error details in the output window when running on the Development Fabric. You should see the following error message “ERR: Failed to complete setup of assembly (hr = 0×8007006f)”.
  4. Missing files: Include all the used files in the project. Files that are not included are not published (for instance, images)

If you will perform a service upgrade, first suspend it. If you do not suspend the service and you perform an upgrade, it will never end. Apparently, it tries to return to the previous version state as part of the upgrade process, if our new version has the same issue (fails to initialize by iterating between the stopping to initializing states), it will get stuck in the middle of the process and you won’t be able to perform any action from the Azure portal, you cannot even delete the service. If this happened to you, you can try using the Azures Cmdlets to set the deployment status.

If you continue having issues, the following blog post includes more possible causes and suggestions:

Nov
03
Filed Under (Uncategorized) by jcisneros on 03-11-2008

These days we are seeing the dawn of a new computing generation, that is the 5th generation of computing. The first one were monolithic applications, then came the Client-Server and tiered applications, and currently we are building Web-based and SOA applications, today, the new buzzwords are Services and Cloud computing.

The past week, on PDC (Professional Developers Conference) event, Microsoft announced Windows Azure, a big initiative on the new computing generation. Windows Azure is a “cloud services operating system”, this is, a platform for developing, hosting and managing applications and services in the cloud. Being in the cloud, means that it is hosted on and available from internet, in this case, the hosting service is provided by Microsoft’s datacenters.

But that is not all, Windows Azure is just the lowest level of the Azure Services Platform, this platform includes several services running over Windows Azure, like:

  • Live Services: allows to create rich applications to run on a variety of platforms and devices.
  • .NET Services: includes:
    • Service Bus: provides a secure, standards-based messaging infrastructure to communicate application components even across organizational boundaries.
    • Workflow Service: hosts and runs workflows on the clouds and provides specialized activities for communication using HTTP and Service Bus.
    • Access Control: integrates standards-based identity providers, including enterprise directories and web identity systems such as Windows Live ID.
  • SQL Services: Stores data in the cloud using ACE structure (Authority, Container, Entity), the entities are flexibles and you can access the data using several standards-based interfaces (SOAP, REST, …).

Being part of this extraordinary family that we call Southworks, gave me the opportunity to learnt about these new technologies and participate in the development of a new set of Hands-On Labs about Azure Services Platform for the PDC event. For downloading this HOL go to: Azure Services Training Kit - PDC Preview.

For further reading:

 

Jun
22
Filed Under (.NET, Uncategorized) by jcisneros on 22-06-2008

PostSharp is a great open-source tool that allows you to encapsulate the non-business logic in custom attributes. That’s the Aspect Oriented Programming paradigm main goal: the separation of concerns.

This tool heps you to free the business logic from the infrastructure code such as:

  • Transactions
  • Logging
  • Permissions / Security
  • Exceptions handling
  • Caching
  • Settings

Your code will be cleaner than never.

…and why do I call it a “great tool”? Because, unlike other tools that uses reflection and other techniques that reduces performance, PostSharp works at MSIL level!. It generates MSIL code to be injected in your code at compilation time, in that way it supports any .NET language and get the best performance possible.

Furthermore, this tool is really easy to learn. You can quickly get started by using the basic features, follow this simple quick start:

The following example shows a simple PostSharp aspect to trace the execution of the methods marked with that attribute:

public class SimplestTraceAttribute : OnMethodBoundaryAspect
{
public
override void OnEntry( MethodExecutionEventArgs eventArgs)
{
Trace
.TraceInformation(“Entering {0}.”, eventArgs.Method);
Trace
.Indent();
}
public
override void OnExit( MethodExecutionEventArgs eventArgs)
{
Trace
.Unindent();
Trace
.TraceInformation(“Leaving {0}.”, eventArgs.Method);
}
}

…and it works like a charm!

The evidence:

Building the project:

Inspecting the binaries:

Results:

Resources:

Enjoy it!