Exercise 3: Provisioning Azure Relay
Provisioning Azure Relay is similar to provisioning Azure Service Bus. The namespace needs to be deployed first, and then one or many hybrid connections or WCF relays can be deployed next. The following code example will help you to provision Azure Relay and hybrid connections endpoints:
Note
The following commands should be executed in Bash. Use Cloud Shell or install the Azure CLI (http://aka.ms/azcli) locally. The resources provisioned will be used for the next step, so save the connection string from the output.
- Create a resource group:
az group create -l eastus -n MessagingDemo-RG
- To avoid name collisions, generate a unique name for your account:
Account=relay$RANDOM
- Create a relay namespace:
az relay namespace create --name $account --resource-group MessagingDemo-RG
- Create a hybrid relay:
az relay hyco create --name "relay" --namespace-name $account --resource-group MessagingDemo...