Setting a Web/Worker Role Name

I was recently reminded by my friend Nuno that you can actually set the name of the machine used in a Windows Azure Cloud Service (Web or Worker Role).  Normally I really don’t care about the name of the machine.  I’m fine with RD-whatever.

not_set_role_vm_name

If I did care, there is a way to set that machine name.  There is a “vmName” attribute in the Role element of the role’s .cscfg file.

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="CloudServiceName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-10.2.2">
  <Role name="WebRole1" vmName="CollierWeb">
    <Instances count="1" />
    <ConfigurationSettings/>
  </Role>
</ServiceConfiguration>

Doing so will result in the machine name being set to whatever is in the “vmName” attribute, appended with the instance number (0, 1, 2, etc.)

set_role_vm_name
Keep in mind that the “vmName” attribute value must be less than 10 characters.

Note that the role name will still be whatever is set in the .cscfg, appended with the instance number.

role_name

For more on the schema of the .cscfg file, please see MSDN.

About these ads
Tagged with: ,
Posted in Windows Azure
2 comments on “Setting a Web/Worker Role Name
  1. […] Setting a Web/Worker Role Name (posted October 25th) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow Michael S. Collier's Blog on WordPress.com
  • I seriously hate trying to program garage door openers. Few things more fustrating. 3 hours ago
  • Wow! RT @CollegeGameDay: Michigan has not scored a TD vs Michigan State since 2011. Spartans lead 14-3 at half. #MICHvsMSU 3 hours ago
  • Score! First class upgrade on LAX->ORD redeye flight. Thanks @united ! 18 hours ago
  • Hey @united, flight 1037 LAX-ORD shows 3 open seats in first class. I'm #3 in upgrade list. Not cleared yet. What's up? 18 hours ago
  • My flight is showing 3 open first class seats, and I'm #3 on the upgrade list. This is going to be close! 19 hours ago
Follow

Get every new post delivered to your Inbox.

Join 1,950 other followers

%d bloggers like this: