Skip to content

Commit b1ade5b

Browse files
Merge pull request #281595 from tomvcassidy/18CSDate
ms.date and acrolinx
2 parents 9af1ab3 + 9678fa0 commit b1ade5b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/cloud-services/cloud-services-enable-communication-role-instances.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Communication for Roles in Cloud Services (classic) | Microsoft Docs
33
description: Role instances in Cloud Services can have endpoints (http, https, tcp, udp) defined for them that communicate with the outside or between other role instances.
44
ms.topic: article
55
ms.service: cloud-services
6-
ms.date: 02/21/2023
6+
ms.date: 07/23/2024
77
author: hirenshah1
88
ms.author: hirshah
99
ms.reviewer: mimckitt
@@ -14,10 +14,10 @@ ms.custom: compute-evergreen, devx-track-dotnet
1414

1515
[!INCLUDE [Cloud Services (classic) deprecation announcement](includes/deprecation-announcement.md)]
1616

17-
Cloud service roles communicate through internal and external connections. External connections are called **input endpoints** while internal connections are called **internal endpoints**. This topic describes how to modify the [service definition](cloud-services-model-and-package.md#csdef) to create endpoints.
17+
Cloud service roles communicate through internal and external connections. External connections are called **input endpoints** while internal connections are called **internal endpoints**. This article describes how to modify the [service definition](cloud-services-model-and-package.md#csdef) to create endpoints.
1818

1919
## Input endpoint
20-
The input endpoint is used when you want to expose a port to the outside. You specify the protocol type and the port of the endpoint which then applies for both the external and internal ports for the endpoint. If you want, you can specify a different internal port for the endpoint with the [localPort](/previous-versions/azure/reference/gg557552(v=azure.100)#inputendpoint) attribute.
20+
The input endpoint is used when you want to expose a port to the outside. You specify the protocol type and the port of the endpoint, which then applies for both the external and internal ports for the endpoint. If you want, you can specify a different internal port for the endpoint with the [localPort](/previous-versions/azure/reference/gg557552(v=azure.100)#inputendpoint) attribute.
2121

2222
The input endpoint can use the following protocols: **http, https, tcp, udp**.
2323

@@ -30,7 +30,7 @@ To create an input endpoint, add the **InputEndpoint** child element to the **En
3030
```
3131

3232
## Instance input endpoint
33-
Instance input endpoints are similar to input endpoints but allows you map specific public-facing ports for each individual role instance by using port forwarding on the load balancer. You can specify a single public-facing port, or a range of ports.
33+
Instance input endpoints are similar to input endpoints but allow you to map specific public-facing ports for each individual role instance by using port forwarding on the load balancer. You can specify a single public-facing port, or a range of ports.
3434

3535
The instance input endpoint can only use **tcp** or **udp** as the protocol.
3636

@@ -47,7 +47,7 @@ To create an instance input endpoint, add the **InstanceInputEndpoint** child el
4747
```
4848

4949
## Internal endpoint
50-
Internal endpoints are available for instance-to-instance communication. The port is optional and if omitted, a dynamic port is assigned to the endpoint. A port range can be used. There is a limit of five internal endpoints per role.
50+
Internal endpoints are available for instance-to-instance communication. The port is optional and if omitted, a dynamic port is assigned to the endpoint. A port range can be used. There's a limit of five internal endpoints per role.
5151

5252
The internal endpoint can use the following protocols: **http, tcp, udp, any**.
5353

@@ -71,7 +71,7 @@ You can also use a port range.
7171

7272

7373
## Worker roles vs. Web roles
74-
There is one minor difference with endpoints when working with both worker and web roles. The web role must have at minimum a single input endpoint using the **HTTP** protocol.
74+
There's one minor difference with endpoints when working with both worker and web roles. The web role must have at minimum a single input endpoint using the **HTTP** protocol.
7575

7676
```xml
7777
<Endpoints>
@@ -81,7 +81,7 @@ There is one minor difference with endpoints when working with both worker and w
8181
```
8282

8383
## Using the .NET SDK to access an endpoint
84-
The Azure Managed Library provides methods for role instances to communicate at runtime. From code running within a role instance, you can retrieve information about the existence of other role instances and their endpoints, as well as information about the current role instance.
84+
The Azure Managed Library provides methods for role instances to communicate at runtime. From code running within a role instance, you can retrieve information about the existence of other role instances and their endpoints. You can also obtain information about the current role instance.
8585

8686
> [!NOTE]
8787
> You can only retrieve information about role instances that are running in your cloud service and that define at least one internal endpoint. You cannot obtain data about role instances running in a different service.
@@ -90,22 +90,22 @@ The Azure Managed Library provides methods for role instances to communicate at
9090
9191
You can use the [Instances](/previous-versions/azure/reference/ee741904(v=azure.100)) property to retrieve instances of a role. First use the [CurrentRoleInstance](/previous-versions/azure/reference/ee741907(v=azure.100)) to return a reference to the current role instance, and then use the [Role](/previous-versions/azure/reference/ee741918(v=azure.100)) property to return a reference to the role itself.
9292

93-
When you connect to a role instance programmatically through the .NET SDK, it's relatively easy to access the endpoint information. For example, after you've already connected to a specific role environment, you can get the port of a specific endpoint with this code:
93+
When you connect to a role instance programmatically through the .NET SDK, it's relatively easy to access the endpoint information. For example, after you connect to a specific role environment, you can get the port of a specific endpoint with this code:
9494

9595
```csharp
9696
int port = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["StandardWeb"].IPEndpoint.Port;
9797
```
9898

99-
The **Instances** property returns a collection of **RoleInstance** objects. This collection always contains the current instance. If the role does not define an internal endpoint, the collection includes the current instance but no other instances. The number of role instances in the collection will always be 1 in the case where no internal endpoint is defined for the role. If the role defines an internal endpoint, its instances are discoverable at runtime, and the number of instances in the collection will correspond to the number of instances specified for the role in the service configuration file.
99+
The **Instances** property returns a collection of **RoleInstance** objects. This collection always contains the current instance. If the role doesn't define an internal endpoint, the collection includes the current instance but no other instances. The number of role instances in the collection is always one in the case where no internal endpoint is defined for the role. If the role defines an internal endpoint, its instances are discoverable at runtime, and the number of instances in the collection corresponds to the number of instances specified for the role in the service configuration file.
100100

101101
> [!NOTE]
102102
> The Azure Managed Library does not provide a means of determining the health of other role instances, but you can implement such health assessments yourself if your service needs this functionality. You can use [Azure Diagnostics](cloud-services-dotnet-diagnostics.md) to obtain information about running role instances.
103103
>
104104
>
105105
106-
To determine the port number for an internal endpoint on a role instance, you can use the [`InstanceEndpoints`](/previous-versions/azure/reference/ee741917(v=azure.100)) property to return a Dictionary object that contains endpoint names and their corresponding IP addresses and ports. The [`IPEndpoint`](/previous-versions/azure/reference/ee741919(v=azure.100)) property returns the IP address and port for a specified endpoint. The `PublicIPEndpoint` property returns the port for a load balanced endpoint. The IP address portion of the `PublicIPEndpoint` property is not used.
106+
To determine the port number for an internal endpoint on a role instance, you can use the [`InstanceEndpoints`](/previous-versions/azure/reference/ee741917(v=azure.100)) property to return a Dictionary object that contains endpoint names and their corresponding IP addresses and ports. The [`IPEndpoint`](/previous-versions/azure/reference/ee741919(v=azure.100)) property returns the IP address and port for a specified endpoint. The `PublicIPEndpoint` property returns the port for a load balanced endpoint. The IP address portion of the `PublicIPEndpoint` property isn't used.
107107

108-
Here is an example that iterates role instances.
108+
Here's an example that iterates role instances.
109109

110110
```csharp
111111
foreach (RoleInstance roleInst in RoleEnvironment.CurrentRoleInstance.Role.Instances)
@@ -118,7 +118,7 @@ foreach (RoleInstance roleInst in RoleEnvironment.CurrentRoleInstance.Role.Insta
118118
}
119119
```
120120

121-
Here is an example of a worker role that gets the endpoint exposed through the service definition and starts listening for connections.
121+
Here's an example of a worker role that gets the endpoint exposed through the service definition and starts listening for connections.
122122

123123
> [!WARNING]
124124
> This code will only work for a deployed service. When running in the Azure Compute Emulator, service configuration elements that create direct port endpoints (**InstanceInputEndpoint** elements) are ignored.
@@ -360,7 +360,7 @@ Only allows network traffic from **WebRole1** to **WorkerRole1**, **WebRole1** t
360360
</ServiceDefinition>
361361
```
362362

363-
An XML schema reference for the elements used above can be found [here](/previous-versions/azure/reference/gg557551(v=azure.100)).
363+
An XML schema reference for the elements used can be found [here](/previous-versions/azure/reference/gg557551(v=azure.100)).
364364

365365
## Next steps
366366
Read more about the Cloud Service [model](cloud-services-model-and-package.md).

0 commit comments

Comments
 (0)