Monday, September 9, 2013

Windows PowerShell 3.0 First Steps

Understanding Windows PowerShell

Windows PowerShell comes in two flavors—the first is an interactive console (sort of like a KORN or a BASH console in the UNIX world) that is built into the Windows command prompt. The Windows PowerShell console makes it simple to type short commands and to receive sorted, filtered, formatted results. These results easily display to the console, but can redirect to XML, CSV, or text files. The Windows PowerShell console offers several advantages, such as speed, low memory overhead, and a comprehensive transcription service that records all commands and command output.
There is also the Windows PowerShell ISE. The Windows PowerShell ISE is an integrated scripting environment, but this does not mean you must use it to write scripts. In fact, many Windows PowerShell users like to write their script in the Windows PowerShell ISE to take advantage of the color syntax highlighting, drop-down lists, and automatic parameter revelation features. In addition, the Windows PowerShell ISE has a feature called the Show Command Add-On, which permits using a mouse to create Windows PowerShell commands from a graphical environment. After created, the command runs directly or is added to the script pane (the choice is up to you). For more information about using the Windows PowerShell ISE, see Chapter 10, Using the Windows PowerShell ISE.
Note  For simplicity, when working with single commands, I show the command and results from within the Windows PowerShell console. But keep in mind that all of the commands also run from within the Windows PowerShell ISE. Whether the command runs in the Windows PowerShell console, in the Windows PowerShell ISE, as a scheduled task, or as a filter for Group Policy, PowerShell is PowerShell is PowerShell. In its most basic form, a Windows PowerShell script is simply a collection of Windows PowerShell commands.

Working with Windows PowerShell

In Windows Server 2012 or Windows 8, Windows PowerShell 3.0 already exists. In Windows 8, you only need to type the first few letters of the word PowerShell on the Start screen before Windows PowerShell appears as an option. The following image illustrates this point. I only typed pow before the Start screen search box changed to offer Windows PowerShell and an option.
Image of screen
Because navigating to the Start screen and typing pow each time I want to launch Windows PowerShell is a bit cumbersome, I prefer to pin the Windows PowerShell console (and the Windows PowerShell ISE) to the Start page and to the Windows desktop taskbar. This technique of pinning shortcuts to the applications provides single-click access to Windows PowerShell from wherever I may be working.
Image of screen

Understanding the basics of cmdlets
All Windows PowerShell cmdlets behave basically the same way. There are some idiosyncrasies between cmdlets from different vendors, or from teams at Microsoft, but in general, when you understand the way that Windows PowerShell cmdlets work, you can transfer the knowledge to other cmdlets, platforms, and applications.
To call a Windows PowerShell cmdlet, you type it on a line in the Windows PowerShell console. To modify the way the cmdlet retrieves or displays information, you supply options for parameters that modify the cmdlet. Many of these parameters are unique and apply only to certain cmdlets. However, some parameters are applicable to all Windows PowerShell cmdlets. In fact, these cmdlets are part of the strength of the Windows PowerShell design. Called “common parameters,” the parameters that are supported by all Windows PowerShell cmdlets are listed in the next section.

Common Windows PowerShell parameters

All Windows PowerShell cmdlets support common parameters. Each of the common parameters also permits the use of an alias for the parameter. The aliases for each parameter appear in parentheses behind the parameter name in the following lists.
  • Verbose (vb)
  • Debug (db)
  • WarningAction (wa)
  • WarningVariable (wv)
  • ErrorAction (ea)
  • ErrorVariable (ev)
  • OutVariable (ov)
  • OutBuffer (ob)
If a Windows PowerShell cmdlet changes system state (such as stopping a process or changing the startup value of a service), the following two additional parameters become available:
  • WhatIf (wi)
  • Confirm (cf)

Using the Verbose parameter

As an example of using a Windows PowerShell common parameter, we can use the –Verbose parameter to obtain additional information about the action that a cmdlet performs. The following command stops all instances of the Notepad.exe process running on the local system, and there is no output from the command:
PS C:\> Stop-Process -Name notepad
PS C:\>
To see what processes stop in response to the Stop-Process cmdlet, use the –Verbose common parameter. In the following example, two separate Notepad.exe processes stop in response to the Stop-Process cmdlet. Because the cmdlet uses the –Verbose common parameter, detailed information about each process appears in the output.
PS C:\> Stop-Process -Name notepad -Verbose
VERBOSE: Performing operation "Stop-Process" on Target "notepad (5564)".
VERBOSE: Performing operation "Stop-Process" on Target "notepad (5924)".
PS C:\>

Using the ErrorAction parameter

When you use the Stop-Process cmdlet to stop a process, if there is not an instance of the specified process running, a nasty error message displays on the Windows PowerShell console. In the following example, the Stop-Process cmdlet attempts to stop a process named notepad.exe, but there are no instances of the notepad.exe process running. Therefore, an error message displays as follows:
PS C:\> Get-Process -Name notepad
Get-Process : Cannot find a process with the name "notepad". Verify the process
name and call the cmdlet again.
At line:1 char:1
+ Get-Process -Name notepad
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (notepad:String) [Get-Process], Proce
   ssCommandException
    + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Comma
   nds.GetProcessCommand

PS C:\>
If you know (or at least suspect), that a process is not running, but you would like to verify this, you can use the –ErrorActioncommon parameter. To hide error messages arising from the Get-Process cmdlet, supply a value of SilentlyContinue for the –ErrorAction parameter prior to running the cmdlet. This technique is shown here:
PS C:\> Get-Process -Name notepad -ErrorAction SilentlyContinue
PS C:\>
Note  The previous command appears to be really long, but keep in mind that Tab expansion makes this easy to type correctly. In fact, the previous command is:
Get-Pro<tab><space>-n<tab><space>notepad<space>-e<tab><space>s<tab>
          You can use the parameter alias –EA instead of typing –ErrorAction (although with Tab expansion,
          it is exactly the same number of keystrokes to shorten the command):
 –E<tab> or –EA
In addition, when you work with the Get-Process cmdlet, the default parameter set is NameThis means that the –Nameparameter from Get-Process is the default parameter; and therefore, Get-Process interprets any string in the first position as the name of a process. The revised command is shown here:
PS C:\> Get-Process notepad -ea SilentlyContinue
PS C:\>
If you are not certain about valid values for the –ErrorAction parameter, you can supply anything to the parameter and then carefully read the resulting error message. In the text of the error message, the first two lines state that Windows PowerShell is unable to convert the value to the System.Management.Automation.ActionPreference type. The fourth line of the error message lists allowed values for the –ErrorAction parameter. The allowed values are SilentlyContinueStopContinueInquire, andIgnore. This technique of forcing an error message is shown in the following image:
Image of error message
Introduction to the pipeline
The Windows PowerShell pipeline takes the output from one command and sends it as input to another command. By using the pipeline, you are able to do things like find all computers in one specific location and restart them. There are two commands in this request:
  • Find all the computers in a specific location
  • Restart each of the computers.
