Code Monkey home page Code Monkey logo

azure-relay's Introduction

azure-relay's People

Contributors

bainian12345 avatar cuwaters avatar dependabot[bot] avatar dlstucki avatar eldertgrootenboer avatar jongio avatar jtaubensee avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar nickverschueren avatar sethmanheim avatar starkatsuton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-relay's Issues

Relay hybrid connection Issue

Description

Actual Behavior

  1. I gone though the forum and relay hybrid connection works well with console application a given in example. https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-hybrid-connections-dotnet-get-started.
  2. Going forward instead of console application I would like to use .net web application as listener
    When I debug code compiler not going to next line after line - listener.OpenAsync(cts.Token);
    even not getting exception. Hence not able to connect . Please help

Expected Behavior

WebRequest - Relay

We used the old hybrid connection manager (https://www.microsoft.com/en-us/download/details.aspx?id=42962) and azure biztalk service. We use it to connect our AppService to on-premise resources as sql server and webservices.

Now I am trying to migrate to azure relay, I used the PortBridgeServerAgent sample and connected it to the azure relay successfully. Now when I try to make a simple web request to an on-premise resource, the HybridConnectionStream that I am receiving is like that:

ET /WebServiceUrlHere/test.txt HTTP/1.1
Host: desktop-o9cf9bj

I don't know how to handle this request. Could you help me?

Thanks!

Got this message "Unable to connect: The WebSocket protocol is not supported on this platform"

Today I find the sample project PortBridge. And I have a try. When I run the project PortBridgeServerAgent, I get this message "Unable to connect: The WebSocket protocol is not supported on this platform". My platform is Win7 x64.

My question is:

  1. Does it mean this solution PortBridge can not run on Win7 x64?
  2. If the solution PortBridge really can not run on Win7 x64, is there any other solution with .NET, which can implement this tunneling feature and it can run on Win7 x32/x64. Thanks.

Port Bridge Question

Looks like another dying Microsoft project....
Was good start and then no updates, no migration to .net core, nothing...

Anyway, may be someone look at this enough and have some ideas.
The code inside: MultiplexConnectionInputPump
image

I am getting exception when shutdownConnection = true, but stopped is not actually true. So, the code closes the connection, but still trying to read data from connection.

There is a very interesting line:
bool shutdownConnection = (frameSize == 0);
What is frameSize means and why haveing it == 0 will shutdown the connection?

I have put a lot of logs to see what's happening:
This is from Server Agent side:
image
As you can see, the connection worked 2 times, and then for some reason it just dispose it and the app crashed.

Simple Hybrid Connections HTTP Sample throws ReferenceError: Extensions is not defined

Description

  1. Clone the repo then run npm install .
  2. Start listener.js with listener SAS credentials.
  3. Initiate a http request from an App Service

Actual Behavior

The listener.js fails with the following error:

C:\dev\...\node_modules\hyco-https\lib\HybridConnectionHttpsServer.js:475
  var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']);
                        ^
**ReferenceError: Extensions is not defined**
    at accept (C:\dev\...\node_modules\hyco-https\lib\HybridConnectionHttpsServer.js:475:25)
    at WebSocket.server.controlChannel.onmessage (C:\...\node_modules\hyco-https\lib\HybridConnectionHttpsServer.js:420:7)
    at WebSocket.onMessage (C:\dev\...\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:400:28)
    at Receiver.receiverOnMessage (C:\dev\....\node_modules\ws\lib\websocket.js:789:20)
    at Receiver.emit (events.js:400:28)
    at Receiver.dataMessage (C:\dev\...\node_modules\ws\lib\receiver.js:422:14)
    at Receiver.getData (C:\dev\...\node_modules\ws\lib\receiver.js:352:17)
    at Receiver.startLoop (C:\dev\...\node_modules\ws\lib\receiver.js:138:22)
    at Receiver._write (C:\dev\...\node_modules\ws\lib\receiver.js:74:10)

Expected Behavior

The sample app should not crash.

HCM

The strength of the Biztalk Hybrid Connection offering is that there is not much code required to expose a resource to an Azure App Service and the user is not forced to use particular semantics for the connection (e.g. REST vs Websockets). Are there any plans to extend the relay functionality and provide transparent forwarding? Should customers need to write code and stand up services on both sides of this connection in order to talk to their existing infrastructure? I appreciate the sample code to accomplish this but I cannot imagine I'm the only customer scratching their head on this.

Node hybrid connection listener get disconnected after 4 mins.

Description

Actual Behavior

  1. Hybrid connection listener is getting disconnected after idle time of ~4mins, and listener is also not getting that event, So behavior is like node js application is running showing it is connected with hybrid connection, but in Azure portal, it is display 0 listener.

Expected Behavior

  1. It should not display as 0 zero listener, or it should send an error event that after disconnect.

Below are some sample duration after which listener is getting disconnected (minutes:sec)
4:15
4:12
4:10
4:13
4:15
4:14
4:15

In addition to above, we also tried to send the 'heart-beat' message after every 1 min. still we are facing this issue but this time, it get disconnected after 1 hr, this is very wired behavior.

Please let me know if you need any other details.
By next week by app is going to be go live and we are facing this issue.

Is the server/host-side available as library for self hosting?

Description

I understand that the azure relay is primarily a service for exposing locally operated services via Azure. The system seems well maintained and is having a well documented protocol in place. We have basically the same requirement for our services which are not only hosted in Azure but also operated fully on-premises on an own infrastructure.

Currently we have an own library which is doing basically the same as azure relay but you can self host the server side. You can have an ASP.net core application on the edge accepting requests from both end users and also the exposed applications. Then via a custom websocket based protocol we process the HTTP request on the private network service (also ASP.net core) and stream back/forth the request responses.

To avoid having this "home brew" solution I would like to fully build our solution on top of Azure Relay. While I have found the formal specification of the "Hybrid Connection" protocol, I haven't found a library (preferably ASP.net core) which would allow me to operate the edge side on my own.

Actual Behavior

There is no available library for hosting the edge server for Azure Relay services on my own.

Expected Behavior

I want to self host the Azure Relay edge side on my own via an ASP.net core middleware which is then ultimately operated via Kestrel or IIS. Configuration of the available namespaces and required keys would go via a custom services that to hook up the middleware with custom rules.

Even just a base framework would be a good starting point to build my own middleware but avoid the re-implementation of the whole protocol parts.

PortBridge code video walkthrough available publicly?

I'm glad to have found this project since I remember using it in 2009 on the original blog owner's site (where is that blog?)

Anyway, this code is almost what I need for a variety of production needs, and was wondering if there was a video walkthrough of how it works, what's it doing and how.

I recall from MSInternal days that work artifacts and other useful information is (was)stored on respective team's Sharepoint site or file share, or other locations. Should a video explainer be available (for code maintenance, or demo purposes) that would be great.

Artifacts like that would likely increase code maintenance contributions by random volunteers like myself.

Provide an Azure Event Grid event source with ListenerConnected and ListenerDisconnected events

Description

With the Hybrid Connections - Get API, we can easily retrieve the number of currently connected listeners of a Hybrid Connection.

It would be great if we could get ListenerConnected and ListenerDisconnected events in Azure Event Grid for this, such that our application can respond to listeners coming up or going down. For example, it would be great if we could show in our application's UI that a listener is currently connected, and have that status display change when the listener disconnects, without polling Azure's REST API all the time.

Actual Behavior

The Azure Service Bus as an Event Grid source article shows that there are currently four events exposed from Azure Service Bus via Azure Event Grid, but none of them related to Hybrid Connections. Also, the Event Grid overview page does not list Azure Relay as a dedicated technology that exposes events via Event Grid.

Expected Behavior

ListenerConnected and ListenerDisconnected events should be available via Azure Event Grid, either via a dedicated Azure Relay event source, or via the existing Azure Service Bus event source.

Azure relay for Go

I know there is already a service bus ask for golang. Are there any samples for using a azure relay listener in golang? I’m assuming I can send from he C# SDK to other listeners in other languages.

Description

Actual Behavior

Expected Behavior

Question About One endpoint with multiple listeners

Description

Actual Behavior

Starting one listener separately on two different machines named A and B, and then starting the sender service, there will be a cross-connection situation. That is, A's listener and B's sender are connected, and B's listener and A's sender are connected.

Expected Behavior

I want to make sure A's sender connect to A's listener, and B's sender connect to B's listener for each time. What should I do?

PortBridge and dotnet core compatibility

Description

I'm not sure if this is about the client library or not, I'm using Microsoft.Azure.Relay 2.0.1 on top of .Net Core 3.1 (Windows 10).
Did anyone try to convert it for .net core and have some tips to share?
I'm trying to convert this project, it builds fine but at runtime the following problem occurs.

On the server side, in the BufferPump class of PortBridge library, the following method fails when bufferRead.BeginInvoke is called (rawInputPump).

public override IAsyncResult BeginRunPump(AsyncCallback callback, object state)
{
    if (IsRunning)
    {
        throw new InvalidOperationException("Already running");
    }
    IsRunning = true;
    Caller = new PumpAsyncResult(callback, state);
    bufferRead.BeginInvoke(inputBuffer, 0, inputBuffer.Length, DoneReading, null);
    return Caller;
}

Exception thrown is:

System.PlatformNotSupportedException "Operation is not supported on this platform."
   at PortBridge.BufferRead.BeginInvoke(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object object)
   at PortBridge.BufferPump.BeginRunPump(AsyncCallback callback, Object state) in BufferPump.cs:line 33
   at PortBridge.TcpClientConnectionForwarder.EnsureConnection() in TcpClientConnectionForwarder.cs:line 203
   at PortBridge.TcpClientConnectionForwarder.ClientAccepted(IAsyncResult asyncResult) in TcpClientConnectionForwarder.cs:line 150

Other samples on run OK on top of .net core, but PortBridge is the one that can't. It's also the only one that use the stream Read method like this.
Does this mean the dataChannel (HybridConnectionStream) created in TcpClientConnectionForwader cannot be used anymore in dotnet core?

I quickly compared with a watcher the dataChannel stream object in dotnet core and .NET 4.6.1, but there was no obvious difference. Both are non-seekable, and both throw an exception on Length and Position properties getter, there has to be something else.

Same test for the inputPump and outputPump, they end up causing a NotSupportedException when the bufferRead is called.

Proxy on client side

Does NetTcpRelayBinding allow the client behind a proxy server?

Best Regards
Achim

Sample on how to use a dynamic WCF relay from nodejs

Hello, is there a way of using a WCF relay from nodejs or JavaScript?

I need a relay that I use occasionally and the pricing for WCF Relays fits my needs better than Hybrid connections.

My development platform is nodejs (my utility needs to run on windows and mac) but I only found examples on using WCF Relays for .Net framework.

Are there any examples on how to do this from node?

Thanks

The request was routed to the listener but the listener did not respond in the required time

Description

Using this sample https://github.com/Azure/azure-relay/tree/master/samples/hybrid-connections/dotnet/hcreverseproxy to access an on-premise http endpoint that takes more than 60 seconds to respond results in the error "The request was routed to the listener but the listener did not respond in the required time". Despite increasing the operationtimeout calls still timeout after 60 seconds on the client. The call does eventually complete within RequestHandler in HybridConnectionReverseProxy but http client has timed out by this point.

Actual Behavior

  1. Http client call to hybrid connection times out after 60 seconds despite increasing the OperationTimeout to 2 minutes via connection string

Expected Behavior

  1. Http client call to hybrid connection to not time out after 60 seconds, but timeout after 2 minutes.

Improper handling of the base64-encoded signing key

Description

Hybrid Connections generate signing keys that are base64 encoded, but then expect the client to grab that base64-encoded string, take the underlying bytes and sign the token with that.

Here's an example of a client that probably works, but is wrong: https://github.com/Azure/azure-relay-dotnet/blob/dev/src/Microsoft.Azure.Relay/Common/TokenProvider.cs#L16

A client that is implemented correctly and first decodes the base64-encoded key fails to authenticate.

I'm no cryptographer, but could this have some impact on the strength of your security?

Here's Azure documentation stating that the keys are base64-encoded: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas#overview-of-sas

Actual Behavior

  1. Send an HTTP request to a Hybrid Connection thingy, passing a token signed with a properly decoded base64 key.
  2. Azure responds with an Invalid Signature error.
  3. Send an HTTP request to a Hybrid Connection thingy, passing a token signed with the bytes of the base64-encoded string.
  4. Authentication succeeds.

Expected Behavior

The reverse of the actual behavior.

Cannot run setup script, Add-AzureAccount fails (not an admin?)

Description

Is the user required to be an Admin on one or more of their subscriptions?

Add-AzureAccount : No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This
means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute
Connect-AzureRmAccount?
At D:\GitHub\azure-relay\samples\wcf-relay\scripts\azure\CreateAzureResources.ps1:56 char:16
+     $account = Add-AzureAccount
+                ~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureAccount], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount

Actual Behavior

  1. Running setup.bat and this CreateAzureResources.ps1fails with this error.

Expected Behavior

  1. Setup.bat/ps1 should succeed.

Update What is Relay?

Currently says this:

JavaScript/NodeJS*		x
Java*		                x

*By General Availability

Need to remove Java

Azure Relay with Golang

Hi!

I saw the following that was from two years ago: #47

Has anything changed since then? Any plans to add SDK / samples for Azure Relay in Golang?

Thanks!

Python Example

Can you write an example of a Relay server for a Python?

`WindowsAzure.ServiceBus` nuget package version `6.2.0` generates warnings when PackageReferenced

Description

When PackageReferencing WindowsAzure.ServiceBus 6.2.0 it generates a warning because there is a mismatch between the declared dependency in the package's nuspec of 1.0.3 (see "snip from nuspec below") and the dependency required by the Microsoft.ServiceBus assembly of 1.4.0.0 (see screenshot from ILSpy).

This issue is easily repro'd with the following csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="WindowsAzure.ServiceBus" Version="6.2.0" />
  </ItemGroup>
</Project>

Snip from nuspec:

      <dependency id="Microsoft.Azure.Services.AppAuthentication" version="1.0.3" />

References from ILSpy

// Detected Target-Framework-Id: .NETFramework,Version=v4.6.2

