Welcome to MSDN Blogs Sign in | Join | Help
Not too late to vote for your favorite new CloudApp()

Go to http://www.newcloudapp.com/vote.aspx to browse the apps and vote for a winner of the Azure Services Platform Developer Challenge. Voting ends June 29th for the US winner. (voting will open July 10th (submission deadline of July 9) for the international winner).

Lots of cool apps there, definitely worth a look -- all running on Windows Azure.

May CTP of the Windows Azure Tools and SDK - Now Supports Visual Studio 2010 Beta 1

Windows Azure Tools for Microsoft Visual Studio (includes SDK).  If the release is still propagating, try the Direct Link

New for the May 2009 CTP:

  • Support for Visual Studio 2010 Beta 1
  • Update for Visual Studio 2008
  • Improved integration with the Development Fabric and Storage services to improve the reliability of debug and run of Cloud Services from Visual Studio
  • Enhanced robustness and stability

Release notes/Known issues are available here

Visual Studio 2010 Beta 1 Support:

You can now use Visual Studio 2010 Beta 1 to build your Cloud Services.  There are a couple of interesting things to note however:

  • The Windows Azure Cloud does not yet support .Net Framework 4.0 – the tools will always create Web and Worker roles that target .Net Framework 3.5. They tools will complain if you try to build a Role project that targets .Net Framework 4.0
  • Visual Studio 2010 compatible samples are available here

image

 

Editing Role Properties

You can now use the Visual Studio Properties Window to edit some of the Role Properties like Enabling Full Trust and setting the instance count.

image

Feedback

As always – we love getting your feedback, you can email me off this blog, visit our Forum or enter a bug.

Adding an HTTPS Endpoint to a Windows Azure Cloud Service

Lately there has been a couple of threads on the forum and some internal email around setting up an https endpoint on a Windows Azure Cloud Service.

A good starting point is this article, but there are some common issues that people run into that I wanted to talk about.

First are the cert requirements. 

  • The certificate must contain a private key that is marked exportable
  • The certificate must have the Server Authentication Intended Purpose

When running on the Development Fabric, the certificate also needs to be self-signed – this is to prevent any security issues around leaking the private key of a real certificate.

Let’s walkthrough the steps to trying an https endpoint on the Development Fabric:

1) open the ServiceDefinition.csdef file in the CloudService project in Visual Studio and add a second InputEndpoint to the WebRole:

  <WebRole name="WebRole">
    <InputEndpoints>
      <InputEndpoint name="HttpIn" protocol="http" port="80" />
      <InputEndpoint name="HttpsIn" protocol="https" port="443" />
    </InputEndpoints>
  </WebRole>

2) If you have a self-signed certificate that meets the requirements above, you can skip ahead to step 9.  Otherwise, let’s use the IIS manager to create a self-signed certificate

3) Open the IIS Manager and select “Server Certifiates”

image

4) On the right side under “Actions”, select “Create Self-Signed Certificate…”

image

5) Follow the steps in the IIS Manager and you’ll have a new self-signed cert that supports Server Authentication and has an exportable private key.

6) The newly created cert will be put in the Personal store in the Local Computer location. Windows Azure Tools (including cspack) look for the certs in the Personal store in the Current User location (we needed to settle on a location and didn’t want it to be one that requires admin elevation).

7) To move the certs to the Current User location, you can run mmc, add the Certificates snap-in for both “My User Account” and “Computer Account” and drag and drop the certificates to the Personal store in the Current User location.  Alternatively, you can export and import.

8) If you ever export/import the cert, make sure you export the private key and on import mark the key as exportable:

image

9) Right click on the Cloud Service project in the VS Solution Explorer and click “Properties”.  Click on the SSL tab and check to Enable SSL Connections under Development and click “Select from Store…”. 

image

10) Select your certificate.  Hit F5 to run.

11) Navigate to the https endpoint -- the browser will complain as expected because you are using a self-signed certificate:

 image

12) To see the actual ports that were used for your service, you can bring up the Development Fabric UI (right click on the Development Fabric tray icon) and click on the Service Details for your Deployment:

image

13) When you are ready to publish to the real cloud, use the SSL Cloud Service settings to select a certificate for Publish – this is the certificate that is used when publishing for deployment.

Troubleshooting

  • If you see the error “Role start failed for one or more roles” when specifying an https endpoint, most likely this is because you are trying to use a certificate that does not have an exportable private key.
  • If you see the error “can't locate service descriptions”, most likely this is because you attempted to use a non self-signed certificate when running on the Development Fabric.
Azure Services Platform Developer Challenge

Azure Services Platform Developer Challenge!

Everything you need to know from a page hosted on Windows Azure: http://www.newcloudapp.com/

Couple things to point out:

  • There are 3 categories .Net Applications ($5000 prize), PHP Applications ($5000 prize)  and a Community Winner ($2500 prize)
  • Submission dealine is June 18, 2009
  • More info here and here

Pretty cool contest, can't wait to see the kinds of apps that get built -- Start your engines!

 

Windows Azure Geo-Location is Live

Back at Mix ‘09, we announced that Windows Azure will have support for specifying which geographical region you want your Cloud Service to run.

If you now go to create a new Hosted Service on the Azure Services Developer Portal, you will be presented with an option to put the service in an Affinity Group and select the region for that Affinity Group.

image

You will then see the Affinity Group listed on the summary page for your Hosted Service Project.

When you go to create another project, be it a Hosted Service or Storage Account, you can choose to put that storage account in an existing Affinity Group, this will geographically co-locate your compute and/or storage projects.

image

From the announcement referenced above:

Accounts inside an affinity group will be dealt with as one unit and placed together for connectivity. For example, if you create an affinity group placed in North Western United States and place multiple storage accounts and hosted services in there, we’ll allocate these together in that geographical region, so that all of the accounts will be close together from a network perspective

Pretty cool stuff, especially when data centers in more locations come online.

The Easy Way to Install the Windows Azure Tools and SDK Pre-Requisites

One of the first things I do when I get a new box is install the Windows Azure Tools and SDK. (don’t you?)

Quite often, I forget to install and configure IIS7 – and receive the following message:

image

The Windows Azure SDK requires Internet Information Service 7.0 with ASP.Net Application Development components installed.

So how do I install IIS and the required components? 

You could follow the instructions buried on the download page… or you can use the Microsoft Platform installer which is a heck of a lot easier.  Let’s see how that would work.

1. Navigate to http://microsoft.com/web and click on “Get the Microsoft Web Platform”

image

At the time of this writing, there is a v1.0 and v2.0 beta you can try.  We’ll show the 2.0 beta although you could use either.

2. Click on the download button.

3. Click on the Web Platform tab and customize the Web Server option with: ASP.Net, Default Document and CGI (if you want to run fastCGI apps) and any other features you want to add. 

image

4. You can also click to add a database (SQL Express) if you need it and tools – including the free Visual Web Developer Express which our Windows Azure Tools support.

5. Click “Install” when you are ready. You’ll get an opportunity to review your selection, then the download and install will commence.