Passing the objects from one command to a new command makes Windows PowerShell easy to use inside the console because you do not have to stop and parse the output from the first command before taking action with a second command.
Windows PowerShell passes objects down the pipeline. This is one way that Windows PowerShell becomes very efficient. It takes an object (or group of objects) from the results of running one command, and it passes those objects to the input of another command. By using the Windows PowerShell pipeline, it is not necessary to store the results of one command into a variable, and then call a method on that object to perform an action. For example, the following command disables all network adapters on my Windows 8 laptop.
Get-NetAdapter | Disable-NetAdapter
Note  Windows PowerShell honors the Windows security policy. Therefore, to disable a network adapter, Windows PowerShell must run with Admin credentials. For more information about starting Windows PowerShell with Admin credentials, refer to Chapter 1 in Windows PowerShell 3.0 First Steps.
In addition to disabling all network adapters, you can enable them. To do this, use the Get-NetAdapter cmdlet and pipe the results to the Enable-NetAdapter cmdlet as shown here:
Get-NetAdapter | Enable-NetAdapter
If you want to start all of the virtual machines in Windows 8 (or Windows Server 2012), use the Get-VM cmdlet, and pipe the resulting virtual machine objects to the Start-VM cmdlet:
Get-VM | Start-VM
To shut down all of the virtual machines, use the Get-VM cmdlet, and pipe the resulting virtual machine objects to the Stop-VMcmdlet:
Get-VM | Stop-VM
In each of the previous commands, an object (or group of objects) resulting from one command pipes to another cmdlet for further action.

Sorting output from a cmdlet

The Get-Process cmdlet generates a nice table view of process information in the Windows PowerShell console. The default view appears in ascending alphabetical process name order. This view is useful to help find specific process information, but it hides important details, such as which process uses the least or the most virtual memory.
To sort the output from the process table, pipe the results from the Get-Process cmdlet to the Sort-Object cmdlet and supply the property on which to sort to the –Property parameter. The default sort order is ascending (that is smallest numbers appear at the top of the list). The following command sorts the process output by the amount of virtual memory that is used by each process. The processes that consumes the least amount of virtual memory appear at the top of the list.
Get-Process | Sort-Object -Property VM
If you are interested in which processes consume the most virtual memory, you may want to reverse the default sort order. To do this, use the –Descending switch parameter as shown here:
Get-Process | Sort-Object -Property VM –Descending
The command to produce the sorted list of processes for the virtual memory, and the associated output from the command are shown in the image that follows.
Image of command output
It is possible to shorten the length of Windows PowerShell commands that use the Sort-Object cmdlet. The Sort command is an alias for the Sort-Object cmdlet. A cmdlet alias is a shortened form of the cmdlet name that Windows PowerShell recognizes as a substitute for the complete cmdlet name. Some aliases are easily recognizable (such as Sort for Sort-Object or Select forSelect-Object). Other aliases must be learned, such as for the Where-Object (most Windows users expect to be an alias for the Get-Help cmdlet). 
In addition to using an alias for the Sort-Object cmdlet name, the –Property parameter is the default parameter that the cmdlet utilizes. Therefore, it can be left out of the command. The following command uses the shortened syntax to produce a list of services by status:
Get-Service | sort status
It is possible to sort on more than one property. You need to be careful doing this because at times it is not possible to sort additional properties. For services, a multiple sort makes sense because there are two broad categories of status: Running and Stopped. It makes sense to attempt to organize the output further to facilitate finding particular stopped or running services.
One way to facilitate finding services is to sort alphabetically the DisplayName property of each service. The script that follows sorts the service objects that are obtained via the Get-Service cmdlet by the status, and then by DisplayName from within the status. The output appears in descending fashion instead of the default ascending sorted listing.
Get-Service | sort status, displayname –Descending
The command to sort services by Status and DisplayName, and the output from the command are shown in the following image.
Image of command output

What’s New in 2012 R2: PaaS for the Modern Web

Blog-Header_Graphic_ModernApps
Part 9 of a 9-part 
series.

A major promise underlying all of the 2012 R2 products is really simple: Consistency.
Consistency in the user experiences, consistency for IT professionals, consistency for developers and consistency across clouds. A major part of delivering this consistency is the Windows Azure Pack (WAP). Last week we discussed how Service Bus enables connections across clouds, and in this post we’ll examine more of the PaaS capabilities built and tested in Azure data centers and now offered for Windows Server. With the WAP, Windows Server 2012 R2, and System Center IT pros can make their data center even more scalable, flexible, and secure.
Throughout the development of this R2 wave, we looked closely at what organizations needed and wanted from the cloud. A major piece of feedback was the desire to build an app once and then have that app live in any data center or cloud. For the first time this kind of functionality is now available. Whether your app is in a private, public, or hosted cloud, the developers and IT Professionals in you organization will have consistency across clouds.
One of the elements that I’m sure will be especially popular is the flexibility and portability of this PaaS. I’ve had countless customers comment that they love the idea of PaaS, but don’t want to be locked-in or restricted to only running it in specific data centers. Now, our customers and partners can build a PaaS app and run it anywhere. This is huge! Over the last two years the market has really began to grasp what PaaS has to offer, and now the benefits (auto-scale, agility, flexibility, etc.) are easily accessible and consistent across the private, hosted and public clouds Microsoft delivers.
This post will spend a lot of time talking about Web Sites for Windows Azure and how this high density web site hosting delivers a level of power, functionality, and consistency that is genuinely next-gen.
Microsoft is literally the only company offering these kinds of capabilities across clouds – and I am proud to say that we are the only ones with a sustained track record of enterprise-grade execution.
With the features added by the WAP, organizations can now take advantage of PaaS without being locked into a cloud. This is, at its core, the embodiment of Microsoft’s commitment to make consistency across clouds a workable, viable reality.
This is genuinely PaaS for the modern web.
Today’s post was written by Bradley Bartz, a Principal Program Manager from Windows Azure. For more information about the technology discussed here, or to see demos of these features in action, check out the “Next Steps” at the bottom of this post.
* * *

Over the past decade, we’ve seen a dramatic shift in how developers build applications. Modern applications frequently reside on the web, and this shift is driving massive demand for scalable, secure, and flexible ways to host web applications across public and private clouds.
clip_image002

Developer and IT Pro Experiences

Web Sites for Windows Server, included in the Windows Azure Pack, provides a Platform as a Service for modern web applications. It delivers both a powerful self-service platform for developers, while serving as a flexible hosting solution for IT professionals. Web Sites does this in a manner which is highly consistent with the Windows Azure Web Sites service. This allows developers and IT professionals to code against and manage a common set of runtimes, experiences, and capabilities – regardless of deployment to the public or private cloud.
Developers and IT pros alike have often struggled with the complexity of web farm configuration and management. By providing a turnkey solution, Web Sites provides developers with the web application services they expect while simplifying administration for the IT professional.

Flexible

Today’s web developer could often be referred to as a “polyglot programmer.” He or she develops in many languages, often selecting the language, database, and tools best suited to solving a given problem. Additionally, many developers don’t start with new applications; instead, they customize an existing application to meet their needs. In either case, Web Sites aims to provide the developer with choice, reducing time to market, and increasing efficiency.

Application Gallery

In addition to providing a best-in-class environment for creating new applications from scratch, the Web Sites service includes a gallery of applications and templates to accelerate application time to market. Popular open source web applications, including DotNetNuke, Umbraco, WordPress, Drupal, and Joomla are packaged and ready for zero-code deployment to the Web Sites cloud. Furthermore, there are a number of templates for creating new .NET, PHP, Node.js, and Python apps.

Deploying Gallery Applications

A developer can create a web site from a template in a few clicks. We will walk through an example of a developer who creates his/her blog using the WordPress application template. To access the gallery, the developer will click ‘New’ in the Consumer Portal and choose to create a new web site from the gallery.
clip_image004
The gallery displays a list of applications that the service provider enables for tenant use. The developer can select WordPress from this list and provide the configuration settings to deploy the application to his/her new web site.
clip_image006

clip_image008
In a few seconds, a web site is instantiated on a server that also hosts other tenant web sites which is provided by the shared hosting capability of the Web Sites PaaS. The developer can now monitor, configure and scale this newly created web site from the Consumer Portal.
clip_image010
The URL for the newly created WordPress blog is now available on the Dashboard tab. The developer can share this URL of this web site as needed or associate it with a custom domain name.
clip_image012

Choice of Language

Out of the box, the Web Sites service provides broad language support, including ASP.net, Classic ASP, Node.js, PHP, and Python. Furthermore, if a developer has a preference for a language not included, he or she can provide a generic FastCGI handler used for running applications in his/her web site. By providing broad language support, which has been battle-tested in Windows Azure Web Sites, the private cloud can now provide a broad menu of language options to satisfy the demands of developers.

Choice of Database

Beyond languages and frameworks alone, the Windows Azure Pack also provides SQL Server and MySQL database provisioning as an integral part of the Web Sites provisioning and management experience. Since different languages often hold a database preference, providing database choice through a consistent user interface allows developers to focus on building applications naturally. By delivering these databases as a service, developers can focus on coding rather than database administration.

Choice of Tools

Additionally, we see that developers often prefer a specific set of tools for development and deployment. For .NET developers, we provide best-in-class support for Visual Studio and WebMatrix. Specifically, Visual Studio users can easily import a Publish Settings file which allows one-click application deployment. WebMatrix users, in addition to one-click deployment, can also edit their site live; it is launched by a button in the Service Management Portal. Deep tool integration makes Web Sites a great place to efficiently host existing ASP.NET and Classic ASP web sites.
Both Visual Studio and WebMatrix utilize the Web Deploy publishing endpoint. For more traditional file upload tools, both FTP and FTP-S are supported.
To demonstrate Visual Studio integration, we’ll begin by creating a web site in the Windows Azure Pack and in Visual Studio. You’ll notice that we’ll be creating a web site the same way you would build an application for deployment to IIS or to Windows Azure Web Sites.
clip_image014
After creating a default page, we will download the publishing profile and configure publishing in Visual Studio.
clip_image016
Next, we will import the downloaded publishing profile.
clip_image018
Finally, we will click “Publish” to deploy our application.
clip_image020
In a few moments, the application build will complete and publishing will commence. After Web Deploy syncs changes between the local and remote deployment, the application will be live.
clip_image022


Delivering DevOps

As DevOps becomes an increasingly common phenomenon, we see developers demanding a greater degree of integration between their source control systems and hosting operations. The Web Sites runtime can host a copy of a Git source code repository, allowing rapid iterative development in the private cloud (including rollback to previous versions of the application). By using standard Git commands, a user can push changes from a local repository into the cloud with no special integration. Consequently, cloning applications across clouds becomes a simple task.
To illustrate this, watch how easy it is to create an application and set up deployment from source control in Windows Azure. In this case, we’ve deployed a basic “Hello World” application written in PHP using Git.
clip_image024
Next, create a web site in the Windows Azure Pack, and set up deployment from source control. From here, the Git tools can be used to clone the site from the public cloud into the private cloud. Once cloned, the application can be redeployed to the private cloud with no code changes. Note the consistency across the Azure UI and how the application behaves identically despite deployment to a private cloud.
clip_image026
Delivering this level of Pass functionality is the result of a large number of new and improved features that include cross platform development, zero lock-in, scalability, site mode, horizontal/vertical scaling, speed, multi-datacenter support – to name a few. We’ll use the rest of this post to examine these features and their application in detail.

Cross Platform Development

By supporting FTP, FTPS, Web Deploy, and Git protocols alongside the Service Management Portal, the Web Sites service allows developers to deploy and manage applications in the Private cloud from any client OS, including MacOS, Linux, and Windows.

Zero Lock-in

Because the Web Sites runtime can be hosted by Microsoft, enterprises, or hosting service providers, developers can confidently deploy their applications. Should a developer need to migrate his or her application to a different cloud, he or she can do so quickly and simply without code changes. For customers looking to outsource hosting of web applications, they can leverage Windows Azure or hosted offerings from other third party hosting service providers.

Scalable

Web Sites provides a high degree of scalability. By de-affinitizing web applications from a single server, apps can dynamically execute on any server in a given cluster at any point in time. This allows the Web Sites service to rapidly respond to changing operating conditions. In the event of server failure, requests are load balanced and rerouted to a healthy machine in the farm to maintain application availability. Should an application require additional resources, developers or IT pros can quickly and easily allocate additional resources to the web app to preserve SLAs.

Site Mode

The Web Sites service provides two site modes – Shared Mode and Reserved Mode. Shared Mode runs sites from multiple tenants on a single server to maximize density and minimize operational costs. Shared Mode works quite well for development or testing scenarios. Reserved Mode runs sites for a single tenant in a pool of servers to maximize performance and improve isolation. Often, Reserved Mode is used for production applications. Since switching between execution modes is delegated to the developer, he/she can quickly choose the execution mode best suited to his/her application.

Horizontal and Vertical Scaling

Application scaling strategies often follow two patterns – horizontal and vertical. The Web Sites runtime supports both; developers can run multiple instances of their applications in both Shared and Reserved Modes. In addition, inside of the Reserved site mode, developers can opt to scale vertically by choosing between three instance sizes (Small, Medium, and Large). By delivering multiple scaling options, developers and IT professionals alike can select the optimal way to host their applications.
clip_image028

Speed and Agility

Because the Web Sites runtime focuses on delivering a finished service (web application hosting), application provisioning and management functions are orders of magnitude faster than infrastructure-based services. Since applications exist as configuration metadata and content, creation and publishing activities complete in seconds rather than minutes – all leading to increased productivity and decreased time to market.

Multi-Datacenter Support

As end users become increasingly connected via devices, performance expectations increase. Multinational corporations expect a worldwide web application presence. With multi-cloud support, service administrators can deploy multiple Web Site clouds to different geographies. Since these clouds are consumed via the same Service Management Portal, developers can easily deploy applications around the globe with minimal time and effort.

Secure

As web applications are often internet facing, security is a critical design point. In this release, the Web Sites service has been enhanced to deliver a secure application hosting experience through robust SSL support. In addition, the feed-based update mechanism allows service administrators to keep the Web Sites cloud current with the latest updates.

SSL and HTTPS

Because the secure transport of information to and from Web Sites is critical, the service provides two varieties of SSL support:
  1. Shared SSL Support
    By default, all created sites are accessible via SSL using a shared certificate. This ensures that developers can use HTTPS immediately following site creation without further interaction.
  2. Custom SSL Support
    For developers using custom domain names, they can upload a custom SSL certificate for transport encryption. The runtime supports two types of SSL bindings:
    • SNI SSL, which provides simplified administration and allows multiple sites using multiple certificates to reside on the same IP address. SNI SSL works out of the box without further configuration.
    • IP SSL, which maximizes compatibility with older browsers. The runtime contains built-in functionality to orchestrate IP SSL configuration across the Front End server(s) and upstream load balancer(s).
clip_image030

Always Current

The Web Sites cloud incorporates a large number of first and third party dependencies to deliver turnkey operation. However, initial deployment is only a small portion of the overall service lifecycle. By integrating Microsoft Update with our feed-based provisioning process, Microsoft is able to deploy updates to both Microsoft and non-Microsoft software. By keeping the cloud up to date, Microsoft helps you maintain a secure and highly compatible application hosting environment.

Additional R2 Features

With the 2012 R2 release of Windows Server, System Center, and the Windows Azure Pack, we ensured that great new scenarios light up across our server operating system, management tools, and cloud runtimes. As a result, we have several new features which will provide developers exciting ways to build innovative applications:
  • WebSocket Protocol Support
    As mobile devices and interactive applications become the norm, we see that new application models are emerging. While traditional web applications employ a “pull” model, where the browser pulls information from the server, we are seeing an increased need for “push” models, where the server is able to push information to a large number of clients at the same time. The WebSocket protocol, now available in the R2 release of Web Sites for Windows Server, allows developers to build rich, interactive applications using this new communication mechanism.

  • 64-bit Worker Processes
    As developers build increasingly complex web applications, large memory footprints are often required. At the same time, many of the open source languages and frameworks are optimized for 32-bit processes. In this release, we allow tenants to select 32 or 64-bit worker processes to best suit their needs.

  • IPv6 Support
    As the number of internet-connected devices increases, the scarcity of IPv4 addresses is becoming increasingly problematic. The R2 release of Web Sites implements IPv6 support in a transparent manner, allowing end users to easily access hosted sites via IPv4, IPv6, or IPv4 and IPv6. This support includes not only HTTP traffic, but also traffic encrypted over HTTPS.

Performance Enhancements

Developers always look for ways to improve application performance, especially if optimizations don’t require code changes. For .NET developers, the most frequent performance complaint is the first request to idle applications. We refer to this as the “cold start” problem. With the R2 release, instead of shutting down idle web sites, we page inactive sites. Paging inactive sites involves moving inactive data from memory to disk. This leads to dramatically improved performance by reducing the frequency of cold start events, since the application can quickly be paged back into memory from disk instead of requiring recompilation. We have also optimized the Web Site cloud to improve performance when application cold start is unavoidable.
Running cloud scale services is challenging, and we’ve taken the lessons learned from running Windows Azure and incorporated them into the Windows Azure Pack. First, we’ve built a wholly distributed architecture to improve security and maximize scalability. Next, we’ve simplified visibility into farm operations and server provisioning. Finally, we’ve made it easy to build plans which govern resource consumption within the Web Site cloud.

Architecture

clip_image031
As you can see in the architecture diagram above, the Web Sites service uses a number of roles to deliver services. Each role serves a specific purpose and these concerns are separated to ensure a high degree of security. The Web Sites roles include:
  • Management Server
    This is the REST API resource provider endpoint for the Service Management API. All provisioning and management requests from the service management API flow through the Management Servers, including site provisioning, scaling, and configuration tasks.
  • Controller
    As the “brain” of the Web Sites cloud, the controller manages software installation and configuration of all servers. In addition, the controller performs health checks and repair operations to maintain farm availability.
  • Front End
    Running Application Request Routing, the Front Ends dynamically route application requests to various web servers in the farm based on the heath and configuration of sites in the cloud.
  • Web Workers
    These servers execute customer code. Since site configuration is stored in the Runtime Database and site content is stored on the File Server, applications can run across any worker in the farm. Workers are classified in four categories (Shared, Reserved Small, Reserved Medium, or Reserved Large) based on which execution mode they support. In addition, source control operations performed via Git run on worker roles.
  • Publishers
    FTP, FTPS, and WebDeploy endpoint(s) for application deployment.
  • File Server (optional)
    This stores web site content and custom SSL certificates. It may be deployed by the Web Sites installer for dev/test deployments, or provided externally for production deployments.
  • Runtime Database (external)
    Stores the Web Site cloud configuration as well as the configuration for tenant web sites. Centrally storing the configuration allows for dynamic provisioning and management of sites while simultaneously allowing large scale cloud deployments.

Cloud Insight

When building the Web Sites runtime and user interface, we wanted to deliver the same “single pane of glass” for service administrators. We studied the routine activities of cloud admins and realized that there were three primary groups of activities: Server provisioning, cloud health/capacity management, and cloud troubleshooting. To expedite these processes, we created simple ways to complete these tasks within the browser.

Cloud at a Glance

To start, we created a unified view of all Web Sites roles which allows service administrators to view three key elements:
  • All servers participating in the Web Sites cloud
  • The health of these servers
  • The utilization of the various role instances
By consolidating this information into a single view, IT professionals can quickly determine if sufficient capacity is available or if service health is degraded.
clip_image033

Managed Provisioning

Should the cloud require additional capacity, the administrator can quickly add additional role instances. Web Sites fully automates deployment and configuration of the runtime onto new machines to seamlessly remediate capacity constraints. To illustrate this functionality, we’ll demonstrate how to provision an additional Small Reserved Instance to deliver additional capacity to developers using the Small Reserved Instance tier of service.
First, click the “Add Role” button, and then select the appropriate role type (Web Worker).
clip_image035
Next, provide the server the name of the machine to be added to the cloud. Finally, specify the worker type.
With a machine name and role type, we can now complete the provisioning and configuration process without further intervention.
clip_image037

Plan/Add-on Authoring

Service administrators also need to define a service catalog to govern resource consumption and employ chargeback/billing for cloud usage. To facilitate this, the Web Sites service provides a robust experience for defining base packages of services (Plans) and incremental capabilities (Add-ons). With this flexibility, administrators can author a comprehensive catalog to meet the differing SLAs of different developers.

Creating a Plan

From the service administrator dashboard, we will start by selecting New, then Plan.
Next, the service administrator must provide a name for a plan.
clip_image039
Then, he/she must select which services are included in the plan and determine which cloud for each service is included in the plan.
clip_image041
Now, the administrator can customize the quotas for each service included in the plans. We will edit the quotas for the Web Sites service.
clip_image043
Once this is complete, the administrator can define resource consumption limits for the plan. Typical resource types, such as CPU time, Memory, Bandwidth, and Storage are all present. In addition, specific features can also be enabled or disabled; this includes custom domain, SSL, WebSocket, 64-bit support, etc.
clip_image045
By customizing plans and add-ons, Web Sites gives the service administrator strict control of how service consumers can use the service. This gives tremendous control over the services provided through a service catalog and also governs usage reporting consumed by chargeback and billing solutions.
* * *


The Web Site service in the Windows Azure Pack has been built from the ground up to provide developers with a flexible, scalable, and secure platform for hosting modern applications.
As Web Sites is built from the same source code as the Windows Azure service, the Windows Azure Pack provides highly consistent experiences with the Microsoft-operated Windows Azure Web Sites service. For administrators, we have taken knowledge gained from operating our cloud to improve operational efficiency.
Give it a try. The bits and documentation can be found here.
- Brad

NEXT STEPS

What’s New in 2012 R2: Enabling Modern Apps with the Windows Azure Pack

Blog-Header_Graphic_ModernApps
Part 8 of a 9-part series.
Don’t let the title fool you – this post is critically important for Developers and IT pros.
The reason I call out this warning up front is that often, when I’m speaking at conferences around the world, as soon as I start to discuss the developer perspective and developer tools, many IT Pros in the room starts playing Angry Birds while they wait for the developer section to be over.
Why is it so important for IT Pros to understand how modern applications are built? The answer is simple: IT Pros are the ones who build and operate the infrastructure that hosts these applications, and, the more you know about how these applications are built, the better you will understand their platform requirements.
That’s the tactical reason. There is also a strategic reason.
If your organization is not already in the process of defining it’s cloud strategy – it soon will be. You need to be a contributor and leader in these conversations. By mastering today’s topics, you can become a part of the conversation and define the long-term solution, rather than someone who is simply reacting to decisions they were not a part of making.
The future of the IT Pro role will require you to know how applications are built for the cloud, as well as the cloud infrastructures where these apps operate, is something every IT Pro needs in order to be a voice in the meetings that will define an organization’s cloud strategy. IT pros are also going to need to know how their team fits in this cloud-centric model, as well as how to proactively drive these discussions.
These R2 posts will get you what you need, and this “Enable Modern Business Apps” pillar will be particularly helpful.
Throughout the posts in this series we have spoken about the importance of consistency across private, hosted and public clouds, and we’ve examined how Microsoft is unique in its vision and execution of delivering consistent clouds. The Windows Azure Packis a wonderful example of Microsoft innovating in the public cloud and then bringing the benefits of that innovation to your datacenter.
The Windows Azure Pack is – literally speaking – a set of capabilities that we have battle-hardened and proven in our public cloud. These capabilities are now made available for you to enhance your cloud and ensure that “consistency across clouds” that we believe is so important.
A major benefit of the Windows Azure Pack is the ability to build an application once and then deploy and operate it in any Microsoft Cloud – private, hosted or public.
This kind of flexibility means that you can build an application, initially deploy it in your private cloud, and then, if you want to move that app to a Service Provider or Azure in the future, you can do it without having to modify the application. Making tasks like this simple is a major part of our promise around cloud consistency, and it is something only Microsoft (not VMware, not AWS) can deliver.
This ability to migrate an app between these environments means that your apps and your data are never locked in to a single cloud. This allows you to easily adjust as your organization’s needs, regulatory requirements, or any operational conditions change.
A big part of this consistency and connection is the Windows Azure Service Bus which will be a major focus of today’s post.
The Windows Azure Service Bus has been a big part of Windows Azure since 2010. I don’t want to overstate this, but Service Bus has been battle-hardened in Azure for more than 3 years, and now we are delivering it to you to run in your datacenters. To give you a quick idea of how critical Service Bus is for Microsoft, consider this: Service Bus is used in all the billing for Windows Azureand it is responsible for gathering and posting all the scoring and achievement data to the Halo 4 leaderboards (now that is really, really important – just ask my sons!). It goes without saying that the people in charge of Azure billing and the hardcore gamers are not going to tolerate any latency or downtime getting to their data.
With today’s topic, take the time to really appreciate the app development and app platform functionality in this R2 wave. I think you’ll be really excited about how you can plug into this process and lead your organization.
This post, written by Bradley Bartz (Principal Program Manager from Windows Azure) and Ziv Rafalovich (Senior Program Manager in Windows Azure), will get deep into these new features and the amazing scenarios that the Windows Azure Pack and Windows Azure Service Bus enable. As always in this 2012 R2 series, check out the “Next Steps” at the bottom of this for links to additional information about the topics covered in this post.
* * *

When building modern applications, developers want a way to connect multiple tiers of their application as well as a way to consume services offered by third party vendors. Different tiers within modern applications may have different hosting methods,e.g. front-tier components are often written as web applications, while back-end services may be hosted in a virtual machine.
The Windows Server 2012 R2 platform offers multiple hosting alternatives, but there is still a need to enable connectivity between an application’s components and services. One of the common approaches is to exchange messaging using a broker.
Two years ago, we have introduced the Windows Azure Service Bus which provides messaging capabilities in the public cloud. Since its launch we’ve seen multiple scenarios where messaging has been a valuable in addition to the basic back-end/front-end pattern. We’ve seen messaging used to connect clients and devices to a cloud service, as well as scenarios where messaging was used for integration.
Just a year ago we released Service Bus for Windows Server v1.0, which enables a developer to build, test, and run loosely-coupled, message-driven applications in self-managed environments as well as on developer computers.
Now, with the release of Windows Server 2012 R2 (just one year after we released Service Bus 1.0 for Windows Server and introduced the runtime capabilities of brokered messaging on-premises!), we are proud to release the second version of our broker called Service Bus 1.1 for Windows Server.
In this release we have invested in an integrated experience as a part of the Windows Azure Pack, with the goal of bringing a self-service tenant experience that is consistent with the one that currently exists in Windows Azure.
We’ve listened closely to our customers and focused on improving the following 3 core scenarios with the Service Bus 1.1 for Windows Server and the Windows Azure Pack:
  1. Application Messaging Patterns with Service Bus
    With Service Bus we support basic as well as advanced messaging patterns for use in modern applications. With this release we’ve also added new messaging capabilities, additional protocols, and simplified APIs to enable developers to write better applications faster.
  2. Manage Messaging entities across clouds
    Whether you’re developing for the public cloud, private cloud, or a hosted cloud (with your service provider), developers will be able to write applications once and then use it anywhere within these clouds – without needing to recompile. This can be done by simply changing an entry in the configuration file.
  3. Offering Alternatives with Service Bus
    Whether you are an Independent Software Vendor developing software and services for others, an enterprise which deploys home-grown applications, or a developer looking for an easy to deploy messaging component, you can use Service Bus in your topology. With this release we’ve improved the hosting capabilities for enterprises and service providers enabling new hosting topologies.

Scenario 1: Application Messaging Patterns with Service Bus.

To enable a wide variety of messaging scenarios, Service Bus provides message queues and “Publish/Subscribe” topics.
A queue is a message store in which messages are ordered by send date. One or multiple senders can send messages into a queue, and one or multiple receivers can read and remove messages from the queue. Once a receiver has received a message, that message cannot be received by another receiver.
Typically, queues are used for:
  • Load leveling: Receiver can process messages at its own pace.
  • Temporal decoupling: Sender is not blocked if receiver is offline.
  • Load balancing: Multiple receivers compete for messages; auto load balancing.
A topic can have multiple subscriptions and each subscription behaves like a queue. One or multiple senders can send messages into a topic. From there, each message is copied into each of the subscriptions. If receivers receive from different subscriptions, they each get a copy of the message. The user can define filters which determine which message is copied into which subscription.
Typically, topics are used for
  • Message distribution: Deliver the same message to more than one receiver.
  • Message filtering: Subscribers can filter messages according to business logic.
  • Message partitioning: Using filters, receiver get mutually exclusive slices of the message stream.

Messaging with Service Bus: Building Loosely Coupled Application

In a tightly coupled system, if any one of the components fails, the whole system fails and creates bad user experiences. Communication between components is usually based on synchronous or asynchronous calls to perform a task.
For example, consider a retailer application performing calls from a store front-end (web application) to back-end services like shipping and tracking. See Figure 1 below.
clip_image002
Figure 1: Tightly coupled application.
The front-end and back-end applications can be loosely coupled by introducing a message queue. The store front-end sends shipping requests to the queue, and, once a request is queued, the store front-end sends an acknowledgement to the user that confirms the order. The shipping service fetches orders from the queue at its own pace. If a spike of orders arrives and the shipping service falls behind, or if the shipping service is temporarily unavailable, the store frontend is still able to process new orders. At the same time the shipping service can still process orders already in the queue in case the store frontend application is down.
Scaling a loosely coupled application (see Figure 2 and 3 below) is simple. The application may consist of multiple instances of the store frontend or the shipping service. The queue enables multiple senders and receivers to send messages into (or receive messages from) the queue. At the same time the queue guarantees that each message will be processed only once. Monitoring the queue length enables you to determine whether you need to scale your application.
clip_image004
Figure 2: Loosely coupled application.
clip_image006
Figure 3: Scaling a loosely coupled application.

Messaging with Service Bus: Publish-Subscribe Patterns

In some systems the same order must be processed by multiple, independent services. Besides shipping, we may need each order to be processed by a CRM system. Some of the orders are to be processed by the fraud detection system as well. By replacing the queue with a topic and multiple subscriptions our shipping service will continue to receive a copy of each order while the CRM and fraud detection systems receive additional copies of these orders. Since the fraud detection system wants to inspect only a subset of the orders, a filter is defined on the fraud detection’s subscription (see Figure 4 below). The filtering can be done on any property of the order, such as the purchase price.
clip_image008
Figure 4: Publish-subscribe.

Messaging with Service Bus: Cross-Platform Interoperability

Because applications can interface with Service Bus in different ways, it supports three communication protocols:
  • Service Bus Messaging Protocol (SBMP)
    This is a proprietary SOAP-based protocol on TCP that is feature-rich and efficient. The Service Bus Messaging API, which is exposed by the Azure .NET SDK, allows a client application to communicate with Service Bus via SBMP. The Azure .NET SDK also exposes a WCF NetMessagingBinding.
  • Advanced Message Queuing Protocol (AMQP)
    This is an open protocol specified by an international standardization body. Service Bus implements AMQP 1.0, which is the current version of the standard. Similar to SBMP, the Azure .NET SDK allows an application to communicate with Service Bus via AMQP. In addition to the Azure .NET SDK, other third-party client implementations are available for various languages, such as Apache Proton-C, Apache Qpid, or Java/JMS AMQP 1.0 (see Figure 5 below). All AMPQ 1.0 clients can communicate with any messaging server or service that implements AMPQ 1.0. More information on Service Bus and AMQP is available here.
  • HTTP/HTTPS
    This allows a language-agnostic way to access Service Bus. HTTP is available for .NET, Visual Basic, Python, PHP, Java, Node.js, and other languages. All basic Service Bus functionality is available via HTTP/HTTPS. Some of the advanced features, such as sessions, are available only via SBMP or AMQP.
