Category Archives: Visual Studio

Enabling Self-Service On-Demand Provisioning of Dev Environments

Check out other posts in this multi-author series by going here.

Development environments are a primary use case for using Azure today. As with production scenarios, the elastic nature of the cloud allows organizations to spin up computing power based on usage. If you only need a dev/test environment for a few minutes, then that’s all Azure will bill you for. In my experience though, Operations has been primarily focused on production – as they should be! Unfortunately, this means it can be challenging to find the resources needed to provision AND maintain development environments. On top of this, developers are being asked to dramatically increase their release cycles, so they may need to spin up and down numerous environments with very little advance notice to order hardware and then allocate time to provision and configure.

Enter Self-Service!! Azure gives your team the ability to stand up their own development and test environments. There are numerous ways to provision environments using Azure. In this post, I’ll detail the following options:

  • Visual Studio Platform Images for MSDN Subscribers
  • Visual Studio + Azure SDK
  • Azure Management Portal
  • Windows Azure Pack

Visual Studio Platform Images for MSDN Subscribers

In some cases, the only development environment you need is a machine running Visual Studio. Azure provides a gallery of virtual machine images with preinstalled software and it includes images with Visual Studio ready to go! (At the time I wrote this, these images were not available in the Azure preview portal [“Ibiza”] and were only available in the full Azure portal.)

Each Visual Studio image is tied to an MSDN subscription level. For example, as an Ultimate subscriber, I can provision a virtual machine preloaded with Visual Studio Ultimate since I own that license. (Selecting a version of Visual Studio that I am not licensed for can put my organization at risk of non-compliance!)

If you are a developer with Visual Studio Premium or Ultimate, then you are already Premium/Ultimate MSDN subscriber. If you are a QA person running Microsoft Test Manager, you are also an MSDN Premium subscriber.

Step 1: In Internet Explorer, navigate to the Microsoft Azure Management Portal (http://manage.windowsazure.com), click NEW in the bottom-left corner, select VIRTUAL MACHINE, and select FROM GALLERY.

Step 2: In the CREATE A VIRTUAL MACHINE wizard, select VISUAL STUDIO from the filter list, select the desired, and click the Next arrow. Be sure to select the image that corresponds to your MSDN Subscription level and the desired OS.

Step 3: On page 2, enter a unique name for your machine, select a tier/size, provide an administrator username/password, and click the Next arrow.

Step 4: On page 3, you can specify additional information about your virtual machine (DNS, subscription, region, endpoints, etc.). Click the Next arrow when you are finished.

Step 5: On the final page, be sure to leave the Install the VM Agent checkbox checked. This agent allows us to remotely interact with the virtual machine. Click the Finish checkmark to start the provisioning process.

And, that’s it! Alternatively, you could provision one of these images using PowerShell. You now have a virtual machine with the following software pre-installed:

Windows Server 2012

Windows 7

Windows 8.1

Visual Studio Professional, Premium, or Ultimate with Update 2

Yes

Yes

Yes

Windows Azure SDK for .NET 2.3

Yes

Yes

Yes

SQL Server 2012 SP1 Developer Edition

Yes

No

No

SharePoint 2013 Trial

Yes

No

No

Scripts to provision SharePoint 2013 and SQL Server

Yes

No

No

Develop for Windows Store apps

No

No

Yes

Develop for Windows Phone apps (coming later)

No

No

No

 

USE CASE: I work on several, very different types of projects concurrently.

Most developers have just one development machine, but most developers are also working on several different projects at the same time. If your projects differ dramatically, then you can stand up any number of Visual Studio environments in Azure. Each of these environments can be configured for the specific technologies and configurations you need on a given project without worrying about “dirtying” up your machine for other projects. And because Visual Studio supports roaming settings, you can opt to sync your IDE preferences across these machines. Visual Studio and MSDN are licensed per user, so you only pay for the Azure usage.

USE CASE: I’m a SharePoint developer.

In some ways, developing for SharePoint is much more challenging than developing traditional LOB applications. You either directly develop on Windows Server running on you host machine, develop locally and deploy/debug to a remote Windows Server, or develop on Windows Server running on a virtual machine. That last option is quite common, but it means your local machine needs an extravagant amount of resources on your local machine. With the pre-installed software and provided scripts on the Windows Server images, you can simply run some pre-installed PowerShell scripts to quickly stand up an environment ideal for SharePoint development. Included scripts let you set up SharePoint with or without Active Directory, setup a virtual network, provision a virtual machine for Active Directory, and joining to a domain.

USE CASE: My machine isn’t always up-to-date.

In some organizations, it can be very challenging to keep developers up-to-date with both hardware and software. Development teams within an organization often make up a small percentage of the employee base, so it’s challenging to dedicate some portion of your desktop support staff to just this group’s specialized needs.

  • Fast hardware: The tools, utilities, etc. often eat through resources like no other single machine in your organization, so Azure lets them scale the compute power for the needs at hand.
  • Latest VS and other software: Many organizations keep a list of evaluated and approved software that can be installed on employee machines. Unfortunately, developers and IT Pro’s are often called on to work with unapproved or alpha/beta versions of tools, utilities, and libraries. It can be especially disappointing to be “stuck” on older versions of Visual Studio while trying to develop “tomorrow’s” applications for the organization. While it doesn’t eliminate the need to be a responsible employee, by moving your development environment to Azure, these power users can use these as yet unapproved tools in a relatively safe way.
  • Admin access: Closely related to the last point, the somewhat isolated and potentially temporary nature of these cloud development environments means these users will have complete administrative access to these machines to install and configure the software as needed – a requirement to develop a lot of today’s modern applications.

Visual Studio + Azure SDK

One of the things we’ve been doing with the Visual Studio Azure Tools is to make the experience of working with cloud resources as seamless as working with your own local resources. Starting really with Azure SDK 2.2, we allowed to provision, debug, and shut down Azure resources without leaving Visual Studio.

Step 1: In Visual Studio, create a new web project and click the OK button. (This only works for those projects based on ASP.NET Web Applications, so it won’t work for applications like WCF.)

Step 2: The New ASP.NET Project dialog appears. In the bottom-right corner check the box labeled Host in the cloud and select either Web Site or Virtual Machine from the dropdown list. (I’ve always been confused why this page is needed. It seem like this stuff could be in the project’s Properties page.)


Step 3: If you elected to create a VM, the Create virtual machine on Windows Azure dialog appears. Provide the desired details like DNS name, VM image and size, and credentials. Click the OK button when you are ready.

After you click OK, you can immediately start writing code. The virtual machine provisioning will start in the background and Azure will do most of the work. The Visual Studio Output window will appear so you can follow along with what’s happening.

USE CASE: I develop ASP.NET web applications.

As you can see, if you are an ASP.NET web developer, we make it trivial to spin up an Azure Web Site or Virtual Machine to use as your development environment. You’ll still need to publish your app, but you’ll see we’ve already created the publish profile for your application.

If you are signed into Azure, the resource will appear in your Server Explorer under the appropriate Azure node. Amongst other actions, you can right-click it and select Enable Debugging. This enables remote debugging so you can run the web application in Azure and have it break into your local Visual Studio instance to see how it behaves.

USE CASE: I don’t use Visual Studio, but I provision environments for applications.

If you aren’t a Visual Studio user, then provisioning your application environment from the IDE won’t really help you. Well, you’re in luck! When a developer creates a new Visual Studio web project and opts to provision an environment, we actually do this by generating and running a PowerShell script. That PS script file, along with a JSON configuration file are saved with the Visual Studio project. The project creator can make these files available to you so you can modify as you choose and run them yourself. It’s common for developers to initially provision an environment using their own MSDN subscription to take advantage of their monthly credits, but soon after, it makes sense to spin these environments up for use by others. While the developer could do this, they may not be owners of the organization’s Azure account.

Azure Management Portal

Unlike the previous options, you are likely already familiar with the Azure Management Portal – the web application that gives you access to create, configure, and shut down all of our Azure services. But, did you know you can do much of the same thing with PowerShell and there’s even a REST API for developers?

While the current version of the portal is very focused on IT Pro’s, we are hard at work on a newer version of the Azure portal that is committed to offering a better DevOps experience. It’s our belief that a successful DevOps collaboration starts by providing more transparency between the developers and operations sides of the house. Among other things, this new portal will make it easy for operations to send identified issues with actionable feedback to developers in Team Foundation Server and let them track these issues as they move through the development team.

USE CASE: I’m not a developer.

The previous options are pretty obviously geared toward developers, but there are a lot of other people working on the technology solutions that run the modern business: business analysts, QA, product owners, and, of course, operations. People in these roles can use the management portal in their browser to check up on applications, networks, and other services. Whether you care about monitoring applications, managing billing, or configuring the wide variety of Azure services, the management portal is the one-stop shop.

USE CASE: For more fine-grained control or visibility into my Azure resources.

While Visual Studio is hands-down the best developer environment in the world, it does not provide you with all of the capabilities present in the management portal, PowerShell, client libraries and the REST API. Don’t forget about these other tools!

PowerShell can be used to automate common or complex tasks of all kinds, but Azure provides a specific set of PowerShell commandlets that can help you do things like the following:

Check out the Azure Script Center for more samples.

Sometimes, you need to integrate Azure management capabilities with your own applications. This is a brief description of many of what is provided by Azure’s web services.

Service Management Programmatically manage virtual machines, disks, SQL Azure, and cloud services
Azure Mobile Services Query and alter backend data and authenticate with specific identity providers
Web Sites Management Create and configure web sites; check status and usage
Storage Services Programmatically access storage account, blob, queue, table, and file services
Azure AD Graph Create, update, and delete users, groups, roles, and contacts
ACS Management Engage the Access Control Service for claims-based authentication
Managing BizTalk For BizTalk services, create, update, suspend/resume, or delete; create, delete, and list hybrid connections
Scheduler Create, update, and delete scheduled jobs
Service Bus Send and receive messages to or from the service

 

By the way, if you think of a feature that would really help you, let us know at our feedback site.

Windows Azure Pack

Windows Azure Pack is a collection of the tools we use to provide our cloud-hosted experience, but packaged up for you to provide an analogous experience on top of your on-premises resources.

You can download the Windows Azure Pack for Windows Server here.

USE CASE: I still have to manage some on-premises resources.

Wrap your on-premises resources with Windows Azure Pack to provide the following capabilities:

  • A customizable self-service portal
  • An administrative portal to manage user accounts and quotas
  • A service management API for integration into other systems
  • Virtual machine clouds for Windows and Linux IaaS
  • Web site clouds for scalable web hosting
  • Service bus clouds for reliable messaging

So, what goes where?

You should probably create some guidelines within your organization to define when you should use MSDN, when you should use your organization’s Azure subscription, and when you should use on-premises resources. Most organizations have policies on what kinds of data developers should have access to and how to access on-premises or third-party services for development. These same policies are a great starting point to define your organization’s policies on the use of Azure.

If your organization has already developed some policies on when to use Azure for dev/test, I’d love to hear about them. Every organization has a slightly different take on this, but I think there are probably some good, common practices.

Summary

I’ve tried to show you several options for setting up your development environment. But this is not the end of the road, we have a lot more ideas we’ll be rolling out in the next few months and for years to come. The idea of DevOps is not a new one, but no other company is better able to help you deliver on it than Microsoft!

Advertisements

Visual Studio 2013 Preview Event

I just wanted to thank my co-presenter, Chris Kadel, and everyone who attended the event in St. Louis. (We had a broad range of new features to present on and there just never seems to be enough time to get to everything.)

I didn’t have any slides, but Chris did and you can find those here.

For those that weren’t able to attend, here’s a breakdown of features we covered:

  • Managing SCRUM of SCRUMs (agile portfolio management)
  • Improved offline version control option with Git
  • New collaboration options (Team Rooms and web-based code commenting)
  • IDE enhancements to improve productivity
  • New insights into code (CodeLens)
  • Simplifying performance analysis (Performance & Diagnostics Hub)
  • New performance tools (Energy Consumption & UI Responsiveness)
  • Productivity for C++ developers w/ new language/tooling support
  • “De-fragging” ASP.NET
  • Cloud-based load testing
  • Simplified Team Build
  • Integrated release management (InRelease)
  • New ways to reproduce production issues (new version of IntelliTrace collector and memory dump analysis)

Look forward to future events around Visual Studio and TFS 2013. I’ve seen a glimpse of other features that may be included for RTM/Update 1 and I think you will love it!

Visual Studio 2013 Preview – User Account

New to Visual Studio 2013 is the concept of a user account.

When you first run Visual Studio, you will be prompted to sign in. We will use this information to store your settings in the cloud and make them available to you on whatever machine you are using.

You can always view your account information by going to File | Account Settings…

If you click the Visual Studio profile hyperlink, you’ll be navigated to the following page in your browser.

After reviewing your profile information, click Continue. This will just take you the Team Foundation Service site.

This user profile feature is still early, but I can foresee a lot of potential here beyond tracking your settings. Down the road, we could…

…add more features to the associated web site that show you news you follow like blogs, Channel 9 videos of interest, events you may want to attend, etc.,

…track your recent activity and activity of your team(s) in a dashboard,

…use your stored credentials to auto-connect you to databases, servers, Azure, and more;

…alert you to activity wherever you are – such as NuGet Package updates.

Where would you like to see us go with this?

Visual Studio 2013 Preview – Team Explorer Home Page

While Team Explorer 2012 (and subsequent Updates) added some really great features, I’m really happy to see the new user experience in Visual Studio 2013 Preview.

The new Home page

Project group

At the top of the Home page, the Project section shows the same hub links, but is both more concise and colorful. You can more easily dock team Explorer to a small pane or on your second monitor in a very small space. The color adds some aesthetic appeal, but it also helps your eye gravitate to the color/symbol faster than reading text.

With 2013, each option is more than a navigation link. You can right-click each to see a context menu of related commands. Right now, the context menus are very sparse, but I could see additional options being added over time. In 2012, there is a Request Code Review link under the My Work link. In 2013, the Request Code Review command is available by right-clicking My Work.

Right-click Pending Changes gives you the option to Find
Shelvesets.

Right-click Work Items to create a New Query.

Source Control Explorer is now its own item – rather than under Pending Changes as it is in 2012.

I love that you can navigate straight to the active Task Board for this Team Project and I’ll explore that and the new Team Room feature more in another post.

Solutions group

Below the Project menu is a list of solutions pulled from the active Team Project and your workspace. My favorite part of this is subtle – when you open a solution from this list, it bolds the text. I can just glance at it to see which solution and its branch. For those of you that regularly move between workspaces, you can switch them in the drop-down list provided. The New… and Open… hyperlinks create/open Visual Studio projects respectively – not workspaces as one might think.

That’s all for now. I’d love to hear what you guys think. If you have suggestions for the product team, contribute to User Voice. (They really do listen to that feedback. I know because I see the summary reports the team sends out.)

Now Working With Azure Without Leaving Visual Studio!

First, let me say I love what they have done with the Windows Azure user interface on the web. (You can see it here.) The UI is easy to get around, the animations are helpful, etc. Unfortunately, it’s all in the browser and not in my IDE. This means I have to leave my IDE on occasion to do things like publish my app and confirm the names of sites, services, databases, etc.

But times are a changin’! On April 30th, Microsoft released the Windows Azure SDK 2.0 for .NET. This SDK includes enhancements to Visual Studio that provide integration between the IDE and the Azure management services. In this blog post, I’m going to focus on the publishing to Azure features, but there are other features enabled with this SDK that you can read a little more about on Scott Guthrie’s blog post here.

As I have in the past, I’m going to start by right-clicking my web project and selecting Publish… from the context menu.

Again, as before, the Publish Web dialog appears and we’ll click the Import… button to open the Publish Profile dialog.

I used to download my Azure publish profile from the management portal and keep that file in my Visual Studio project, so I could re-use it if I needed to and share it with my team. I would then import it using this dialog. Here comes the new part! Rather than browsing to the file, I’m going to select the first radio button, labeled Import from a Windows Azure web site, and click the Add Windows Azure subscription hyperlink.

The Import Windows Azure Subscriptions dialog appears. We need to download our subscription details, so click Download subscription file to get the .publishsettings file from the portal. This is the only time you’ll need to return to the Azure portal. This settings file includes all of the information about our Azure subscription – not just a single web site’s publish settings. We’ll then return to the Import Windows Azure Subscriptions dialog and browse out to the location of the file we downloaded. Click the Import button to continue.

Returning to the Import Publish Profile dialog, you should be able to select from your existing Azure web sites from the drop down list. Click OK to return to the Publish Web dialog. The publish settings will auto-populate the Connection tab (which is way better than trying to enter/re-enter all of this stuff yourself). If you’d like, you can click Validate Connection to ensure everything is correct.

The rest of the publish process remains unchanged. After clicking the Publish or Close buttons, you will be prompted to save all of your publish settings and if you choose to do so, they will be added to your Visual Studio project under Properties | PublishProfiles.

Now that I’ve published my application, I should probably check on its status. By opening Server Explorer in Visual Studio, you can now see your Azure subscription services. By expanding the Windows Azure Web Sites node, I can see that my teamsystemcafeservices site is running.

There are several useful options available if you right-click your web site. I can start and stop the web site and stream logs to my output window.

Of course, I can save myself the trip out to the management portal again by selecting View Settings and configure my web site right within the IDE.

There are several other features in the new Azure SDK, so check ’em out!

New SharePoint Features for Developers

I recently completed a tour through Kansas City, Minneapolis, Des Moines, and Omaha to demonstrate the new capabilities for SharePoint developers available in Visual Studio Update 1. (Thanks to all of you that attended – despite this crazy weather!)

A special thanks to Neil Iversen from Avtex for his presentation and demos on the new features in SharePoint 2013. His passion and knowledge on the topic was most evident.

image

Three key features for SharePoint developers were the focus of my session:

Unit testing SharePoint

Sad smileMost SharePoint developers I know don’t write unit tests. It’s just too hard to isolate your custom logic from SharePoint. Without unit tests, developers must spend a lot of time setting up environments, inserting test data, and walking through numerous pages to see if their code is working as intended.

Rolling on the floor laughingVisual Studio 2012 Update 1 adds a SharePoint emulation capability based on the Fakes Framework. You can now write unit tests against your code without even having a live instance of SharePoint! You can even alter the behavior of the SharePoint API to control what the API returns to you.

This feature requires Visual Studio Premium and Update 1.

Performance and load testing SharePoint

Steaming madAny time you are writing code, its always good to keep in mind performance implications. Users get frustrated when applications aren’t responsive. Unfortunately, SharePoint is such a dynamic system, that it could be hard to create usable web performance tests in earlier versions of Visual Studio. With sites, lists, and documents all having unique identifiers that varied across environments, these tests would require a lot of manual revisions to the recorded URL’s. There was also a lot of extra “noise” in the HTTP traffic.

Fingers crossedIt never fails that when users need something in SharePoint, a LOT of them also need it – at the same time. So, load testing is also important in SharePoint. They’ll sometimes make a problem worse by retrying their last action because they aren’t sure its working properly.

Hot smileUpdate 1 adds features to make the recording of web performance tests ignore the noise and identify any SharePoint error pages encountered. The dynamic parameter detection has been extended to extract and pass the unique identifiers for SharePoint objects like site names, list GUIDs, document names, and more.

This feature requires Visual Studio Ultimate and Update 1.

Advanced debugging SharePoint with IntelliTrace

Surprised smileDo you support issues reported by your SharePoint users? Ever wonder what to do with those correlation IDs you see on a SharePoint error page? Its not always easy to reproduce issues within SharePoint.

Red heartThis update makes it very easy to take advantage of IntelliTrace in order to see what lines of your code executed leading up to the reported issue. Even though the error didn’t occur in your development environment, IntelliTrace will log all of the activity so you can play it back in Visual Studio – even if you don’t have the source code on your machine! You can also filter to specific correlation IDs within the IntelliTrace log.

This feature requires Visual Studio Ultimate and Update 1.

You can download the slides for our sessions from my SkyDrive here. Most of my demo’s were based on the hands-on labs here (and get the associated VM here).

Are you a SharePoint developer? Are these new features interesting to you? Let me know what you think.

Web API, WCF Data Service, and St. Louis Winter Weather

Fun combination, huh? I am the presenter at tonight’s St. Louis .NET User Group meeting and this is the topic. I will start by presenting demonstrations of Web API and WCF Data Services, but I’m hoping this will be a discussion about what people are doing with web services today.

Before I forget to do so, I’ll go ahead and post links to my presentation materials: slide deck and demo script. (I’m adding a couple of things and I’ll update the demo script out there later today.) UPDATE: I’ve added the code snippets used in the demo script to my SkyDrive for you to download here.

Building on the success of the last St. Louis .NET User Group meeting, we will be holding this month’s meeting at The Schlafly Bottleworks starting around 6pm.

Achievement Points for Doing My Job?!

Like many of you, I’m an avid gamer and I got into this business because of video games. Modern games allow you to brag about your virtual conquests with achievement points awards. Achievements aren’t just about bragging though. Video game achievements also act as a guide prompting you to try to accomplish specific goals. (My Xbox GamerScore is 76,594 – which I’m told is pretty high – maybe a bit too high for an adult with two kids and a full-time job.) Speaking of jobs, wouldn’t it be cool to have those same bragging rights as a developer?

Back in January of this year, Microsoft released Visual Studio Achievements Beta and it was downloaded by more than 120,000 people. This version is still available for download, but it is only for Visual Studio 2010. When I went to see how many people had downloaded the Visual Studio Achievements for VS 2012, I only saw 8,958 downloads and I wanted to write a blog post to help get the word out as many people may not even know there’s a new version.

You can download the new achievements utility from the hyperlink above or from within Visual Studio by going to Tools | Extensions and Updates… After the extension is installed, you’ll have to take a couple other steps.

To list all of the available achievements, from the Visual Studio menu, go to Tools | Achievements. The following screenshot shows the achievements dialog. There are achievements for Visual Studio features, Azure development, Windows 8, and some off-the-wall items as well (e.g. use the goto statement). The blue-ish icons are achievements that I’ve accomplished, while the gray one is an achievement I’ve yet to earn. A list of achievements can also be found here.

image

Click one of the achievements in the Visual Studio dialog and a browser window will open. From here, you can tweet or otherwise socialize your achievements. Your achievement progress is located on your Channel 9 profile’s page.

image

The complete leaderboard can be found here. It’s just a simple list of the registered users and their achievements progress. (It’s at least entertaining to see what the rest of our industry looks like in their profile pictures – wow!)

There’s a Windows Phone application that displays your achievements. You can download it from the Windows Phone Marketplace here or download the source code from here and sideload it. By the way, the source code solution requires the Silverlight for Windows Phone Toolkit.

The Visual Studio Achievements widget can be placed on any web page. You can get a copy of the script and its various customization options here.

The phone and the widget work by utilizing Channel 9’s achievements web service. Get a complete list of achievements by using http://channel9.msdn.com/achievements/visualstudio?json=true or get a list of a particular user’s achievements with http://channel9.msdn.com/niners/[registeredUsername]/achievements/visualstudio?json=true

And finally, you can submit other ideas for achievements to the Channel 9 Q & A section here.

A couple of my customers not only see this as an employee satisfaction effort, but also see it as a way to enable some peer pressure to get their developers trying new features of the IDE and related technologies.

Are you using the Visual Studio Achievements extension? What other features would you like to see? VS Achievements started as a blog post from the community, so the team is definitely listening.

Learning about new shapes isn’t just for your kids

Mitt Romney may think learning about new shapes is silly, but the Visual Studio team doesn’t. If you don’t know, the new storyboarding feature is essentially a plug-in to PowerPoint that allows a user to quickly draw up user interfaces. Right from PowerPoint, a user can associate these storyboards with one or more work items in TFS and collaborate across the team.

The plug-in provides a number of built-in shapes for developing desktop apps, web apps, Windows 8 apps, Windows Phone apps, and some collaboration shapes. Combined with the built-in PowerPoint shapes, drawing, and animation tools; you’ve already got the ability to draw up the most common user interfaces. You can even create, save, and share your own shapes specific to your applications.

But wait, there’s more! Act now and you can get several more shape libraries from Microsoft and others. This page lists several storyboard shape libraries that you can easily import into your shapes library. Most recently, Microsoft released shapes and icons for the iOS. Now you can sketch out the desired UI before you have to fumble through Xcode and Objective-C! Winking smile

Free Training for a Limited Time

As mentioned in June’s MSDN flash newsletter, you can get free access to several PluralSight courses if you are an MSDN subscriber. Course topics include: C#, Visual Studio, Azure, TFS, and many more!

This limited time offer is only available through September 15, 2012, so register now and start taking advantage of another great MSDN benefit.