Skip to content

Instantly share code, notes, and snippets.

@grant
Created May 4, 2021 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/33559dad3213cdfd6cd085aa8de1f9e5 to your computer and use it in GitHub Desktop.
Save grant/33559dad3213cdfd6cd085aa8de1f9e5 to your computer and use it in GitHub Desktop.
Deploy gRPC to Cloud Run
# Get Cloud Run URL
ENDPOINT=$(\
gcloud run services list \
--project=${PROJECT} \
--region=${REGION} \
--platform=managed \
--format="value(status.address.url)" \
--filter="metadata.name=grpc-calculator")
ENDPOINT=${ENDPOINT#https://} && echo ${ENDPOINT}
# gRPCurl URL
grpcurl \
-proto calculator.proto \
-d '{"first_operand": 2.0, "second_operand": 3.0, "operation": "ADD"}' \
${ENDPOINT}:443 \
Calculator.Calculate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment