Skip to content

Instantly share code, notes, and snippets.

@juan-lee
Last active October 8, 2019 21:02
Show Gist options
  • Save juan-lee/edc62abb37fb5cbabaf79c27aa840fa7 to your computer and use it in GitHub Desktop.
Save juan-lee/edc62abb37fb5cbabaf79c27aa840fa7 to your computer and use it in GitHub Desktop.
export EVENTHUB_RESOURCE_GROUP=my-eventrouter
export EVENTHUB_NAMESPACE=my-eventrouter-ns
export EVENTHUB_NAME=my-eventrouter
export EVENTHUB_REGION=westus2
export EVENTHUB_RULE_NAME=eventrouter-send
az group create -g ${EVENTHUB_RESOURCE_GROUP} -l ${EVENTHUB_REGION}
az eventhubs namespace create -g ${EVENTHUB_RESOURCE_GROUP} -n ${EVENTHUB_NAMESPACE} -l ${EVENTHUB_REGION}
az eventhubs eventhub create -g ${EVENTHUB_RESOURCE_GROUP} --namespace-name ${EVENTHUB_NAMESPACE} -n ${EVENTHUB_NAME}
az eventhubs eventhub authorization-rule create -g ${EVENTHUB_RESOURCE_GROUP} --namespace-name ${EVENTHUB_NAMESPACE} --eventhub-name ${EVENTHUB_NAME} -n ${EVENTHUB_RULE_NAME} --rights Send
export EVENTHUB_CONNECTION_STRING=$(az eventhubs eventhub authorization-rule keys list -g ${EVENTHUB_RESOURCE_GROUP} --namespace-name ${EVENTHUB_NAMESPACE} --eventhub-name ${EVENTHUB_NAME} -n ${EVENTHUB_RULE_NAME} -o json | jq -r '.primaryConnectionString')
curl https://gist.githubusercontent.com/juan-lee/437792a662b5415a274107f95e973eab/raw/25ff9656dcde40ba019596a1c6607c3fd2c464d9/eventrouter.yaml | envsubst | kubectl apply -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment