google-cloud-platform

Generate JWT in Google cloud function - python

筅森魡賤 提交于 2021-02-11 09:39:09
问题 I wrote a script and uploaded it to GCFunctions. Now, one of my functions is using PyJWT library in order to generate JWT for GCP API calls, the problem is that I keep getting errors every time I run the function. When I added pyjwt to 'requirements.txt' I got the error: 'Algorithm RS256 could not be found', then I tried to add cryptography (the encrypting library that pyjwt uses), and also tried pycrypto (for RS256 registering) but still nothing. I'd be grateful for some help here! even

Is there a way for Google Cloud Python Authentication via the JSON keyfile itself and not the file path?

六眼飞鱼酱① 提交于 2021-02-11 06:54:15
问题 So for Ruby, you can set the JSON content into the environmental variable of GOOGLE_CLOUD_KEYFILE_JSON . I am trying to find the documentation for Python, but all I can see is documentation loading the authentication for file path. 回答1: I found a way to do it, but I want to know if there is a better way. Using the google-auth library, I can do something like this: import json from google.cloud import bigquery from google.oauth2 import service_account """ Securely get content of JSON file from

Google Cloud Build & Firebase Deploy - “An unexpected error has occurred”

北战南征 提交于 2021-02-11 05:54:59
问题 I'm using Google Cloud Build to do a deployment to Firebase Hosting when a commit is on master. I'm using the Firebase Cloud Builder, deployed to my project. I've checked permissions in the Cloud Console and Firebase access is enabled. Everything seems to go well in generating the static HTML for hosting, but at the final build step it fails suddenly with this problem: Error: An unexpected error has occurred. Here is the step in my cloudbuild.yaml that fails: - name: gcr.io/$PROJECT_ID

Google Cloud Build & Firebase Deploy - “An unexpected error has occurred”

孤街浪徒 提交于 2021-02-11 05:54:34
问题 I'm using Google Cloud Build to do a deployment to Firebase Hosting when a commit is on master. I'm using the Firebase Cloud Builder, deployed to my project. I've checked permissions in the Cloud Console and Firebase access is enabled. Everything seems to go well in generating the static HTML for hosting, but at the final build step it fails suddenly with this problem: Error: An unexpected error has occurred. Here is the step in my cloudbuild.yaml that fails: - name: gcr.io/$PROJECT_ID

Google Cloud Build & Firebase Deploy - “An unexpected error has occurred”

◇◆丶佛笑我妖孽 提交于 2021-02-11 05:54:20
问题 I'm using Google Cloud Build to do a deployment to Firebase Hosting when a commit is on master. I'm using the Firebase Cloud Builder, deployed to my project. I've checked permissions in the Cloud Console and Firebase access is enabled. Everything seems to go well in generating the static HTML for hosting, but at the final build step it fails suddenly with this problem: Error: An unexpected error has occurred. Here is the step in my cloudbuild.yaml that fails: - name: gcr.io/$PROJECT_ID

How to configure multiple gcloud projects

风格不统一 提交于 2021-02-11 05:18:40
问题 On my work laptop, i have gcloud configured with our prod projects. when i do gcloud config configurations list , I get only one row in result, which is ACTIVE and it's my work-project. Now for some personal testing, I have created a separate project which is associated with my personal email id. How would i configure/connect this project with my gcloud cli? I have tried gcloud auth application-default login which opened the browser, i signed in using personal email id. The webpage showed me

How to configure multiple gcloud projects

走远了吗. 提交于 2021-02-11 05:08:33
问题 On my work laptop, i have gcloud configured with our prod projects. when i do gcloud config configurations list , I get only one row in result, which is ACTIVE and it's my work-project. Now for some personal testing, I have created a separate project which is associated with my personal email id. How would i configure/connect this project with my gcloud cli? I have tried gcloud auth application-default login which opened the browser, i signed in using personal email id. The webpage showed me

Stack-driver metrics export

牧云@^-^@ 提交于 2021-02-11 05:04:48
问题 Environment: CloudShell code : python2.7 I want to export Metrics from Cloud Monitoring to Big Query and google has given a solution on how to do this. I am following this in this below article: https://cloud.google.com/solutions/stackdriver-monitoring-metric-export I have downloaded the code from github: https://github.com/GoogleCloudPlatform/stackdriver-metrics-export and I am following the readme and trying to run the application in my google project. When I install and run any of the app

Cannot connect Google Cloud SQL in MySql Workbench

吃可爱长大的小学妹 提交于 2021-02-11 02:48:29
问题 I have created a MySql server in Google Cloud SQL and trying it to connect it from my local machine using MySql Workbench but i am not able to establish a connection to it. I get the following error Failed to Connect to MySQL at {IP-Address}:3306 with user root(10060) 回答1: If you are trying to connect from outside network to gcp sql instance you need to add your public ip of your machine in the connection of sql instance Go to your sql instance Go to Connections tab Under Connectivity select

Cannot connect Google Cloud SQL in MySql Workbench

爷,独闯天下 提交于 2021-02-11 02:47:11
问题 I have created a MySql server in Google Cloud SQL and trying it to connect it from my local machine using MySql Workbench but i am not able to establish a connection to it. I get the following error Failed to Connect to MySQL at {IP-Address}:3306 with user root(10060) 回答1: If you are trying to connect from outside network to gcp sql instance you need to add your public ip of your machine in the connection of sql instance Go to your sql instance Go to Connections tab Under Connectivity select