clip_image010
Figure 5: Languages and protocols supported by Service Bus.
Traditionally, message-oriented middleware products have used proprietary protocols for communication between client applications and brokers. This means that once you’ve selected a particular vendor’s messaging broker, you must use that vendor’s libraries to connect your client applications to that broker. This results in a "lock-in" to that vendor since porting an application to a different product requires re-coding all the connected applications.
Furthermore, connecting messaging brokers from different vendors is tricky and typically requires application-level bridging to move messages from one system to another, and to translate between their proprietary message formats.
AMQP 1.0 is an efficient, reliable, wire-level messaging protocol that can be used to build robust, cross-platform, messaging applications. The protocol has a simple goal: Define the mechanics of the secure, reliable, and efficient transfer of messages between two parties.
With the release of Service Bus 1.1, we are happy to announce that AMQP 1.0 support is now available in Service Bus.
Adding the support for AMQP 1.0 messaging protocol enables our customers to experience messaging in new ways. One of the key new scenarios enabled in this release is exchanging messages between applications written in multiple platforms running on multiple Operating Systems.
Figure 6 (see below) demonstrates the rich connectivity patterns that are now enabled by Service Bus.
clip_image012
Figure 6: Connectivity scenario involving various programming languages.

Scenario 2: Manage Messaging Entities Across Clouds

Innovation at the infrastructure layer has made it possible for organizations to start acting like cloud vendors by offering subscription-based IT resources to their business groups. In addition, service providers can now offer more advanced cloud services like Platform-as-a-Service (PaaS) and even Software-as-a-service (SaaS).
In this new world of connected services and mobile workforces, deciding on your cloud strategy can impact the entire organization – not just your IT spending structure.
With Service Bus 1.1 for Windows server and the Windows Azure Pack, we adopted a key principle when it comes to someone’s cloud strategy: consistency in the Service Bus tenant experience across multiple clouds.Consistency in the Service Bus tenant experience across multiple clouds.
In other words, the scenarios revolving Brokered Messaging (like loosely coupling with queues and publish-subscribe with topics) are consistent (but not necessarily identical) across the multiple cloud offerings.
Consistency across clouds takes shapes in various aspects of using Service Bus:
  1. Same Client SDK being used in Windows Azure as well as on-premises.
    Keep in mind that due to the differences in the release cadence, there will be points in time where the latest SDK for Windows Azure is newer than the one supported in a private cloud. Regardless, there will always be a version of the SDK which is supported by both.
  2. Same authorization model for clients based on shared secrets.
    While there are additional authentication mechanisms supported in the public cloud (such as ACS) as well as on-premises (Windows Integrated Security), using shared access secrets is consistent between the offerings.
  3. Switch to the Service Bus of choice with a change of configuration.
    The SDK supports using a connection string in order to connect to Service Bus. This connection string could be read from configuration or fed to the application in runtime.
  4. Self-service tenant portal consistent to the Windows Azure portal.
    A web-based management portal to create your subscription, service bus namespace and entities (queues and topics).
  5. Support for the Windows Azure PowerShell Cmdlets with hosted Service Bus.
Next, we will explain how the Service Bus self-service tenant experience follows the one available in Windows Azure – as well as the consistent experience for the developers’ using Service Bus with their application.

The Tenant Experience

clip_image014
Figure 7: Tenant experience.

Subscriptions, Plans and Service Bus Namespaces

When creating a subscription in the Windows Azure Pack and selecting a plan to use, the tenant portal reflects the services available with this subscription. In the case where the plan chosen had a Service Bus cloud enabled with it (see Figure 8 below), the tenant sees Service Bus available in the portal and can then create a Service Bus namespace. Windows Azure Pack subscriptions and plans where already discussed in one of the earlier posts in this series.
clip_image016
Figure 8: Creating a Service Bus namespace.

Create Service Bus Entities – Queues and Topics

In order to create messaging entities such as queues and topics, Service Bus requires you to create a namespace first. A service namespace is used for addressing, isolation, and management the underlying messaging entities. All Service Bus messaging entities are created within the scope of a service namespace.
Creating a queue with the self-service portal is easy and straightforward. With the ‘quick create’ function you simply specify the name of the queue as well as the name of the namespace (see Figure 9 below). This quick create experience will create a new namespace in case one is not already selected.
clip_image018
Figure 9: Creating Service Bus queues and topics.

Set Permissions at the Level of a Queue

Service Bus 1.1 for Windows Server supports configuring authentication using the following:
  • Windows Integrated Security to authenticate users based on their domain credentials.
  • Shared Access Secrets to authenticate users based on a shared secret.
Service bus support authorization rules at two levels:
  1. Namespace level authorization is applicable to all entities (queues and topics) defined in the scope of this namespace.
  2. Entity level authorization is scoped to a single entity. Use entity level authorization in integration scenarios where an application needs access to a subset of the entities in the namespace.
Each authorization rule includes one (or more) permissions, including: Manage, Send, and Listen (see Figure 10 below).
clip_image020
Figure 10: Defining authorization rules for the entities of a namespace.

Basic Queue Monitoring

When creating a messaging entity, applications may send and receive messages. The self-service tenant portal exposes basic monitoring attributes for each entity such as length and last accessed time, which indicate when a message was sent or received (see Figure 11 below).
For more advanced queries you can use the Service Bus API to issue queries like: “Get me all queues which have more than 10 messages.”
clip_image022
Figure 11: Monitoring queues or topics.

The Developer Experience

Consistency within public and private clouds begins by using the same client SDK when developing applications with Service Bus. In fact, you don’t need to change your application or rebuild it if you wish to switch between environments. In other words, by changing a single entry in a configuration file, you select which broker to use: Private, hosted, or public cloud.
In addition, Service Bus 1.1 for Windows Server supports a local deployment for development purposes only where you install Service Bus locally on a client Operating System using an Express Database.
A Complete End-to-End experience sample can be found here.

Connecting to Service Bus

As mentioned above, a single configuration entry specifies which broker to use. We call it the Service Bus connection string. When creating a new project in Visual Studio and adding a reference to the Service Bus SDK via the NuGet Package Manager, a new entry is added to your configuration files (app.config or web.config) with an empty connection string.
When deploying the application, you will replace the connection string with the one pointing to your Service Bus cloud, namespace, as well as security settings.

  <appSettings>
    <!-- Service Bus specific app settings for messaging connections -->
    <add key="Microsoft.ServiceBus.ConnectionString"value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]/>
  </appSettings>

Sending Messages