// Referenced assemblies (in metadata order):
// Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Actual Behavior

  1. There are warnings like this:
Build started...
1>------ Build started: Project: ConsoleApp34, Configuration: Debug Any CPU ------
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Azure.Services.AppAuthentication" that could not be resolved.
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277: There was a conflict between "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     References which depend on "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll].
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:         C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:             C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     References which depend on "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:         C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:             C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll
1>ConsoleApp34 -> C:\Users\user\source\repos\ConsoleApp34\ConsoleApp34\bin\Debug\net48\ConsoleApp34.exe
1>Done building project "ConsoleApp34.csproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Expected Behavior

  1. No warnings

System.Net.Sockets.SocketException from Hybrid Connection Manager connecting to Server 2012 R2

Hi,
I'm trying to configure a hybrid connection to connect to a SQL Server which is running on Windows Server 2012 R2 and I'm running into issues, within event viewer on the server running Hybrid Connection Manager I am seeing the following exception:

HybridConnectionManager Trace: Microsoft.Azure.Relay.RelayException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.WebSockets.WebSocketException: An internal WebSocket error occurred. Please see the innerException, if present, for more details.  ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
   at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
   --- End of inner exception stack trace ---
   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
   at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Relay.WebSocketStream.<ReadAsync>d__27.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Relay.WebSocketStream.<ReadAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.HybridConnectionManager.Util.<AsyncPipeStream>d__0.MoveNext().

