All right, so let's go right on to the next part of this demo,
which is about relay and hybrid connections.
So let's go to relays,
and let me just show you the basic mechanics of the relay service itself.
We create a relay,
and it shares a lot of the same nomenclature and user interface,
actually, as Service Bus and as Event Hubs do,
actually.
They're all using Service Bus under the hood here.
So I'm going to put this in my az800 resource group.
I'll give it a name, twaz800relay1,
and notice that that needs to be a globally unique
name on servicebus.windows.net.
My home region is actually East US, so I'll select that,
and then we create the resource.
The validation succeeded,
so we'll click Create to initialize and submit that deployment.
Now while that's cooking, let me go to another browser tab,
and let's open the portal in another browser because I want
to do a specific implementation of relay.
I have an Azure App Service node app, a sample app running here,
called twaz800webapp1.
Let's give that a click, and if I click Browse,
just to show you what it looks like, it's just a sample,
no‑jazz application running as a hosted app service here in Azure.
But what I want to show you is if we come down under Networking,
there are a number of ways you can customize
networking for a hosted app service.
And in this case, for the relay, that's going to be an outbound traffic control,
as you can see, called Hybrid connections.
So let's say, for example,
that we're migrating from on‑prem into Azure in stages,
and right,
now the front end of our app is running successfully as an app service.
But now we still have a dependency where this app service needs
to communicate with an API that's running,
let's say,
on this local Hyper‑V server on‑prem that doesn't have a public IP address,
we want to protect this machine, etc., etc.
This is a good case for Azure Relay Hybrid Connections.
Let's go to Hybrid connections and turn it on.
You get a quota, it looks like, of 25.
I will imagine that quota number goes up if you're using
a more expensive App Service plan,
but each connection is a single TCP endpoint that is using just
TLS encryption and TCP 443 over the internet.
So there's no dependency in terms of VPN or ExpressRoute,
and you shouldn't have too much trouble with firewalls.
So we have to download the Connection Manager agent to the
other side of the hybrid connection.
So this is going to be my local server.
So let's run this HybridConnectionManager.msi.
Unfortunately, it's Windows only, so if your endpoint is Linux or macOS,
you've got to be more creative,
and what this is going to do here in a moment is it's got a little UI
to it called the Hybrid Connection Manager UI. It has a little UI, so
let's start the UI, and then let's go back to the portal, and let's
add a hybrid connection here.
We'll click Create new hybrid connection.
I'm going to call this localhyperv1. The endpoint host is
localhyperv1.contosolocal.int. Let's say that the service on the server,
the on‑premises server, is 443. So the hybrid connection is going to be
constrained to a single TCP port, and this has a dependency on Service Bus, as
you can see here. And we can either create one or use an existing, and we
created a relay so we can use that as our Service Bus namespace, and let's
click OK to finish that configuration in the cloud, and then we'll finish the
configuration on the remote server.
Let's wait for the notification to finish, which it just did.
So let's come back to our Hybrid Connection Manager UI and click Add
a new Hybrid Connection. Now I already signed in,
and once you've signed in,
you'll have your subscriptions that you have access to. And
here is my localhyperv. Let me select that and click Save. And
you can see the endpoint on TCP 443.
The Azure status is not connected yet. Hmmm. I may have a bit of
troubleshooting to do there, as usual. After consulting Stack Overflow,
somebody mentioned that we can open the service control manager
application on the server and restart the appropriate service,
which is called Azure Hybrid Connection Manager Service. Let's
right‑click and restart, and they also mentioned restarting the UI,
so let's try that next.
There we go, connected.
So now any connection strings or whatever in our app service will
resolve correctly and go on that secure TCP channel into our
remote server, and pretty cool, huh?
So here is the relay itself.
Let's go to the resource, and if you've worked with Service Bus and Event
Hub, you authenticate and authorize access with these shared access policies,
as you can see here, and each of those access policies would have some basic
permissions. Manage would incorporate both send and receive, and then you've
got your connection string here, primary and secondary, that you would use in
your source code.
And then if we go to Hybrid Connections,
we've got the one that we created. Then we can deploy
additional standalone hybrid connections to connect our Azure application to an on‑premises machine.