While Service Bus offers many advanced messaging features, the simplest scenario is sending and receiving messages.
Sending a message requires the application to connect to Service Bus by using the connection string as well as providing an entity (queue or topic) to send the message to. The following example uses the connection string provided in the configuration file to connect to a topic whose name is specified in a local variable.
// creates a topic client with a provided topic name. 
TopicClient topicClient = TopicClient.Create(ServiceBusTopicName);
// creates a simple brokered message and send it over.
topicClient.Send(new BrokeredMessage("Hello World"));

Note that the topic needs to be created prior to using it. This

Receiving Messages

When sending a message to a queue or topic it remains there waiting to be consumed (received). With Service Bus 1.1 for Windows Server and the Windows Azure Pack, we have simplified the way an application receives messages, and we have introduced an event-driven programing model. In this model, you specify what is expected to be done with messages and the SDK takes care of the rest.
The following code snippet shows the simplest way to consume messages from a Service Bus subscription.
SubscriptionClient subsClient = SubscriptionClient.Create(ServiceBusTopicName, subsName);
subsClient.OnMessage((receivedMessage) =>             
{                                 
      Console.WriteLine(string.Format("Processing recived Message: Id = {0}, Body = {1}",
receivedMessage.MessageId, receivedMessage.GetBody<string>()));            
});

Note that this not a complete sample. For example, it lacks exception handling as well as performance optimization. Still, it demonstrates just how simple it is to consume messages from Service Bus.

Scenario 3: Hosting Alternatives with Service Bus

With the release of Windows Server 2012 R2 and the Windows Azure Pack, we’ve identified several key deployment scenarios where Service Bus was used:
  1. Locally Hosted & Managed This scenario is found within enterprises where a local IT team manages multiple deployments and each is dedicated for a different application or business unit. This scenario is the first time an administrator experience is separated from the tenant’s.
  2. Shared across multiple applications
    This is a common scenario with larger organizations where multiple applications are using the same Service Bus instance. In this scenario applications may, or may not, exchange messages between themselves. This topology calls for scaling the Service Bus deployment as well as introducing multiple tenants to Service Bus management.
  3. Hosted & Dedicated in a Public Cloud
    In this scenario, hosters who provide IT services are looking for ways to offer PaaS services including messages. As a part of the Windows Azure Pack, Service Bus supports managing multiple deployments from a single portal, separation of a service provider from a tenant portal experience, as well as plans and subscriptions to create isolation between tenants.
In addition, customers are also looking for a ‘self-hosted’ broker in the following cases:
  1. Developers Environment
    Service Bus is hosted on a developer’s machine (potentially virtual) to enable applications development in a local environment. The challenge in such a topology is to enable a lightweight deployment which includes the runtime components only.
  2. Embedded with the application
    In this scenario Software Vendors deploy their solution (including Service Bus) on dedicated servers. In addition to a lightweight deployment of runtime messages only, this topology requires a way to automate Service Bus deployment and management with scripts and APIs.
In addition to the topologies mentioned above, Service Bus is fully supported by the Windows Azure Infrastructure-as-a-Service (IaaS) including support for SQL Azure.
Next, we will explain how the Service Bus architecture fits into the Windows Azure Pack overall architecture while still enabling a lightweight deployment of the messaging runtime components. We will also describe how the Service Provider experience supports hosted scenarios (either shared or dedicated).

Service Bus Architecture

clip_image027
Figure 12: Service Bus architecture.
Some key requirements of the Service Bus architecture include:
  • Service Bus requires a 2008 R2 SP1 or higher 64-bit Microsoft Operating System.
  • Additional platform components are Microsoft .NET Framework 4.0 PU3 and Windows PowerShell 3.0.
  • Being a durable messages store, Service Bus requires SQL Server 2008 R2 SP2 or higher.
  • Service Bus setup installs the following local services: Windows Fabric, Service Bus Gateway, Message Broker, and the Service Bus Management APIs (resource provider).
  • External management components such as the Windows Azure Pack are potentially installed separately on a different server.

The Service Provider Experience

With Service Bus 1.1 for Windows Server and the Windows Azure Pack, we introduced the service provider experience.
In previous releases, we supported an administrator with a set of PowerShell CmdLets for configuration and a Management Pack for monitoring. As we began to plan for R2, customer feedback was clear: They wanted a self-service experience for their tenants and they needed a way to manage multiple deployments with different scale and SLA – and they wanted this all under the same portal.
With these needs in mind, we have aligned the service provider experience of Service Bus with the rest of the services enabled in the Windows Azure Pack by providing the following capabilities:
  • Automated deployment of a new Service Bus cloud while selecting resource pools to use for compute, as well as databases providing different level of SLAs.
  • The ability to glimpse Service Bus health, scale, and usage in the service provider’s portal.
  • Support for offers and tenant subscriptions by adding Service Bus resources to the Windows Azure Pack plan.
The Service Provider experience, which has already been discussed here, consists of the following three steps (see Figure 13 below):
  1. Deploy the Windows Azure Pack and enable the administrator’s portal as well as tenant’s portal.
  2. Service Bus cloud setup (either automated or manual) and the creation of a trust relationship between Service Bus cloud and the portal.
  3. Author a plan and add Service Bus resources (which cloud to use).
clip_image029
Figure 13: Service provider experience.

Connect to an Existing Service Bus Cloud

As noted above, you may be automating the deployment of a Service Bus with the Windows Azure Pack automation capabilities. However, in case you are manually installing Service Bus, or even upgrading from an older version, you need to connect your Service Bus deployment with the Service Provider’s portal.
From the portal’s main screen, just click ‘New’ followed by ‘Service Bus Cloud’ to select a Service Bus cloud to connect (see Figure 14 below).
clip_image031
Figure 14: Connecting to an existing Service Bus cloud.
Like all the Windows Azure Pack services, Service Bus exposes two sets of REST APIs to be used by the Windows Azure Pack portals. These APIs are authenticated with two sets of credentials which you need to provide when connecting to a Service Bus cloud.

Basic Health Monitoring of a Service Bus Cloud

When connecting a Service Bus cloud to the Service Provider portal (see Figure 15 below), an administrator can list all the clouds, see basic health data from each node, and monitor the messaging databases for health and space (see Figure 16 below).
clip_image033
Figure 15: Connecting to a Service Bus cloud.
clip_image035
Figure 16: Monitoring Service Bus messaging databases.

Monitor Service Bus Health with System Center Operations Manager

Like many other cloud services, health monitoring of Service Bus is available with System Center Operations Manager (see Figure 17 below). The Service Bus Management Pack monitors the cloud’s health including status/underlying databases, hosts, and services.
Based on a rich set of monitoring rules and built-in alerts, with System Center Operations Manager an administrator is able to detect service related issues and their root cause.
clip_image037
Figure 17: Monitoring Service Bus in System Center.


Next Steps