• Cloudy in Seattle

    Tips and Tricks for Visual Studio + Windows Azure at PDC ‘09

    • 2 Comments

    For those of you that will be attending PDC, I wanted to let you know about a session I’ll be doing on using Visual Studio 2010 to develop applications that run on Windows Azure.

    The session will share a number of tips and tricks and show some cool new tools in Visual Studio for Windows Azure and SQL Azure.

    The tips and tricks will be presented in the context of 2 walkthroughs:

    1. Creating a new cloud service application
    2. Migrating an existing ASP.NET Web Application to Windows Azure and SQL Azure

    With this format I hope to make the session interesting and useful for developers that are new to Windows Azure as well as those who have been using Windows Azure for a while and want to learn some neat tricks and tips and some “under the hood” aspects of the tools.

    Hope to see you there!  Wednesday at 1:30 PM in 515A

    http://microsoftpdc.com/Sessions/SVC53 

    A platform is only as powerful as the tools that let you build applications for it. This session focuses on using demos, not slides, to show the best way to use Visual Studio 2010 to develop Windows Azure applications. Learn tips, tricks and solutions to common problems when creating or moving an existing application to run on Windows Azure. Come see how Visual Studio 2010 supports all parts of the development cycle as we show how to take an ASP.NET application running on IIS and make it a scalable cloud application running on Windows Azure.

    PDC09Bling_Speaker_ImA_240

  • Cloudy in Seattle

    Couple neat Windows Azure Storage related announcements

    • 0 Comments

    In case you missed this on the Windows Azure blog, there were a couple of neat announcements around new storage features:

    Content Delivery Network: http://blogs.msdn.com/windowsazure/archive/2009/11/05/introducing-the-windows-azure-content-delivery-network.aspx

    Windows Azure CDN has 18 locations globally (United States, Europe, Asia, Australia and South America) and continues to expand. Windows Azure CDN caches your Windows Azure blobs at strategically placed locations to provide maximum bandwidth for delivering your content to users. You can enable CDN delivery for any storage account via the Windows Azure Developer Portal. The CDN provides edge delivery only to blobs that are in public blob containers, which are available for anonymous access.

    The benefit of using a CDN is better performance and user experience for users who are farther from the source of the content stored in the Windows Azure Blob service. In addition, Windows Azure CDN provides worldwide high-bandwidth access to serve content for popular events.

    Custom Storage Domain Names: http://blogs.msdn.com/windowsazure/archive/2009/11/05/accessing-windows-azure-blobs-using-custom-storage-domain-names.aspx

    The custom storage domain name feature allows you to register a custom domain name for a given storage account for anonymous blob access using that domain name. Currently we provide access to blob storage using the following domain name:

    http://<account>.blob.core.windows.net/<container>/<blobname>

    But if I owned a domain called “toddlers.wingtiptoys.com”, I may instead want my blobs accessible via:

    http://toddlers.wingtiptoys.com/<container>/<blobname>

    I'm really excited about both features as they are just so important in terms of allowing our customers to build professional and high performance web sites. 

    In the case of CDN, it allows you to leverage Microsoft's content delivery capabilities for your own web sites - how cool is that?

  • Cloudy in Seattle

    Setting Up SQL Server Management Studio with SQL Server Express 2008 Installed

    • 11 Comments

    One of the things I’ve been playing with lately is SQL Azure.  I’ll post about my experience using Windows Azure and SQL Azure together shortly, this post is all about setting up SQL Server Management Studio (SSMS) with SQL Server Express 2008.

    In order to use SSMS with SQL Azure, you need to have the 2008 version of SSMS installed.  I had the 2005 version and it failed to connect.

    The reason I’m posting about this is that I ran into a few non obvious things.  Now the thing is, I’m not that savvy with SQL Server and I’m sure that contributed to my confusion.  On the other hand, I figure other folks may be in my situation and could find this to be useful – if I can save a couple of people’s time, then I’m happy :)

    From what I understand, because there are so many different SQL Server installs and because how you install SQL Server can also impact how you can add or even if you need to add SSMS, this set of instructions is far from complete. 

    If my scenario below is different for you, I found a lot of good information in the comments of this article.  You just have to sort through them and figure out what all the options/dialogs everyone is talking about.

    Back to my scenario -- I specifically had SQL Server Express installed through my Visual Studio installation and I wanted to add SSMS.

    There are two ways I can get SSMS for SQL Server Express 2008, one is with a download  of SQL Server 2008 Express that includes SSMS, the other is through the standalone installer.

    Because i already had SQL Server Express 2008 installed, I downloaded and ran the standalone installer.  Upon running, I received this dialog:

    image

    Which scared me into thinking that I didn’t have SP1 of SQL Server installed.  Turned out I had so I could safely ignore this dialog.  Key point here is not to let this dialog mislead you.

    Upon hitting “Run”, I was brought to the SQL Server Installation Center:

    image

    Again I’ll remind you that I’m not much of a SQL Server guy, so I really had no idea what to do next.  I expected to just click next through a bunch of installer screens then go to my start menu and find SSMS – so what is this I see?

    After some experimentation and trial and error (too much trial and error in fact), I found I needed to click the “Installation” link on the left then click the “New SQL Server stand-alone installation or add features to an existing installation” link.

    image

    Great, after hitting next through some setup files, a rule check and a EULA, I was brought to the following dialog:

    image

    Here I initially chose to “add features” – seems like that would make sense but it turned out to be a dead end. 

    I went back to “Perform a new installation of SQL Server 2008” and that led me to the next screen which allowed me to select “Management Tools – Basic”.  This is the one you want to select. (it’s already selected in the screen shot below because SSMS was installed at the time of this screen shot).

    image

    After clicking through the remaining dialog, I was happy to see SSMS under my start menu, Microsoft SQL Server 2008 folder.

    image

    Now I can connect to SQL Azure through the Query editor (not the connect dialog that comes up when you start SSMS or from the object explorer).  Only a connection from the Query Editor is supported. (a later version of SSMS, for SQL Server 2008 R2 is coming that will support SQL Azure)

    image 

    More to come on my SQL Azure + Windows Azure experience soon.

    Hope this was helpful for someone.

  • Cloudy in Seattle

    Changing the Windows Azure Service Configuration when running on the DevFabric

    • 0 Comments

    Here’s a fun little thing I found out about recently.  Suppose, I have a Cloud Service that I’m running on the devfabric and I want to simulate a configuration change.

    I’ll start by creating a cloud service with a single web role:

    image

    Opening the service configuration file, I can see that the instance count is set to 1.

    <Role name="WebRole1">
        <Instances count="1" />
    </Role>

    I hit F5 and my service has 1 instance of the web role running on the devfabric:

    image 

    Note that the deployment ID is 51 – it’s in brackets in deployment(51).

    To change the configuration while my apps is running, I open up the Windows Azure SDK command prompt (found in the start menu) and navigate to where I created my cloud service.  An easy way to get there is to right click on the Cloud Service node in Solution Explorer and select “Open Folder in Windows Explorer”.

    image

    In that directory will be a ServiceConfiguration.cscfg file.  This corresponds to the file in your cloud service project. Edit the value of your ServiceConfiguration.cscfg file (the one you edited before) and change the instance count to 3.

      <Role name="WebRole1">
        <Instances count="3" />

    Now use the command line tools csrun to update the service configuration file.  The command line help shows the command is:

    /update:<deployment-id>;<configuration-file> [/launchBrowser]

    You’ll remember above that in my case the deployment ID was 51.  So my command will be:

    > csrun /update:51;ServiceConfiguration.cscfg

    csrun will then tell me that the new settings have been updated and when I look at the devfabric UI again, I hit refresh and I see that there are now 3 instances of the Web Role.

    There are a couple of tricks here – because we are debugging this service, we started the role instances as suspended.  Click on the Service Deployment, in my case deployment(51) and hit the play button to get those instances to run.

    image

    What you’ll also notice now is that if you hit “break all” in VS to stop in the debugger, VS is still only debugging one instance of RdRoleHost.exe which is the host process for the web role.

    image

    To debug the new web role instances while not stopping this session, go to the VS Debug menu and select “Attach to Process” and select the RdRoleHost.exe processes that are not currently being debugged and click “Attach”.

    image 

    Hit “run” and now you’re debugging all of the role instances after making the configuration change.

    image

    Alright, I admit – a bit of a party trick to impress your friends with (now I have you guessing what kind of parties I go to) and not terribly useful in the July CTP as the role instances restart when the service configuration file changes.  You may also see some cases where the dfagent crashes (these are not the droids you are looking for).

    Letting the cat out of the bag here – in the upcoming release, you will have more control over what happens with your roles after a configuration change and it may be interesting to debug this scenario.

  • Cloudy in Seattle

    Windows Azure Service Management PowerShell cmdlets

    • 0 Comments

    In case you didn't see this on Ryan Dunn's blog, we just released some neat Powershell cmdlets that wrap the Service Management API and allow you to script your deployments, upgrades and most of what you can do today in the Developer Portal.

    They are available here:http://code.msdn.microsoft.com/azurecmdlets

    The csmanage tool that utilizes the Service Management API may also be of interest to you: http://code.msdn.microsoft.com/windowsazuresamples

    I generally don’t like to just make announcements like this on my blog but since it is very Windows Azure developer tool related, I wanted to include it.

  • Cloudy in Seattle

    Windows Azure Tools for Microsoft Visual Studio 2010 Beta 2 Coming Soon

    • 2 Comments

    Recently, I updated a somewhat out of context (for this blog) post titled "Windows Azure Tools and Visual Studio 2010”. 

    One of the things you’ll notice is that we let the cat out of the bag that we’ll be releasing something new and big in November!  (ok, maybe not a big surprise given that PDC 2009 is in November as well) 

    It’s one of the reasons my blog has been quieter than usual over the last months, there’s a lot of stuff coming and I’ll have a lot of posts in November and December.

    That said, the main reason for the post is to provide a landing page for a link we have from Visual Studio 2010.  In fact, we have a lot of cool Visual Studio 2010 integration features to talk about.

    Let me elaborate.

    When you first start up Visual Studio 2010 beta 2, you’ll see in the “Getting Started” tab that there is a section for “Cloud”.  Here you can get directed to a lot relevant content for developing for Windows Azure, notably a number of links to the newly redesigned azure.com.

    image

    When you click on File –> New Project, you’ll also see that by default (no tools installed), we have a node under Visual Basic and Visual C# entitled “Cloud Service”.

    When you select that node, you’ll see the following – a project template called “Enable Windows Azure Tools”

    image 

    When you create that project VS will open up a page with the following:

    image

    Here, you can click on “Download Windows Azure Tools” to get the latest tools for Visual Studio. 

    Today – it will take you to the page I mentioned above – we’re getting our exciting upcoming release ready for you! 

    From my previous post:

    We’re really excited about this release as not only does it support Visual Studio 2010 Beta 2, but it also adds a new UI over the service definition and configuration files, adds new template options for creating roles, improves debugging integration with the development fabric and integrates with a number of new platform features and improvements.

    Stay tuned!

  • Cloudy in Seattle

    Windows Azure Tools and Visual Studio 2010

    • 8 Comments

    Windows Azure Tools for Visual Studio

     

    Windows Azure Tools for Microsoft Visual Studio extend Visual Studio to enable the creation, building, configuring, debugging, running and packaging of scalable web applications and services on Windows Azure.

     

    Windows Azure Tools for Visual Studio 2010 Beta 2 – Coming Soon!

     

    We’re putting the final touches on our upcoming November release of the Windows Azure Tools, SDK and cloud which will support Visual Studio 2010 Beta 2. 

     

    We’re really excited about this release as not only does it support Visual Studio 2010 Beta 2, but it also adds a new UI over the service definition and configuration files, adds new template options for creating roles, improves debugging integration with the development fabric and integrates with a number of new platform features and improvements.

     

    Please check back regularly for availability. In the meantime, if you have Visual Studio 2008, you can use the Microsoft Web Platform Installer 2.0 to get the Windows Azure Tools for Microsoft Visual Studio 2008.

    You can also learn more about Windows Azure at http://azure.com.

  • Cloudy in Seattle

    Installing the Windows Azure Tools using the Web Platform Installer

    • 0 Comments

    Today, the IIS team released a the Web Platform Installer 2.0 RTW.  Among the many cool new things (more tools, new applications, and localization to 9 languages) is the inclusion of the Windows Azure Tools for Microsoft Visual Studio 2008.

    Install the Windows Azure Tools for Microsoft Visual Studio 2008 using the Web Platform Installer.

    image

    Why should you care?  As many of you know, before using the Windows Azure Tools, you need install and configure IIS which requires figuring out how to do that and following multiple steps.  The Web Platform Installer (we call it the WebPI) makes installing the Tools, SDK and IIS as simple as clicking a few buttons.

    For example, on a fresh machine, when I use the WebPI to install the Tools – look at all of the dependencies that get brought in and installed for me.  I also don’t need to know to install IIS as a separate step, *it just works*.

    clip_image002

    One thing I do want to point out is that if you to browse around the WebPI to find the Windows Azure Tools, you first have to go to the Options dialog:

    image

    And select the “Developer Tools” checkbox.

    image

    A couple of other notes:

    • The Microsoft Web Platform home page is on microsoft.com/web
    • If you have trouble with the link to install the Windows Azure Tools, try installing the WebPI manually first, then clicking on the link.
    • The applications installed by the Web Platform Installer are intended to be run on IIS, not Windows Azure.  We’re working on resolving this moving forward.
  • Cloudy in Seattle

    Using WCF on Windows Azure

    • 2 Comments

    Today, the WCF team released a patch that will help you if your are using WCF on Windows Azure

    Essentially, if you use the "Add Service Reference..." feature in Visual Studio or svutil to generate WSDL for a service that is hosted on Windows Azure either locally or in the cloud, the WSDL would contain incorrect URIs. 

    The problem has to do with the fact that in a load balanced scenario like Windows Azure, there are ports that are used internally (behind the load balancer) and ports that are used externally (i.e. internet facing).  The internal ports were showing up in the URIs.

    Also note that this patch is not yet in the cloud, but will be soon. i.e. it will only help you in the Development Fabric scenario for now. (Will post when the patch is available in the cloud.)

    While we're on the topic of patches, please see the list of patches related to Windows Azure.

  • Cloudy in Seattle

    Using app.config in the July 2009 CTP

    • 0 Comments

    In the July 2009 CTP of the Windows Azure Tools for Microsoft Visual Studio, we introduced a bug where if you use the App.Config file in a Worker Role, it won’t get included in your Service Package both when running on the local Development Fabric or in the Cloud.

    To resolve this issue, simply add the following environment variable before starting Visual Studio:

    AddAppConfigToBuildOutputs=true

    This will be fixed in our next release, in fact it’s fixed in our daily builds already.

    What happened?

    In order to support TFS Build, we changed how files are copied to the package for the Worker Role.  As part of the changes, we missed calling one of the targets with a property set to handle the App Config.

    It was lucky for us that our customers can workaround the issue by setting the environment variable above and MSBuild will do the right thing.

    Scenario

    To elaborate on the scenario, if you create a new Cloud Service with a Worker role by clicking File | New Project | Visual C# | Cloud Service and adding a Worker Role:

    image

    Right Click on the WorkerRole1 project in Solution Explorer and select Add | New Item and select the “Application Configuration File” item.

    image

    Build the solution and navigate to the Service Package (more info on Service Packages) and you’ll find that the app.config file is missing from the worker role.  (no WorkerRole1.dll.config)

    This is true in the packaging for the Development Fabric and if you Published for the Cloud.

    Exit Visual Studio and add the environment variable: AddAppConfigToBuildOutputs=true

    Then restart Visual Studio and open up that same solution you were working on.

    Rebuild All and again navigate to the Service Package.  This time you will see the WorkerRole1.dll.config file as you would expect.

    Sorry for the inconvenience, again this is temporary and you now know the workaround.

    Some forum threads about this:

  • Cloudy in Seattle

    Working with Multiple Web and Worker Roles

    • 6 Comments

    After you install the July 2009 CTP and create a new project via File | New Project | Cloud Service, you now have a single template “Cloud Service” instead of the 4 you had in the past.

    Clicking on that brings up our new project creation dialog. 

    image

    There are a couple of reasons we have this dialog:

    1. In the past, we only allowed you to have 0 or 1 Web Roles and 0 or 1 Worker roles in your Cloud Service.  Now you can have 0 to N of either type.  We want to help you create the Service Model you want to have.
    2. We want to expose multiple templates for you to use for each of the Roles.  For example, we’re working to one day have an MVC Web Role, Dynamic Data Web Role and more.  We not only want you to create the Service Model you want to have but also using a selection of different templates for each Role.

    You can add Web and Worker Roles to the Cloud Service solution, rename the projects and hit OK to create the Cloud Service.  Try adding 2 Web Roles and 2 Worker Roles.

    image

    You’ll have a solution that matches:

    image

    Note that you’ll want to setup the port numbers for your input endpoints in the ServiceDefinition.csdef. 

    We auto-generate what we hope to be safe numbers but don’t know what your intention is for each of the Web Roles – at this point in time, a second or third Web Role cannot be assigned to a sub domain, they can only be differentiated by port.

    When you hit F5, we’ll bring up a web browser instance for each of the Web Roles. 

    If you don’t want us to bring up a Web Browser instance for a given web role, right click on the associated Role under the Roles node and deselect “Launch Browser”.

    image

    Also note that when you close one web browser, your debugging session will end.

  • Cloudy in Seattle

    Windows Azure Tools and SDK July 2009 CTP

    • 0 Comments

    I’m pleased to announce that we have released a new version of the Windows Azure Tools and SDK! (will take time to propogate, try the direct link to the download)

    What’s New for the July 2009 CTP?

    • Support for developing and deploying services containing multiple web and worker roles. A service may contain zero or more web roles and zero or more worker roles with a minimum of one role of either type.
    • New project creation dialog that supports creating Cloud Services with multiple web and worker roles.
    • Ability to associate any ASP.NET Web Application project in a Cloud Service solution as a Web Role
    • Support for building Cloud Services from TFS Build
    • Enhanced robustness and stability

    “Enhanced robustness and stability” means that we fixed some issues we’ve heard from customer feedback:

    • Invalid URI error message when trying to create Cloud Services
    • Role instances did not start with in the time allowed error message when debugging
      • Note: This can also occur when there is a problem with the security policy – please let us know if you continue to see this problem
    • Improved the error message when you run the Development Storage the first time without SQL Server Express installed which is the default DB instance to use.

    For more information on using the new features, please see the following posts:

    Working with Multiple Web and Worker Roles

    Associating an ASP.NET Web Application (including MVC) as a Web Role  

  • Cloudy in Seattle

    Associating an ASP.NET Web Application (including MVC) as a Web Role

    • 1 Comments

    For more recent information on using ASP.NET MVC with Windows Azure please see this post.

    If you’ve been following along, you’ll remember my post about using an existing ASP.NET Web Application as a Web Role.  We’re now a little smarter in the tools and can allow you to associate any ASP.NET Web Application in the Cloud Service as a Web Role. 

    For example, I can create a Cloud Service with just a Worker role, right click on the Solution in Solution Explorer and select Add | New Project and select an ASP.NET Web Application from the Web folder. 

    image

    This could be *any* ASP.NET Web Application, including derivatives of it like an MVC project, Dynamic Data etc.

    For the sake of this demo, I’ll add an ASP.NET MVC Web Application:

    image 

    I then right click on the Roles node in the Cloud Service project and select Add | Web Role Project in solution…

    image

    Now instead of just “Web Roles”, you will get a list of all ASP.NET Web Application project types.  In this case, I select the MVC Web Application I created:

    image

    And there you have it, you are using a new or existing ASP.NET Web Application as a Web Role.

    (Note that if you want to use the Service Hosting runtime APIs, you’ll have to add a reference to Microsoft.ServiceHosting.ServiceRuntime.dll yourself.)

    image

    When I hit F5, I get the behavior I expect, the MVC Application running on the Windows Azure Development Fabric.

    image

    One additional note: in order for the MVC assemblies to be included in your service package that you will upload to the cloud, make sure you set the copy local property to true for the MVC DLLs (More information here):

    • System.Web.Abstractions
    • System.Web.Mvc
    • System.Web.Routing

    We hope this will make using different application types (like MVC, Dynamic Data and others) as well as using your existing ASP.NET applications easier.  Let me know what you think!

  • Cloudy in Seattle

    The Windows Azure CGI Web Role Template Explained

    • 0 Comments

    Many of you may not even know this, but as part of the Windows Azure Tools for Microsoft Visual Studio, we ship a Role template called “CGI Web Role”.

    Today, it’s a little hard to find (yes, I’m foreshadowing that this is about to change!) as you have to create a Cloud Service project first, then add/replace the Web Role with a CGI Web Role.

    For example you could create a Blank Cloud Service project:

    image

    In Solution Explorer, right click on the Roles node in the Cloud Service project Add | New Web Role Project…

    image 

    Select CGI Web Role:

    image

    Which adds an ASP.NET Web Application project tailored to be the configuration and files conduit for a FastCGI Application to your Cloud Service:

    image

    What is the purpose of the CGI Web Role? 

    Even though Visual Studio doesn’t support languages like PHP, there are reasons for you to be interested in using Visual Studio when building a FastCGI application that runs on Windows Azure:

    • Configuration:
      • Includes the Web.roleconfig file which is used to specify the FastCGI application
      • Has a commented section in the web.config that describes how to add the FastCGI handler.
    • Running on the DevFabric
      • Once you have the project setup, you can hit F5 and have your application run on the DevFabric. Stop, edit and run it again with ease.
    • Packaging for deployment
      • Right click on the Cloud Service project in the Solution Explorer and select “Publish” – this will package your application for deployment.

    Not to mention that Visual Studio really has a first class source editor and a lot of other features you’ll be able to make use of.

    (Please see the Windows Azure SDK documentation and the FastCGI sample for more information on hosting a FastCGI application on Windows Azure.)

  • Cloudy in Seattle

    Not too late to vote for your favorite new CloudApp()

    • 0 Comments

    [Update, voting for US entries has now concluded - opening for the international winner will open soon]

    Go to http://www.newcloudapp.com/vote.html 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.

  • Cloudy in Seattle

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

    • 8 Comments

    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.

  • Cloudy in Seattle

    Adding an HTTPS Endpoint to a Windows Azure Cloud Service

    • 7 Comments

    [Update: With the November 2009 release of the Windows Azure Tools - this post is now obsolete - an updated post is available here]

    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.
  • Cloudy in Seattle

    Azure Services Platform Developer Challenge

    • 1 Comments

    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!

     

  • Cloudy in Seattle

    Windows Azure Geo-Location is Live

    • 5 Comments

    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.

  • Cloudy in Seattle

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

    • 4 Comments

     (Update 9/24/2009 -- We're now included in the Web Platform Installer!  See: http://blogs.msdn.com/jnak/archive/2009/09/24/installing-the-windows-azure-tools-using-the-web-platform-installer.aspx)

    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. 

  • Cloudy in Seattle

    Digging in to the Windows Azure Service Package

    • 6 Comments

    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.

  • Cloudy in Seattle

    iisfcgi.dll is not up-to-date?

    • 1 Comments

    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.

  • Cloudy in Seattle

    Windows Azure Mix Videos

    • 3 Comments

    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.

  • Cloudy in Seattle

    Updated Release Notes for the Windows Azure Tools March 2009 CTP

    • 2 Comments

    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.

  • Cloudy in Seattle

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

    • 4 Comments

    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

  • Page 3 of 9 (202 items) 12345»