2. What are we going to learn?
• How Visual Studio deploys under the covers
• How to use tools and scripts to automate parts of
the deployment
• How to monitor asynchronous operations in a
deployment
• The fundamentals of how we interact Azure
beneath all of the libraries and layers of
abstraction
• A small part of the Service Management API –
there is much more SO does this interest me
enough to work on a group Codeplex project?
3. What can I manage?
• Hosted services
• Storage accounts
• Affinity groups
• Security (X509v3 certificates)
• Subscription history
• Access Control Services
4. What tools can I use to manage?
• The management portal!
• Windows Azure Powershell CmdLets
• The Azure MMC SnapIn
• Visual Studio.NET
• Third party tools such as those by Neudesic,
Cerebrata, Paraleap and others
• An RDP Client
• Any device!
5. What do we mean by Management?
• Create-Read-Update-Delete (CRUD)
• Manage transaction security
• Checking full audit history
• Locations and “affinity groups”
• Accessing and managing storage accounts
• Track asynchronous long running operations
• Get information about the host operating
• Managing Access Control Services
6. Management API details
• RESTful (REpresentational State Transfer)
• Use of OData (ACS Management)
• Use of HTTP and multiple verbs
– GET, PUT, POST, DELETE
• Endpoints are HTTPS protecting data in transit
• Each request needs a “Management
Certificate” attached for authentication
purposes
7. Management Examples (CRUD)
• Listing hosted services
– GET http://management.core.windows.net/[subscription
id]/services/hostedservices HTTP/1.1
• Creating a hosted service
– POST http://management.core.windows.net/[subscription
id]/services/hostedservices HTTP/1.1
• Deleting a hosted service
– DELETE http://management.core.windows.net/[subscription
id]/services/hostedservices/[SERVICE NAME] HTTP/1.1
• Updating a hosted Service
– PUT http://management.core.windows.net/[subscription
id]/services/hostedservices/[SERVICE NAME] HTTP/1.1
8. What else goes into the request?
• Header x-ms-version: 2011-10-01
• Content-type: application/xml
• X509v3 certificate
• Either blank request OR
• XML Document with well known schema
10. My Request Message
<?xml version="1.0" encoding="utf-8"?>
<CreateHostedService
xmlns="http://schemas.microsoft.com/windowsazure">
<ServiceName>lwaugtest1.bad</ServiceName>
<Label>djE=</Label>
<Description>this is the first test service for the user
group</Description>
<Location>North Europe</Location>
</CreateHostedService>
11. My Response Exception
HTTP/1.1 400 Bad Request
Content-Length: 194
Content-Type: application/xml; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: 3badf9cdddc540cd922993fa01598297
Date: Mon, 05 Dec 2011 18:16:45 GMT
<Error xmlns="http://schemas.microsoft.com/windowsazure"
xmlns:i="http://www.w3.org/2001/XMLSchema-
instance"><Code>BadRequest</Code><Message>The hosted
service name is invalid.</Message></Error>
13. Steps to Using Powershell CmdLets to
Deploy
• Generate a certificate with the following command:
– makecert -r -pe -n "CN=Richard's New Cert" -a sha1 -len 2048 -ss My "C:richard2.cer“
• Add the certificate through the management portal
• Open powershell after CmdLets are installed and enter:
– Add-PSSnapin AzureManagementToolsSnapIn
• Create new Blob container via Storage Services API
• Upload .cspkg to Blob Storage
• Enter the following into Powershell:
– New-Deployment -serviceName lwaugtestone -subscriptionId edd1c493-f3f5-42d0-ba03-
7bf1eb2cfcaa -certificate (get-item
cert:CurrentUserMY7A67E9C2225C4930CBFCEF869C993EB560A3B1A4) -slot production –
package http://lwaugbe.blob.core.windows.net/packages/HelloCloud.cspkg -configuration
"C:ProjectsTech ProjectsLondon Windows Azure User
GroupHelloCloudHelloCloudbinReleaseapp.publishServiceConfiguration.Cloud.cscfg" -
label lwaugtestone
• Followed by:
– Set-DeploymentStatus -subscriptionId edd1c493-f3f5-42d0-ba03-7bf1eb2cfcaa -certificate
(get-item cert:CurrentUserMY7A67E9C2225C4930CBFCEF869C993EB560A3B1A4) -
ServiceName lwaugtestone -Status Running -slot Production
15. Steps to Using Fiddler and Azure
• Use Request Builder
• Add certificate file to C:UsersxxxMy
DocsFiddler2ClientCertificate.cer
• Add the ms-version-x header
• Request the following:
– GET https://management.core.windows.net/edd1c493-f3f5-
42d0-ba03-7bf1eb2cfcaa/operations/[token] HTTP/1.1
• Look for an InProgress or Succeeded response
16. Summary
• Service Management is web friendly, open, platform
independent and standardised
• There are a variety of tools and APIs available to manage
services
• RESTful services mean you can manage from ANY client
application
• Ability to create complex continuous integration testing
scenarios and deployments with staging and production
environments
• Ability to manage multiple subscriptions simultaneously
• No real constraint on the activities that can be
accomplished
• All transactions are fully secure
17. http://azuresm.codeplex.com
Azure Service Manager is an enterprise application
which provides an subscriber-based API through WCF
to allow clients to collect information on multiple
Azure subscriptions, including hosted services, SQL
Azure and storage services. It provides service, usage
and billing data.