How to change the project in GCP using CLI commands

0 votes
How can I switch the active project in my GCP (Google Cloud Platform) account to a different project using cli commands rather than manually doing gcloud init?

The projects that are active on my account are listed in the gcloud projects list. I want to use a cli command to switch the active project to any other project in the list.
Nov 3, 2022 in GCP by Ashwini
• 2,960 points
121 views

1 answer to this question.

0 votes
gcloud config set project $MY_PROJECT_ID

#=>

Updated property [core/project].

You may also set the environment variable $CLOUDSDK_CORE_PROJECT

answered Nov 4, 2022 by Tejashwini
• 3,470 points

Related Questions In GCP

0 votes
1 answer

How to change the project in GCP using CLI command?

Hi@akhtar, If you configured GCP SDK in your ...READ MORE

answered Sep 13, 2020 in GCP by MD
• 95,420 points
1,388 views
0 votes
1 answer

How to create a new project in GCP using the command line?

Hi@akhtar, You need to configure GCP SDK in ...READ MORE

answered Nov 9, 2020 in GCP by MD
• 95,420 points
515 views
0 votes
1 answer

How to set the project property in the core section in GCP?

Hi@akhtar, The gcloud config set command sets the specified ...READ MORE

answered Nov 9, 2020 in GCP by MD
• 95,420 points
663 views
0 votes
1 answer

What are the service accounts in GCP? How to create one?

The special accounts associated with a project are called the Service Accounts. The ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 59,210 points
374 views
0 votes
0 answers

Google cloud: How to list all service-accounts from all Projects in GCP

I need to obtain every property of ...READ MORE

Nov 9, 2022 in GCP by Ashwini
• 2,960 points
154 views
0 votes
1 answer

In GCP, how to list all the resources running under project?

For a specific organization, folder, or project, ...READ MORE

answered Nov 10, 2022 in GCP by Ashwini
• 2,960 points
1,645 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Using the Google Cloud Platform SDK CLI to List all Active Resources Under a Given Project

For a specific organization, folder, or project, ...READ MORE

answered Nov 7, 2022 in GCP by Tejashwini
• 3,470 points
156 views
0 votes
1 answer

Remote Desktop connect to Ubuntu in GCP

The instructions below can be used to ...READ MORE

answered Nov 4, 2022 in GCP by Tejashwini
• 3,470 points
239 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP