How to get the URL of a Cloud Run Function from within a Cloud Run Function - Stack Overflow

I have a python cloud run function and I want to get the URL of another cloud run function programatica

I have a python cloud run function and I want to get the URL of another cloud run function programatically. I want to avoid hard coding the URL if possible. I need the URL so that I can create a task that has this other functions url as the HTTP url, and then send that task to a task queue.

I have a python cloud run function and I want to get the URL of another cloud run function programatically. I want to avoid hard coding the URL if possible. I need the URL so that I can create a task that has this other functions url as the HTTP url, and then send that task to a task queue.

Share Improve this question edited Mar 26 at 18:29 yambo asked Mar 26 at 6:49 yamboyambo 1,8503 gold badges22 silver badges42 bronze badges 1
  • Depending of your context... might not work your particular case, but can that 'another cloud function' URL be provided as an environment variable value during the deployment of your main cloud function? – al-dann Commented Mar 26 at 9:31
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, it is possible to obtain the URL of another Cloud Run function from a Cloud Run function itself.

If you know the name of the Cloud Run function, you can use the Deterministic URL approach. This allows you to determine the URL of the function by simply filling in the necessary details. This information is available even before the function is created.

To get the URL programmatically, you can utilize the Cloud Functions Python library get_function to retrieve the details of another Cloud Run function. However, ensure that the Cloud Run function's identity service account has the Cloud Functions Viewer Role when making the request using this library, as it requires run.services.get or cloudfunctions.functions.get permissions.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744161000a4561089.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信