PageRenderTime 87ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/DevCenter/dotNET/Tutorials/hybrid-solution.md

https://github.com/mattshel/azure-content
Markdown | 793 lines | 599 code | 194 blank | 0 comment | 0 complexity | b1dfe1a2fa897cd01b53cd7b59e13aad MD5 | raw file
  1. <properties linkid="dev-net-tutorials-hybrid-solution" urlDisplayName="Hybrid Application" pageTitle="Hybrid On-Premises/ Cloud Application (.NET) - Windows Azure" metaKeywords="Azure Service Bus tutorial hybrid .NET" metaDescription="Learn how to create a .NET On-Premises/Cloud Hybrid Application Using the Windows Azure Service Bus Relay." metaCanonical="" disqusComments="1" umbracoNaviHide="1" />
  2. <div chunk="../chunks/article-left-menu.md" />
  3. # .NET On-Premises/Cloud Hybrid Application Using Service Bus Relay
  4. <h2><span class="short-header">INTRODUCTION</span>INTRODUCTION</h2>
  5. Developing hybrid cloud applications with Windows Azure is easy using
  6. Visual Studio 2012 and the free Windows Azure SDK for .NET. This guide
  7. assumes you have no prior experience using Windows Azure. In less than
  8. 30 minutes, you will have an application that uses multiple Windows
  9. Azure resources up and running in the cloud.
  10. You will learn:
  11. - How to create or adapt an existing web service for consumption by a
  12. web solution.
  13. - How to use the Windows Azure Service Bus relay to share data between
  14. a Windows Azure application and a web service hosted elsewhere.
  15. <div chunk="../../Shared/Chunks/create-account-note.md" />
  16. ### HOW THE SERVICE BUS RELAY HELPS WITH HYBRID SOLUTIONS
  17. Business solutions are typically composed of a combination of custom
  18. code written to tackle new and unique business requirements and existing
  19. functionality provided by solutions and systems that are already in
  20. place.
  21. Solution architects are starting to use the cloud for easier handling of
  22. scale requirements and lower operational costs. In doing so, they find
  23. that existing service assets theyd like to leverage as building blocks
  24. for their solutions are inside the corporate firewall and out of easy
  25. reach for access by the cloud solution. Many internal services are not
  26. built or hosted in a way that they can be easily exposed at the
  27. corporate network edge.
  28. The *Service Bus relay* is designed for the use-case of taking existing
  29. Windows Communication Foundation (WCF) web services and making those
  30. services securely accessible to solutions that reside outside the
  31. corporate perimeter without requiring intrusive changes to the corporate
  32. network infrastructure. Such Service Bus relay services are still hosted
  33. inside their existing environment, but they delegate listening for
  34. incoming sessions and requests to the cloud-hosted Service Bus. The
  35. Service Bus also protects those services from unauthorized access by
  36. using Windows Azure Active Directory Access Control.
  37. ### THE SOLUTION SCENARIO
  38. In this tutorial, you will create an ASP.NET MVC 3 web site that will
  39. allow you to see a list of products on the product inventory page.
  40. ![][0]
  41. The tutorial assumes that you have product information in an existing
  42. on-premises system, and uses the Service Bus relay to reach into that
  43. system. This is simulated by a web service that is running in a simple
  44. console application and is backed by an in-memory set of products. You
  45. will be able to run this console application on your own computer and
  46. deploy the web role into Windows Azure. By doing so, you will see how
  47. the web role running in the Windows Azure datacenter will indeed call
  48. into your computer, even though your computer will almost certainly
  49. reside behind at least one firewall and a network address translation
  50. (NAT) layer.
  51. A screenshot of the start page of the completed web application is
  52. below.
  53. ![][1]
  54. <h2><span class="short-header">SET UP THE ENVIRONMENT</span>SET UP THE DEVELOPMENT ENVIRONMENT</h2>
  55. Before you can begin developing your Windows Azure application, you need
  56. to get the tools and set-up your development environment.
  57. 1. To install the Windows Azure SDK for .NET, click the button below:
  58. [Get Tools and SDK][]
  59. 2. Click **install the SDK**.
  60. 3. Choose the link for the version of Visual Studio you are using. The steps in this tutorial use Visual Studio 2012:
  61. ![][42]
  62. 4. When prompted to run or save **WindowsAzureSDKForNet.exe**, click
  63. **Run**:
  64. ![][2]
  65. 5. In the Web Platform Installer, click **Install** and proceed with the installation:
  66. ![][3]
  67. 6. Once the installation is complete, you will have everything
  68. necessary to start developing. The SDK includes tools that let you
  69. easily develop Windows Azure applications in Visual Studio. If you
  70. do not have Visual Studio installed, it also installs the free
  71. Visual Web Developer Express.
  72. <h2><span class="short-header">CREATE A NAMESPACE</span>CREATE A SERVICE NAMESPACE</h2>
  73. To begin using Service Bus features in Windows Azure, you must first
  74. create a service namespace. A service namespace provides a scoping
  75. container for addressing Service Bus resources within your application.
  76. To create a service namespace:
  77. 1. Log on to the [Windows Azure Management Portal][].
  78. 2. In the left navigation pane of the Management Portal, click
  79. **Service Bus**.
  80. 3. In the lower pane of the Management Portal, click **Create**.
  81. ![][5]
  82. 4. In the **Add a new namespace** dialog, enter a namespace name.
  83. The system immediately checks to see if the name is available.
  84. ![][6]
  85. 5. After making sure the namespace name is available, choose the
  86. country or region in which your namespace should be hosted (make
  87. sure you use the same country/region in which you are deploying your
  88. compute resources).
  89. IMPORTANT: Pick the **same region** that you intend to choose for
  90. deploying your application. This will give you the best performance.
  91. 6. Click the check mark. The system now creates your service
  92. namespace and enables it. You might have to wait several minutes as
  93. the system provisions resources for your account.
  94. ![][38]
  95. The namespace you created will then appear in the Management Portal and
  96. takes a moment to activate. Wait until the status is **Active** before
  97. moving on.
  98. <h2><span class="short-header">OBTAIN MANAGEMENT CREDENTIALS</span>OBTAIN THE DEFAULT MANAGEMENT CREDENTIALS FOR THE NAMESPACE</h2>
  99. In order to perform management operations, such as creating a queue, on
  100. the new namespace, you need to obtain the management credentials for the
  101. namespace.
  102. 1. In the main window, click the name of your service namespace.
  103. ![][39]
  104. 2. Click **Access Key**.
  105. ![][40]
  106. 3. In the **Connect to your namespace** pane, find the **Default Issuer** and **Default Key** entries.
  107. 4. Make a note of the key, or copy it to the clipboard.
  108. <h2><span class="short-header">CREATE AN ON-PREMISES SERVER</span>CREATE AN ON-PREMISES SERVER</h2>
  109. First, you will build a (mock) on-premises product catalog system. It
  110. will be fairly simple; you can see this as representing an actual
  111. on-premises product catalog system with a complete service surface that
  112. were trying to integrate.
  113. This project will start as a Visual Studio console application. The
  114. project uses the Service Bus NuGet package to include the service bus
  115. libraries and configuration settings. The NuGet Visual Studio extension
  116. makes it easy to install and update libraries and tools in Visual Studio
  117. and Visual Web Developer. The Service Bus NuGet package is the easiest
  118. way to get the Service Bus API and to configure your application with
  119. all of the Service Bus dependencies. For details about using NuGet and
  120. the Service Bus package, see [Using the NuGet Service Bus Package][].
  121. ### CREATE THE PROJECT
  122. 1. Using administrator privileges, launch either Microsoft Visual
  123. Studio 2012 or Microsoft Visual Web Developer Express. To
  124. launch Visual Studio with administrator privileges, right-click
  125. **Microsoft Visual Studio 2012 (or Microsoft Visual Web Developer
  126. Express)** and then click **Run as administrator**.
  127. 2. In Visual Studio, on the **File** menu, click **New**, and then
  128. click **Project**.
  129. ![][10]
  130. 3. From **Installed Templates**, under **Visual C#**, click **Console
  131. Application**. In the **Name** box, type the name
  132. **ProductsServer**:
  133. ![][11]
  134. 4. Click **OK** to create the **ProductsServer** project.
  135. 5. In the **Solution Explorer**, right-click **ProductsServer**, then
  136. click **Properties**.
  137. 6. Click the **Application** tab on the left, then ensure that **.NET
  138. Framework 4** appears in the **Target framework:** dropdown. If not, select it from the dropdown and then click **Yes**
  139. when prompted to reload the project.
  140. ![][12]
  141. 7. In **Solution Explorer**, right-click **References**, then click
  142. **Manage NuGet Packages**...
  143. 8. Search for **WindowsAzure** and select the **Windows
  144. Azure Service Bus** item. Click **Install** to complete the
  145. installation, then close this dialog.
  146. ![][13]
  147. Note that the required client assemblies are now referenced.
  148. 9. Add a new class for your product contract. In **Solution Explorer**,
  149. right click **ProductsServer** and click **Add**, then click
  150. **Class**.
  151. ![][14]
  152. 10. In the **Name** box, type the name **ProductsContract.cs**. Then
  153. click **Add**.
  154. 11. In **ProductsContract.cs**, replace the namespace definition with
  155. the following code, which defines the contract for the service:
  156. namespace ProductsServer
  157. {
  158. using System.Collections.Generic;
  159. using System.Runtime.Serialization;
  160. using System.ServiceModel;
  161. // Define the data contract for the service
  162. [DataContract]
  163. // Declare the serializable properties
  164. public class ProductData
  165. {
  166. [DataMember]
  167. public string Id { get; set; }
  168. [DataMember]
  169. public string Name { get; set; }
  170. [DataMember]
  171. public string Quantity { get; set; }
  172. }
  173. // Define the service contract.
  174. [ServiceContract]
  175. interface IProducts
  176. {
  177. [OperationContract]
  178. IList<ProductData> GetProducts();
  179. }
  180. interface IProductsChannel : IProducts, IClientChannel
  181. {
  182. }
  183. }
  184. 12. In Program.cs, replace the namespace definition with the following
  185. code, which adds the profile service and the host for it:
  186. namespace ProductsServer
  187. {
  188. using System;
  189. using System.Linq;
  190. using System.Collections.Generic;
  191. using System.ServiceModel;
  192. // Implement the IProducts interface
  193. class ProductsService : IProducts
  194. {
  195. // Populate array of products for display on Web site
  196. ProductData[] products =
  197. new []
  198. {
  199. new ProductData{ Id = "1", Name = "Rock",
  200. Quantity = "1"},
  201. new ProductData{ Id = "2", Name = "Paper",
  202. Quantity = "3"},
  203. new ProductData{ Id = "3", Name = "Scissors",
  204. Quantity = "5"},
  205. new ProductData{ Id = "4", Name = "Well",
  206. Quantity = "2500"},
  207. };
  208. // Display a message in the service console application
  209. // when the list of products is retrieved
  210. public IList<ProductData> GetProducts()
  211. {
  212. Console.WriteLine("GetProducts called.");
  213. return products;
  214. }
  215. }
  216. class Program
  217. {
  218. // Define the Main() function in the service application
  219. static void Main(string[] args)
  220. {
  221. var sh = new ServiceHost(typeof(ProductsService));
  222. sh.Open();
  223. Console.WriteLine("Press ENTER to close");
  224. Console.ReadLine();
  225. sh.Close();
  226. }
  227. }
  228. }
  229. 13. In **Solution Explorer**, double click the **app.config** file to
  230. open it in the **Visual Studio** editor. Replace the contents of
  231. **&lt;system.ServiceModel>** with the following XML code. Be sure to
  232. replace *yourServiceNamespace* with the name of your service
  233. namespace, and *yourIssuerSecret* with the key you retrieved earlier
  234. from the Windows Azure Management Portal:
  235. <system.serviceModel>
  236. <extensions>
  237. <behaviorExtensions>
  238. <add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  239. </behaviorExtensions>
  240. <bindingExtensions>
  241. <add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  242. </bindingExtensions>
  243. </extensions>
  244. <services>
  245. <service name="ProductsServer.ProductsService">
  246. <endpoint address="sb://yourServiceNamespace.servicebus.windows.net/products" binding="netTcpRelayBinding" contract="ProductsServer.IProducts"
  247. behaviorConfiguration="products"/>
  248. </service>
  249. </services>
  250. <behaviors>
  251. <endpointBehaviors>
  252. <behavior name="products">
  253. <transportClientEndpointBehavior>
  254. <tokenProvider>
  255. <sharedSecret issuerName="owner" issuerSecret="yourIssuerSecret" />
  256. </tokenProvider>
  257. </transportClientEndpointBehavior>
  258. </behavior>
  259. </endpointBehaviors>
  260. </behaviors>
  261. </system.serviceModel>
  262. 14. Press **F6** to build the application to verify the accuracy of your
  263. work so far.
  264. <h2><span class="short-header">CREATE AN ASP.NET APPLICATION</span>CREATE AN ASP.NET MVC 3 APPLICATION</h2>
  265. In this section you will build a simple MVC 4 application that will
  266. display data retrieved from your product service.
  267. ### CREATE THE PROJECT
  268. 1. Using administrator privileges, launch either Microsoft Visual
  269. Studio 2012 or Microsoft Visual Web Developer Express. To
  270. launch Visual Studio with administrator privileges, right-click
  271. **Microsoft Visual Studio 2012 (or Microsoft Visual Web Developer
  272. Express)** and then click Run as administrator. The Windows
  273. Azure compute emulator, discussed later in this guide, requires that
  274. Visual Studio be launched with administrator privileges.
  275. 2. In Visual Studio, on the **File** menu, click **New**, and then
  276. click **Project**.
  277. 3. From **Installed Templates**, under **Visual C#**, click **ASP.NET
  278. MVC 4 Web Application**. Name the project **ProductsPortal**. Then
  279. click **OK**.
  280. ![][15]
  281. 4. From the **Select a template** list, click **Internet Application**,
  282. then click **OK**.
  283. ![][16]
  284. 5. In **Solution Explorer**, right click **Models** and click **Add**,
  285. then click **Class**. In the **Name** box, type the name
  286. **Product.cs**. Then click **Add**.
  287. ![][17]
  288. ### MODIFY THE WEB APPLICATION
  289. 1. In the Product.cs file in Visual Studio, replace the existing
  290. namespace definition with the following code:
  291. // Declare properties for the products inventory
  292. namespace ProductsWeb.Models
  293. {
  294. public class Product
  295. {
  296. public string Id { get; set; }
  297. public string Name { get; set; }
  298. public string Quantity { get; set; }
  299. }
  300. }
  301. 2. In the HomeController.cs file in Visual Studio, replace the existing
  302. namespace definition with the following code:
  303. namespace ProductsWeb.Controllers
  304. {
  305. using System.Collections.Generic;
  306. using System.Web.Mvc;
  307. using Models;
  308. public class HomeController : Controller
  309. {
  310. // Return a view of the products inventory
  311. public ActionResult Index(string Identifier, string ProductName)
  312. {
  313. var products = new List<Product>
  314. {new Product {Id = Identifier, Name = ProductName}};
  315. return View();
  316. }
  317. }
  318. }
  319. 3. In the **Solution Explorer**, expand Views\Shared:
  320. ![][18]
  321. 4. Next, double-click _Layout.cshtml to open it in the Visual Studio editor.
  322. 5. Within the body tag, find the title of the page enclosed in `title` tags.
  323. Change the title text from My MVC Application to LITWARE's Products. Also change **your logo here** to **LITWARE's Products**.
  324. 6. Remove the **Home**, **About**, and **Contact** links. Delete the highlighted code:
  325. ![][41]
  326. 7. In **Solution Explorer**, expand Views\Home:
  327. ![][20]
  328. 8. Double-click Index.cshtml to open it in the Visual Studio editor.
  329. Replace the entire contents of the file with the following code:
  330. @model IEnumerable<ProductsPortal.Models.Product>
  331. @{
  332. ViewBag.Title = "Index";
  333. }
  334. <h2>Prod Inventory</h2>
  335. <table>
  336. <tr>
  337. <th>
  338. @Html.DisplayNameFor(model => model.Name)
  339. </th>
  340. <th>
  341. @Html.DisplayNameFor(model => model.Quantity)
  342. </th>
  343. </tr>
  344. @foreach (var item in Model) {
  345. <tr>
  346. <td>
  347. @Html.DisplayFor(modelItem => item.Name)
  348. </td>
  349. <td>
  350. @Html.DisplayFor(modelItem => item.Quantity)
  351. </td>
  352. </tr>
  353. }
  354. </table>
  355. 9. To verify the accuracy of your work so far, you can press **F6** or
  356. **Ctrl+Shift+B** to build the project.
  357. ### RUN YOUR APPLICATION LOCALLY
  358. Run the application to verify that it works.
  359. 1. Ensure that **ProductsPortal** is the active project. Right-click
  360. the project name in **Solution Explorer** and select **Set As
  361. Startup Project**
  362. 2. Within **Visual Studio**, press **F5**.
  363. 3. Your application should appear running in a browser:
  364. ![][21]
  365. <h2><span class="short-header">DEPLOY TO WINDOWS AZURE</span>MAKE YOUR APPLICATION READY TO DEPLOY TO WINDOWS AZURE</h2>
  366. Now, you will prepare your application to run in a Windows Azure
  367. hosted service. Your application already includes a Windows Azure
  368. deployment project. The deployment project contains configuration
  369. information that is needed to properly run your application in the
  370. cloud.
  371. 1. To make your application deployable to the cloud, right-click
  372. the **ProductsPortal** project in **Solution Explorer** and
  373. click **Add Windows Azure Deployment Project**.
  374. ![][22]
  375. 2. To test your application, press **F5**.
  376. 3. This will start the Windows Azure compute emulator. The compute
  377. emulator uses the local computer to emulate your application
  378. running in Windows Azure. You can confirm the emulator has
  379. started by looking at the system tray:
  380. ![][23]
  381. 4. A browser will still display your application running locally,
  382. and it will look and function the same way it did when you ran
  383. it earlier as a regular ASP.NET MVC 3 application.
  384. <h2><span class="short-header">PUT THE PIECES TOGETHER</span>PUT THE PIECES TOGETHER</h2>
  385. The next step is to hook up the on-premises products server with the
  386. ASP.NET MVC3 application.
  387. 1. If it is not already open, in Visual Studio re-open the
  388. **ProductsPortal** project you created in the "Creating an
  389. ASP.NET MVC 3 Application" section.
  390. 2. Similar to the step in the "Create an On-Premises Server"
  391. section, add the NuGet package to the project References. In
  392. Solution Explorer, right-click **References**, then click
  393. **Manage NuGet Packages**.
  394. 3. Search for "WindowsAzure.ServiceBus" and select the **Windows
  395. Azure Service Bus** item. Then complete the installation and
  396. close this dialog.
  397. 4. In Solution Explorer, right-click the **ProductsPortal**
  398. project, then click **Add**, then **Existing Item**.
  399. 5. Navigate to the **ProductsContract.cs** file from the
  400. **ProductsServer** console project. Click to highlight
  401. ProductsContract.cs. Click the down arrow next to **Add**, then
  402. click **Add as Link**.
  403. ![][24]
  404. 6. Now open the **HomeController.cs** file in the Visual Studio
  405. editor and replace the namespace definition with the following
  406. code. Be sure to replace *yourServiceNamespace* with the name of
  407. your service namespace, and *yourIssuerSecret* with your key.
  408. This will allow the client to call the on-premises service,
  409. returning the result of the call.
  410. using System;
  411. using System.Collections.Generic;
  412. using System.Linq;
  413. using System.Web;
  414. using System.Web.Mvc;
  415. namespace ProductsWeb.Controllers
  416. {
  417. using System.Linq;
  418. using System.ServiceModel;
  419. using System.Web.Mvc;
  420. using Microsoft.ServiceBus;
  421. using Models;
  422. using ProductsServer;
  423. public class HomeController : Controller
  424. {
  425. // Declare the channel factory
  426. static ChannelFactory<IProductsChannel> channelFactory;
  427. static HomeController()
  428. {
  429. // Create shared secret token credentials for authentication
  430. channelFactory = new ChannelFactory<IProductsChannel>(new NetTcpRelayBinding(),
  431. "sb://yourServiceNamespace.servicebus.windows.net/products");
  432. channelFactory.Endpoint.Behaviors.Add(new TransportClientEndpointBehavior {
  433. TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(
  434. "owner", "yourIssuerSecret") });
  435. }
  436. public ActionResult Index()
  437. {
  438. using (IProductsChannel channel = channelFactory.CreateChannel())
  439. {
  440. // Return a view of the products inventory
  441. return this.View(from prod in channel.GetProducts()
  442. select
  443. new Product { Id = prod.Id, Name = prod.Name,
  444. Quantity = prod.Quantity });
  445. }
  446. }
  447. }
  448. }
  449. 7. In Solution Explorer, right-click on the **ProductsPortal**
  450. solution, click **Add**, then click **Existing Project**.
  451. 8. Navigate to the **ProductsServer** project, then double-click
  452. the **ProductsServer.csproj** solution file to add it.
  453. 9. In Solution Explorer, right-click the **ProductsPortal**
  454. solution and click **Properties**.
  455. 10. On the left-hand side, click **Startup Project**. On the
  456. right-hand side, cick **Multiple startup projects**. Ensure that
  457. **ProductsServer**, **ProductsPortal.Azure**, and
  458. **ProductsPortal** appear, in that order, with **Start** set as
  459. the action for **ProductsServer** and **ProductsPortal.Azure**,
  460. and **None** set as the action for **ProductsPortal**. For
  461. example:
  462. ![][25]
  463. 11. Still in the Properties dialog, click **ProjectDependencies** on
  464. the left-hand side.
  465. 12. In the **Project Dependencies** dropdown, click
  466. **ProductsServer**. Ensure that **ProductsPortal** is unchecked,
  467. and **ProductsPortal.Azure**is checked. Then click **OK**:
  468. ![][26]
  469. <h2><span class="short-header">RUN THE APPLICATION</span>RUN THE APPLICATION</h2>
  470. 1. From the **File** menu in Visual Studio, click **Save All**.
  471. 2. Press **F5** to build and run the application. The on-premises
  472. server (the **ProductsServer** console application) should start
  473. first, then the **ProductsWeb** application should start in a
  474. browser window, as shown in the screenshot below. This time, you
  475. will see that the product inventory lists data retrieved from
  476. the product service on-premises system.
  477. ![][1]
  478. <h2><span class="short-header">DEPLOY THE APPLICATION</span>DEPLOY YOUR APPLICATION TO WINDOWS AZURE</h2>
  479. 1. Right-click on the **ProductsPortal** project in **Solution
  480. Explorer** and click **Publish to Windows Azure**.
  481. 2. The first time you publish to Windows Azure, you will first have
  482. to download credentials via the link provided in Visual Studio.
  483. Click **Sign in to download credentials**:
  484. ![][27]
  485. 3. Sign-in using your Live ID:
  486. ![][28]
  487. 4. Save the publish profile file to a location on your hard drive
  488. where you can retrieve it:
  489. ![][29]
  490. 5. Within the publish dialog, click on **Import**:
  491. ![][30]
  492. 6. Browse for and select the file that you just downloaded, then
  493. click **Next**.
  494. 7. Pick the Windows Azure subscription you would like to publish
  495. to:
  496. ![][31]
  497. 8. 7.If your subscription doesnt already contain any hosted
  498. services, you will be asked to create one. The hosted service
  499. acts as a container for your application within your Windows
  500. Azure subscription. Enter a name that identifies your
  501. application and choose the region for which the application
  502. should be optimized. (You can expect faster loading times for
  503. users accessing it from this region.)
  504. ![][32]
  505. 9. Select the hosted service you would like to publish your
  506. application to. Keep the defaults as shown below for the
  507. remaining settings. Click **Next**:
  508. ![][33]
  509. 10. On the last page, click **Publish** to start the deployment
  510. process:
  511. ![][34]
  512. This will take approximately 5-7 minutes. Since this is the
  513. first time you are publishing, Windows Azure provisions a
  514. virtual machine (VM), performs security hardening, creates a Web
  515. role on the VM to host your application, deploys your code to
  516. that Web role, and finally configures the load balancer and
  517. networking so your application is available to the public.
  518. 11. While publishing is in progress you will be able to monitor the
  519. activity in the **Windows Azure Activity Log** window, which is
  520. typically docked to the bottom of Visual Studio or Visual Web
  521. Developer:
  522. ![][35]
  523. 12. When deployment is complete, you can view your Web site by
  524. clicking the **Web site URL**link in the monitoring window.
  525. ![][36]
  526. Your Web site depends on your on-premises server, so you must
  527. run the **ProductsServer**application locally for the Web site
  528. to function properly. As you perform requests on the cloud Web
  529. site, you will see requests coming into your on-premises console
  530. application, as indicated by the "GetProducts called" output
  531. displayed in the screenshot below.
  532. ![][37]
  533. <h2><span class="short-header">DELETE THE APPLICATION</span>STOP AND DELETE YOUR APPLICATION</h2>
  534. After deploying your application, you may want to disable it so you
  535. can build and deploy other applications within the free 750
  536. hours/month (31 days/month) of server time.
  537. Windows Azure bills web role instances per hour of server time
  538. consumed. Server time is consumed once your application is deployed,
  539. even if the instances are not running and are in the stopped state.
  540. A free account includes 750 hours/month (31 days/month) of dedicated
  541. virtual machine server time for hosting these web role instances.
  542. The following steps show you how to stop and delete your
  543. application.
  544. 1. Login to the [Windows Azure Management Portal],
  545. and click on Hosted Sevices, Storage
  546. Accounts & CDN, then Hosted Services:
  547. ![][33]
  548. 2. Click on Stop to temporarily suspend your application. You will
  549. be able to start it again just by clicking on Start. Click on
  550. Delete to completely remove your application from Windows Azure
  551. with no ability to restore it.
  552. ![][34]
  553. [0]: ../../../DevCenter/dotNet/Media/hybrid.png
  554. [1]: ../../../DevCenter/dotNet/Media/App2.png
  555. [Get Tools and SDK]: http://go.microsoft.com/fwlink/?LinkId=271920
  556. [2]: ../../../DevCenter/dotNet/Media/getting-started-3.png
  557. [3]: ../../../DevCenter/dotNet/Media/getting-started-4-WebPI.png
  558. [http://www.windowsazure.com]: http://www.windowsazure.com
  559. [4]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-32.png
  560. [Windows Azure Management Portal]: http://manage.windowsazure.com
  561. [5]: ../../../DevCenter/dotNet/Media/sb-queues-03.png
  562. [6]: ../../../DevCenter/dotNet/Media/sb-queues-04.png
  563. [7]: ../../../DevCenter/dotNet/Media/sb-queues-05.png
  564. [8]: ../../../DevCenter/dotNet/Media/sb-queues-06.png
  565. [9]: ../../../DevCenter/dotNet/Media/sb-queues-07.png
  566. [Using the NuGet Service Bus Package]: http://go.microsoft.com/fwlink/?LinkId=234589
  567. [10]: ../../../DevCenter/dotNet/Media/hy-web-1.png
  568. [11]: ../../../DevCenter/dotNet/Media/hy-con-1.jpg
  569. [12]: ../../../DevCenter/dotNet/Media/hy-con-3.png
  570. [13]: ../../../DevCenter/dotNet/Media/getting-started-multi-tier-13.png
  571. [14]: ../../../DevCenter/dotNet/Media/hy-con-4.png
  572. [15]: ../../../DevCenter/dotNet/Media/hy-web-2.jpg
  573. [16]: ../../../DevCenter/dotNet/Media/hy-web-4.png
  574. [17]: ../../../DevCenter/dotNet/Media/hy-web-7.jpg
  575. [18]: ../../../DevCenter/dotNet/Media/hy-web-10.jpg
  576. [19]: ../../../DevCenter/dotNet/Media/getting-started-8.png
  577. [20]: ../../../DevCenter/dotNet/Media/hy-web-11.png
  578. [21]: ../../../DevCenter/dotNet/Media/App1.png
  579. [22]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-21.png
  580. [23]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-22.png
  581. [24]: ../../../DevCenter/dotNet/Media/hy-web-12.jpg
  582. [25]: ../../../DevCenter/dotNet/Media/hy-web-13.png
  583. [26]: ../../../DevCenter/dotNet/Media/hy-web-14.jpg
  584. [27]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-33.png
  585. [28]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-34.png
  586. [29]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-25.png
  587. [30]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-36.png
  588. [31]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-37.png
  589. [32]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-38.png
  590. [33]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-39.png
  591. [34]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-40.png
  592. [35]: ../../../DevCenter/dotNet/Media/getting-started-hybrid-41.png
  593. [36]: ../../../DevCenter/dotNet/Media/App3.png
  594. [37]: ../../../DevCenter/dotNet/Media/hy-service1.png
  595. [38]: ../../../DevCenter/dotNet/Media/getting-started-multi-tier-27.png
  596. [39]: ../../../DevCenter/dotNet/Media/sb-queues-09.png
  597. [40]: ../../../DevCenter/dotNet/Media/sb-queues-06.png
  598. [41]: ../../../DevCenter/dotNet/Media/getting-started-multi-tier-40.png
  599. [42]: ../Media/getting-started-41.png