Running Full Trust applications under Windows Azure.
July 12, 2009 by MK
Filed under ASP.NET, Hosting, web development
What is Windows Azure?
Microsoft’s Azure Services Platform is a cloud platform (cloud computing platform as a service) offering that “provides a wide range of Internet services that can be consumed from both on-premises environments or the Internet (though the platform itself will not be made available for on-premises deployments.
To read more about Azure please visit Microsoft’s Official Website on Azure Services Platform.
What is Full Trust and why is it required?
Full trust (CAS - Code Access Security Level) allows ASP.NET applications to execute native code, to read from the Registry and Windows Event Log, and to read and write to files outside of the application’s virtual directory. In short, with full trust one web application could delete the entire contents of another web application.
To read more on Full Trust Hosting please visit What is ASP.NET Full trust hosting?
Looking for good Full Trust Windows / ASP.NET Hosting Plans - Try Webhost4life OR Alentus (We have been using them for years now)
Windows Azure and Full Trust.
Windows Azure now offers the option of running the code in your Web and Worker roles under full trust. As a developer this opens up a lot of exciting and compelling options -
- Inter-process Communication via Named Pipes:
If you application spawns processes, you can communicate among them via named pipes.
- Invoking non-.NET Code:
Many developers have existing investments in native code or may choose to use native code for some specialized tasks. .NET full trust makes it possible to use native code via spawning processes or Platform Invoke (P/Invoke).
- Using .NET Libraries that Require Full Trust:
Certain .NET libraries, including libraries in the .NET Services SDK, require full trust and can now be used in Windows Azure.
To enable full trust, simply add the enableNativeCodeExecution attribute to your role in the Service Definition file and set the attribute value to true:
<?xml version=”1.0″ encoding=”utf-8″?>
<ServiceDefinition name=”MyService” xmlns=”http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition”>
<WebRole name=”WebRole” enableNativeCodeExecution=”true”>
<InputEndpoints>
<InputEndpoint name=”HttpIn” protocol=”http” port=”80″ />
</InputEndpoints>
</WebRole>
</ServiceDefinition>
Windows Azure applications run with restricted “User” privileges in the cloud. Accordingly, certain operations such as modifying the registry and writing to the system directory are not possible at this time (even though they may succeed in your local development environment). To read more on more on Custom Trust visit Why Full Trust hosting is not recommended when using a shared ASP.NET or shared Windows hosting plan?