I believe this is related to TLS 1.2 however I have used IIS Crypto to set TLS 1.2 on and the issue remains. I'm unsure where to go from here so any advice would be really appreciated. I have used Hybrid Connection Manager to setup a connection to a SQL Server running on Server 2019 and that works correctly so it does just seem like something on the Server 2012 R2 server needs a configuration change.

The Hybrid Connection Manager is running on Server 2016 Datacenter edition if it makes any difference.

Hope you can help,
Tom

Azure Relay Kubernetes Integration

Hi,

First of all, thanks for providing such a useful feature. I searched a lot but couldn't find any useful information. What I would like to know is if there is a way to call Hybrid Connections from applications running on Azure Kubernetes pods? Thanks in advance.

Unable to connect to existing HCM channel

Description

Press [ENTER] to exit.
PortBridgeClientAgent.exe Information: 0 : Connection 1 created
PortBridgeClientAgent.exe Information: 0 : Connection 1 completed
PortBridgeClientAgent.exe Information: 0 : Socket cancelled with code 10004 during pending read: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall.
PortBridgeClientAgent.exe Information: 0 : Connection 1 completed
PortBridgeClientAgent.exe Error: 0 : Failed writing to data channel: Value cannot be null.
Parameter name: output
PortBridgeClientAgent.exe Error: 0 : Multiplex pump failed: Value cannot be null.
Parameter name: output

Actual Behavior

  1. Cannot use client to connect to existing HCM

Expected Behavior

  1. Be able to connect to HCM over hybrid connection using the portbridge client

Port Bridge - Can't get it working

Guys, I am not able to get that sample working for Bridge To Bridge relay.
First there is different names on picture and in the code.

PortBridgeServerAgent - this is what I need running on the on-premises machine behind firewall?