6. Install a few hot fixes manually:

  • Install the Hotfix: Native Debugging Improvements
  • Install the Hotfix: Support for FastCGI on the Development Fabric
  • Install the Hotfix: Improve Visual Studio Stability

    7. Finally, if you are using WCF, you will want to install WCF HTTP Activation. (this is a .Net feature)

  • On Vista: From the Start menu, choose Settings | Control Panel | Programs | Programs and Features, Click Turn “windows Features On or Off”, under Microsoft .Net Framework 3.0, select WCF HTTP Activation

    On Windows Server 2008 – In Server Manager under Features Summary, choose Add Features – under .Net Framework 3.0 Features, select WCF Activation.

    8. Install the Windows Azure Tools

    This is the way I setup my new machines nowadays, just so much easier and I get all of the other web frameworks (like MVC and Silverlight) at the same time. 

    Digging in to the Windows Azure Service Package

    What is the Service Package?  It is what contains the Service Definition for your Cloud Service along with the content and binaries for each of the roles.

    It comes in 2 flavors.  The first being a folder structure with the extension csx.  For example if you look in the output folder of the Cloud Service project (bin\debug or bin\release) you will see the following:

    image

    Where the highlighted CloudService6.csx file is the folder structure version of the Service Package – the Service Definition file is located there.

    The Service Configuration file is kept separate to the Service Package as it can be updated independently of the Service Package, for example to update setting values or increase/decrease the number of instance of each of your roles.

    The folder version of the Service Package is the output of the Cloud Service project.  This is what is used to run the Cloud Service on the Development Fabric.

    If you look in the WebRole and WorkerRole directories, you will see the content and binaries that will be used to run your roles.

    The second flavor of the Service Package is the single file version (cspkg file extension), which is created when you publish the Cloud Service by right-clicking on the Cloud Service project and selecting “Publish…”

    image

    This is the file that you upload (along with the Service Configuration file) to the Windows Azure cloud to run your service.

    image 

     

    The single file package is found in the Publish folder of the output directory of the Cloud Service project along with the Service Configuration file:

    image

    This is the directory that VS automatically opens up when you publish from the Cloud Service.

    It is interesting to know about these two flavors of Service Packages so that you can know where to look to see what files are being packaged up and executed by the Development Fabric locally and/or Fabric in the cloud. 

    The single file Service Package is zipped and encrypted so you won’t be able to browse through it unless you set an environment variable to package without encryption.

    Note:  The steps to create an unencrypted package are for diagnostic purposes only and should not be used for production packages.  Additionally, the method is only intended for internal use, is not supported and may be changed at any time.  (enough of a disclaimer? :) )

    With Visual Studio closed, create a new environment variable called: _CSPACK_FORCE_NOENCRYPT_ set the value to true.  This will look like this:

    image

    You can access the environment variables dialog from the advanced tab on the System Properties from the Advanced system settings task button on the left of: Control Panel\System and Maintenance\System.

    Now startup Visual Studio, load a Cloud Service project and hit publish.  When you publish, you will see the following message in the output window:

    C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets(0,0): warning : CloudServices44 : Forcing creation of unencrypted package.

    Now, you can unzip your way through the single file Service Package.  Rename the service package to .zip and unzip.

    Inside the first directory you can unzip the WebRole_*.cssx and WorkerRole_*.cssx files to reveal your worker and web role directories.

    One thing to mention here is that you can deploy both unencrypted and encrypted versions of the Service Package to Windows Azure, although I'll reiterate that you should really only deploy the encrypted version of your package.

    Hope this helps with diagnostic and debugging type activities – we are thinking about how we can make this easier in the tools.

    iisfcgi.dll is not up-to-date?

    If you are trying a FastCGI application on Windows Azure and see the following message:

    CCT: Error: FastCGI module at C:\Windows\system32\inetsrv\iisfcgi.dll with version 7.0.6001.22229 is not up-to-date.
    CCT: The system is missing a prerequisite to execute the service. Please see the release notes.

     

    You are missing the following QFE: http://support.microsoft.com/kb/967131

     

    We'll definitely improve the message -- just wanted to get some more help out there for any of you that run into this.

    Windows Azure Mix Videos

    If you weren't able to make it to MIX09, you can catch videos of the sessions.

    My session is available for watching here: Using the Windows Azure Tools for Microsoft Visual Studio to Build Cloud Services

    If you haven't seen the keynotes, I highly recommend that you see them, lots of awesome announcements and they are pretty darn entertaining too.

    You can also catch the other Azure related sessions.

    Here's the list of Windows Azure sessions:

    Lots of great information available, hope you enjoy.

    Updated Release Notes for the Windows Azure Tools March 2009 CTP

    Update: We've refreshed the release and this new release resolves these issues.  See here for more information.

    We recently helped out a couple of folks on the Windows Azure Forum and felt it would be useful to post some information about two issues we’ve been seeing in the March 2009 CTP.

    Issue: Visual Studio closes unexpectedly when launching Help | About or creating a Cloud Service in some non ENU Operating Systems.

    Workaround: Modify (you might have to add it if it's not there) the value of the following key to "False":

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Cloud Computing Tools\Update Notification\AutomaticUpdatesEnabled="False"

    Issue: if you specify the SQL instance to use for the Development Storage (through the DSInit command line utility in the SDK), the “Create Test Storage Tables” command will fail. 

    Workaround: Please replace the Microsoft.CloudService.targets file with the file attached to this blog post

    This is useful for people that wish to use a different SQL Server instance other than SQL Server Express.

    You can find the Microsoft.CloudService.Targets file to replace in your C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\v1.0 directory. 

    Hope this helps, stay tuned for more information.

    Walkthrough: Enabling Full Trust to Call Native Code on Windows Azure

    One of the cool new features in the Windows Azure Mix 09 CTP is the ability to run your Web and/or Worker Roles in full trust (non-admin).  This opens up all kinds of features that weren’t available in the previous CTPs.

    An interesting feature, which is the subject of this post is the ability to make PInvoke calls.

    One of the things I have noticed in playing with calling native code is that you have to be more aware of the actual environment in the cloud.  For example, Windows Azure in the cloud:

    • Runs your Cloud Services on an x64 Operating System.  The processes in which your role instances run are 64-bit processes.
    • Has the .Net Framework 3.5 SP1 redistributable installed, which includes a subset of the full Microsoft Visual C++ 2008 Redistributable (x64)

    I also want to reiterate here that your Role Instances run in separate VMs and those VMs can come and go – it’s important not to count on any file system persistence in the VM.

    1. Create a new Web Cloud Service project.  File | New | Project.  Select Visual C#/VB | Cloud Services | Web Cloud Services

    image

    2. Add a project to your solution for your native code. Right click on the Solution Explorer and select Add | New Project…

    image

    3. Select “Win32 Project” and call it “NativeCalc”

    image

    Setup the win32 project to be a DLL – we’ll just call a simple C function from it. Select “Export symbols”.

    image

    3. Open NativeCalc.h and change the dummy fnNativeCalc function to:

    extern "C"
    {
        NATIVECALC_API int AddNumbers(int left, int right);
    }

    Note that the extern “C” specifies to use C linkage convention – what you see for the exported symbol if you used dumpbin – instead of the C++ decorations.  This is what PInvoke will look for.

    4. Now implement the method in NativeCalc.cpp

    NATIVECALC_API int AddNumbers(int left, int right)
    {
        return left + right;
    }

    5. Next we have to ensure that this DLL is included as part of the Service Package.  See this post for more details. 

    First I set the output directory of the DLL to be in the Web Role project directory. 

    image

    I build all then right click on the nativeCloudService_WebRole project in Solution Explorer and select Add | Existing Item | NativeCalc.dll

    image

    I then set the CopyToOutputDirectory property to “CopyIfnewer”

    image

    6. Add a button and a label on default.aspx and in the button handler, set the label to the output of the native call:

    [DllImport("NativeCalc.dll")]
    static extern int AddNumbers(int left, int right);
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = AddNumbers(2, 3).ToString();
    }

    7. Set the enableNativeExecution attribute on the WebRole in the ServiceDefinition.csdef

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="NativeCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
      <WebRole name="WebRole" enableNativeCodeExecution="true">
        <InputEndpoints>

    8. Run the application and hit the button – everything will work as expected – you just called native code running on Windows Azure!

    9. If you want to publish and deploy this to the Cloud – make sure that the native DLL is being built in release mode and is built for x64.  See the troubleshooting section below for more details.

    Troubleshooting:

    Small troubleshooting section:

    • If you run and get a SecurityException, you forgot to set the enableNativeCodeExecution attribute to true.
    • Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
      Exception Details: System.Security.SecurityException: System.Security.Permissions.SecurityPermission

    When trying in the Cloud:

    • If you get an exception: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) 
    • You are trying to PInvoke to a 32-Bit DLL instead of a 64-bit DLL.  Remember what I said above: Windows Azure runs your Cloud Service on a 64 Bit Operating System. 
    • You can solve this by building your DLL for x64.  Otherwise, you’ll have to launch a 32-bit process that can make calls into your 32 Bit DLL.

    image

    • If you get an exception: Unable to load DLL <DLL>: The application failed to start because its side-by-side configuration is incorrect.  Please see the application event log for more detail. (Exception from HRESULT: 0x80073681). 
    • This could be many things, the most likely one is that you are missing a Visual C++ runtime dll on Windows Azure. 
    • The most common situation is if you uploaded a debug version of your native code dll – it uses the debug version of the VC++ runtime which has a different name and isn’t available on Windows Azure.  To solve this, either build release or deploy any necessary dlls with your Service Package.

    clip_image002

    Compiling for x64 in Visual Studio related:

    • To configure VS to build your NativeCalc DLL as x64, use the Configuration Manager and change the platform to x64. (notable if you are using a 32 bit Operating System)

    image

    • In order to be able to compile for x64, you may have to install the x64 compiler.  You can do this by going to Add/Remove programs, selecting Visual Studio and adding the “X64 Compiler and Tools” option

    image

    Now available: March CTP of the Windows Azure Tools and SDK

    New release of the Windows Azure SDK and Tools!

    From now on, you only have to download the Windows Azure Tools for Microsoft Visual Studio and the SDK will be installed as part of that package.

    Windows Azure Tools for Microsoft Visual Studio (please give time for propagation or use the direct link to the download)

    In a nutshell, you can now run managed code Full Trust and if you want to give fastCGI applications on Windows Azure a try, you can do that too!

    Please install the following hotfixes:

  • Hotfix: Native Debugging Improvements
  • Hotfix: Support for FastCGI on the Development Fabric
  • What’s new in Windows Azure SDK

    • Support for developing Managed Full Trust applications. It also provides support for Native Code via PInvokes and spawning native processes.
    • Support for developing FastCGI applications, including support for rewrite rules via URL Rewrite Module.
    • Improved support for the integration of development storage with Visual Studio, including enhanced performance and support for SQL Server (only local instance). 

    What’s new in Windows Azure Tools for Visual Studio

    • Combined installer includes the Windows Azure SDK
    • Addressed top customer bugs.
    • Native Code Debugging.
    • Update Notification of future releases.
    • FastCGI template
    Updates to Windows Azure MVC Cloud Service for MVC RC2

    ASP.Net MVC RC2 released a few days back and I've already gotten a number of requests to update the MVC on Windows Azure samples since they were getting a little stale.

    I updated my posts on MVC and I also added more detail to the original "MVC on Windows Azure" post by making it a walkthrough -- hopefully it will be easy for you to duplicate the steps on your projects.

    Also note that we've released a hotfix that will solve stability issues when using MVC with the Windows Azure Tools.

    Windows Azure Tools session at Mix '09 - Come on down!

    For those of you who are attending Mix '09, it'd be great if you could come check out my tools talk on Windows Azure: https://content.visitmix.com/2009/Speakers/ (click on "Azure")

    MIX09-T81M Using the Windows Azure Tools for Microsoft Visual Studio to Build Cloud Services
    Friday March 20 |9:25 AM-9:45 AM | San Polo 3401
    By: Jim Nakashima  Tags: ASP.NET | Azure
    Come hear how to use the Windows Azure Tools for Visual Studio to more easily create, build, debug, deploy, run and package scalable services on Windows Azure.

    I really hope to see some of you there -- please come by to chat, I'd really like to get some first hand feedback about the Tools and Platform. 

    I should also mention, if you've seen Steve Marx talk, you know not to miss it, if you haven't, definitely check it out:

    MIX09-T09F Building Web Applications with Windows Azure
    Wednesday March 18 |4:00 PM-5:15 PM | San Polo 3504
    By: Steve Marx  Tags: Azure
    Come learn how to use Windows Azure to build a scalable Web application and deploy it to the cloud.

    Other Windows Azure sessions:

    MIX09-T07F Overview of Windows Azure
    Wednesday March 18 |2:15 PM-3:30 PM | San Polo 3504
    By: Manuvir Das  Tags: Azure
    Curious about cloud computing? Come learn how to use Windows Azure to better address key challenges of running Internet-scale applications in the cloud. Also hear about the essential concepts of Windows Azure, including what's new.

    MIX09-T38F See through the Clouds: Introduction to the Azure Services Platform
    Wednesday March 18 |11:30 AM-12:45 PM | San Polo 3504
    By: James Conrad  Tags: Azure
    Come hear how Microsoft is building a new platform for applications, and learn about the key services that compose the platform as well as how to get started. Also hear Microsoft's roadmap for the Azure Services Platform and learn about new features that will be added.

    MIX09-T08F Windows Azure Storage
    Thursday March 19 |10:30 AM-11:45 AM | San Polo 3504
    By: Brad Calder  Tags: Azure
    Come hear about the highly available and massively scalable cloud storage service that is provided by Windows Azure. Learn how to create and access the different types of Windows Azure storage available, including blobs, tables, and queues.

    Fix available: ASP.Net MVC RC Crash in a Windows Azure Cloud Service Project

    For those of you that have been unfortunate enough to experience the VS crash when using the ASP.Net MVC RC in a Windows Azure Cloud Service project, I have good news!

    The CLR team has distributed a hotfix.  The KB Article number is 963676 however at the time of this writing, the article is not posted at http://support.microsoft.com/?kbid=963676 -- although this will be the final destination.

    The hotfix isn't specific to the MVC crash, it solves some crashes in the WPF Designer as well.

    You can download the hotfix here: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0

    • For Vista/Windows Server 2008 32 bit: Use Windows6.0-KB963676-x86.msu
    • For Vista/Windows Server 2008 64 bit: Use Windows6.0-KB963676-x64.msu
    More Posts Next page »
    Page view tracker