You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-bus-relay/service-bus-dotnet-hybrid-app-using-service-bus-relay.md
+36-37Lines changed: 36 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,22 +19,23 @@ ms.author: spelluru
19
19
---
20
20
# Expose an on-premises WCF service to a web application in the cloud by using Azure Relay
21
21
22
-
This article shows how to build a hybrid cloud application with Microsoft Azure and Visual Studio. You create an application that uses multiple Azure resources up and running in the cloud.
22
+
This article shows how to build a hybrid cloud application with Microsoft Azure and Visual Studio. You create an application that uses multiple Azure resources in the cloud. This tutorial helps you learn:
23
23
24
24
* How to create or adapt an existing web service for consumption by a web solution.
25
25
* How to use the Azure Windows Communication Foundation (WCF) Relay service to share data between an Azure application and a web service hosted elsewhere.
26
26
27
-
You take the following steps in this tutorial:
27
+
You do the following tasks in this tutorial:
28
28
29
29
> [!div class="checklist"]
30
30
>
31
+
> * Install prerequisites for this tutorial.
31
32
> * Review the scenario.
32
33
> * Create a namespace.
33
-
> * Create an on-premises server
34
-
> * Create an ASP .NET application
34
+
> * Create an on-premises server.
35
+
> * Create an ASP .NET application.
35
36
> * Run the app locally.
36
-
> * Deploy the web app to Azure
37
-
> * Run the app on Azure
37
+
> * Deploy the web app to Azure.
38
+
> * Run the app on Azure.
38
39
39
40
## Prerequisites
40
41
@@ -46,42 +47,40 @@ To complete this tutorial, you need the following prerequisites:
46
47
47
48
## How Azure Relay helps with hybrid solutions
48
49
49
-
Business solutions are typically composed of a combination of custom code and existing functionality. Custom code tackles new and unique business requirements. Existing functionality is provided by solutions and systems that are already in place.
50
+
Business solutions are typically composed of a combination of custom code and existing functionality. Custom code tackles new and unique business requirements. Solutions and systems that are already in place provide existing functionality.
50
51
51
-
Solution architects are starting to use the cloud for easier handling of scale requirements and lower operational costs. In doing so, they find that existing service assets they'd like to use as building blocks for their solutions are inside the corporate firewall and out of easy reach for access by the cloud solution. Many internal services aren't built or hosted in a way that they can be easily exposed at the corporate network edge.
52
+
Solution architects are starting to use the cloud for easier handling of scale requirements and lower operational costs. In doing so, they find that existing service assets they'd like to use as building blocks for their solutions are inside the corporate firewall and out of easy reach by the cloud solution. Many internal services aren't built or hosted in a way that they can be easily exposed at the corporate network edge.
52
53
53
-
[Azure Relay](https://azure.microsoft.com/services/service-bus/)is designed for the use-case of taking existing WCF web services and making those services securely accessible to solutions that are outside the corporate perimeter without requiring intrusive changes to the corporate network infrastructure. Such relay services are still hosted inside their existing environment, but they delegate listening for incoming sessions and requests to the cloud-hosted relay service. Azure Relay also protects those services from unauthorized access by using [Shared Access Signature (SAS)](../service-bus-messaging/service-bus-sas.md) authentication.
54
+
[Azure Relay](https://azure.microsoft.com/services/service-bus/)takes existing WCF web services and makes those services securely accessible to solutions that are outside the corporate perimeter without requiring intrusive changes to the corporate network infrastructure. Such relay services are still hosted inside their existing environment, but they delegate listening for incoming sessions and requests to the cloud-hosted relay service. Azure Relay also protects those services from unauthorized access by using [Shared Access Signature (SAS)](../service-bus-messaging/service-bus-sas.md) authentication.
54
55
55
56
## Review the scenario
56
57
57
58
In this tutorial, you create an ASP.NET website that enables you to see a list of products on the product inventory page.
58
59
59
60
![Scenario][0]
60
61
61
-
The tutorial assumes that you have product information in an existing on-premises system, and uses Azure Relay to reach into that system. This situation is simulated by a web service that runs in a simple console application and is backed by an in-memory set of products. You can run this console application on your own computer and deploy the web role into Azure. By doing so, you'll see how the web role running in the Azure datacenter calls into your computer. This call happens even though your computer will almost certainly be behind at least one firewall and a network address translation (NAT) layer.
62
+
The tutorial assumes that you have product information in an existing on-premises system, and uses Azure Relay to reach into that system. A web service that runs in a simple console application simulates this situation. It contains an in-memory set of products. You can run this console application on your own computer and deploy the web role into Azure. By doing so, you'll see how the web role running in the Azure datacenter calls into your computer. This call happens even though your computer will almost certainly be behind at least one firewall and a network address translation (NAT) layer.
62
63
63
64
## Set up the development environment
64
65
65
66
Before you can begin developing Azure applications, download the tools and set up your development environment:
66
67
67
68
1. Install the Azure SDK for .NET from the SDK [downloads page](https://azure.microsoft.com/downloads/).
68
69
1. In the **.NET** column, choose the version of [Visual Studio](https://www.visualstudio.com) you're using. This tutorial uses Visual Studio 2019.
69
-
1. When prompted to run or save the installer, Select**Run**.
70
-
1. In the **Web Platform Installer**, select **Install** and continue with the installation.
70
+
1. When prompted to run or save the installer, select**Run**.
71
+
1. In the **Web Platform Installer** dialog box, select **Install** and continue with the installation.
71
72
72
-
Once the installation is complete, you have everything necessary to start to develop the app. The SDK includes tools that let you easily develop Azure applications in Visual Studio.
73
+
Once the installation is finished, you have everything necessary to start to develop the app. The SDK includes tools that let you easily develop Azure applications in Visual Studio.
73
74
74
75
## Create a namespace
75
76
76
-
The first step is to create a namespace, and to obtain a [Shared Access Signature (SAS)](../service-bus-messaging/service-bus-sas.md) key. A namespace provides an application boundary for each application exposed through the relay service. A SAS key is automatically generated by the system when a service namespace is created. The combination of service namespace and SAS key provides the credentials for Azure to authenticate access to an application.
77
+
The first step is to create a namespace, and to obtain a [Shared Access Signature (SAS)](../service-bus-messaging/service-bus-sas.md) key. A namespace provides an application boundary for each application exposed through the relay service. An SAS key is automatically generated by the system when a service namespace is created. The combination of service namespace and SAS key provides the credentials for Azure to authenticate access to an application.
First, you build a simulated on-premises product catalog system. This project is a Visual Studio console application, and uses the [Azure Service Bus NuGet package](https://www.nuget.org/packages/WindowsAzure.ServiceBus/) to include the Service Bus libraries and configuration settings.
83
-
84
-
### Create the project
83
+
First, you build a simulated on-premises product catalog system. This project is a Visual Studio console application, and uses the [Azure Service Bus NuGet package](https://www.nuget.org/packages/WindowsAzure.ServiceBus/) to include the Service Bus libraries and configuration settings. <aname="create-the-project"></a>
85
84
86
85
1. Start Microsoft Visual Studio as an administrator. To do so, right-click the Visual Studio program icon, and select **Run as administrator**.
87
86
1. In Visual Studio, select **Create a new project**.
@@ -99,6 +98,9 @@ First, you build a simulated on-premises product catalog system. This project i
99
98
100
99
1. Add a new class for your product contract. In **Solution Explorer**, right-click the **ProductsServer** project and select **Add** > **Class**.
101
100
1. In **Name**, enter the name *ProductsContract.cs* and select **Add**.
101
+
102
+
Make the following code changes to your solution:
103
+
102
104
1. In *ProductsContract.cs*, replace the namespace definition with the following code, which defines the contract for the service.
103
105
104
106
```csharp
@@ -228,7 +230,7 @@ First, you build a simulated on-premises product catalog system. This project i
@@ -249,7 +251,7 @@ In this section, you build a simple ASP.NET application that displays data retri
249
251
![Specify authentication][18]
250
252
251
253
1. Back in **Create a new ASP.NET Web Application**, select **Create** to create the MVC app.
252
-
1. Configure Azure resources for a new web app. Follow the steps in the [Publish to Azure section of this article](../app-service/app-service-web-get-started-dotnet-framework.md#launch-the-publish-wizard). Then, returntothistutorialandcontinuetothenextstep.
254
+
1. Configure Azure resources for a new web app. Follow the steps in [Publish your web app](../app-service/app-service-web-get-started-dotnet-framework.md#launch-the-publish-wizard). Then, returntothistutorialandcontinuetothenextstep.
1. CopytheURLofthedeployedwebapp. You'll need the URL later. You can also obtain this URL from the **Azure App Service Activity** window in Visual Studio:
443
+
1. CopytheURLofthedeployedwebapp. You'll need the URL later. You can also get this URL from the **Azure App Service Activity** window in Visual Studio:
0 commit comments