I am not quite understand why in the sample for ClientAgent we have
<port localTcpPort="33389" targetHost="dvt03rpldb.ad.hd.hastdeer.com.au" remoteTcpPort="3389">

Are we trying to map local port 33389 -> 3389?

But how then lunch a Remote Desktop app on the client machine to connect remotely to machine where the ServerAgent running? Local RemteApp will try to establish connection using its default port 3389?

Please help as I am stuck here:)

Strange relay behaviour in a high concurrency scenario (50 threads)

Description

Hi guys, we are building a platform which will allow to invoke an on-premise API from the cloud, for this purpose we are using WCF relays which in fact is the appropriate service for us since we need to create the relays on-demand (we have an onboarding API which is responsible for validating the customer license and creates the relay in Azure as part of this process).

At this moment our QA team is working on the load tests in order to know how much traffic supports the platform, during the tests our QA team detected a weird behaviour when they invoke a test case with 50 concurrent requests from JMeter.

Basically, in this scenario (50 concurrent requests), half of the requests fail because of 502 Bad Gateway and 504 Gateway Timeout responses.

The 502 Bad Gateway response comes from the relay, this response indicates that the listener didn't accept the connection within the allowed interval, this behaviour could be right since the listener is too much busy processing the concurrent requests, but the weird thing is that once we receive the 502 Bad Gateway response, no more requests reach the listener (the on-premise API), the only way to make the communication works again is to close the listener and start it again.

I have read the issue "#10 Scale" where is detailed the rendezvous algorithm as follows:

  • Get a local copy of the list of all the known load-balanced listeners for the address requested by the sender (this comes from a cache which is updated every 500ms).
  • If the list of listeners is empty and we haven't refreshed the list of listeners exactly once force refresh the list of known load-balanced listeners for the endpoint.
  • If the list of listeners is empty return an exception to the sender and stop.
  • Pick a random index into the list of potential listeners.
  • Try to rendezvous with the selected listener.
  • If that rendezvous succeeds then stop.
  • If the rendezvous attempt with the selected listener doesn’t succeed within 10 seconds remove the selected listener from the list of listeners to try.
  • If more than 60 seconds have passed return an exception to the sender.
  • Go to step 2.

If the algorithm works in the way described above, then is very sensitive to DoS attacks, since once the rendezvous attempt fails, the listener will be removed from the list of listeners to try, this is a very bad idea since force to our customers to be aware of the load capacity and manage the windows service where is hosted the listener.

The funny thing is that we are applying the "ConnectionStatusBehaviour" to the endpoint to log whatever connection issue and we don't see anything strange in the logs, apparently, the service keeps connected/online.

There is some way to configure a different behaviour when the rendezvous attempt doesn't succeed within 10 seconds? Maybe some parameter which makes bigger the interval for accepting the connection?.

Actual Binding Configuration (WebHttpRelayBinding)

  1. SecurityMode = EndToEndWebHttpSecurityMode.Transport
  2. RelayClientAuthenticationType = RelayClientAuthenticationType.RelayAccessToken
  3. IsDynamic = false
  4. UseDefaultProxy = false
  5. OpenTimeout = 10 seconds
  6. CloseTimeout = 10 seconds
  7. SendTimeout = 10 seconds
  8. ReceiveTimeout = TimeSpan.MaxValue

Actual ServiceThrottlingBehaviour Configuration

  1. MaxConcurrentCalls = 160
  2. MaxConcurrentInstances = 1000
  3. MaxConcurrentSessions = 1160

Actual Wcf Service Behaviour

InstanceContextMode = PerCall
ConcurencyMode = Single

Client-side

The WCF relay is invoked from an AspNetCore 2.2 application using HttpClient since the relay address is discovered at runtime (we cannot use a WCF proxy in this case).

The AspNetCore application is hosted in Azure.

Listener

Deployed on a Virtual Machine in Azure
The system connectivity mode is configured with the value ConnectivityMode.Https

API ASP.NET Core The server returned an invalid or unrecognized response

When connecting to a web service using HttpClient factory (Core 2.1) from App Service via Hybrid Connection to an on-prem web service we get:

ASP.NET Core - Post Request to API - InnerException {System.Net.Http.WinHttpException (0x80072F78): The server returned an invalid or unrecognized response

On-prem. webservice is running on port: 8844
Hybrid Connection Manager show as connected as appears to be configured correctly.
When running the same internally with both services on-prem. (IE not via Hybrid Connection) this works fine.

Does Hybrid Connection do something that makes HttpClient reject the response?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.