This document describes how to set up a Google Cloud project and a
Compute Engine virtual machine (VM).

## Set up a Google Cloud project

<br />

> [!NOTE]
> **Note:** When you enable the Managed Service for Apache Spark API, the Managed Service for Apache Spark Control API is also enabled. Disabling the Managed Service for Apache Spark API doesn't disable the Managed Service for Apache Spark Control API. You must separately disable the Managed Service for Apache Spark Control API.

**Do you Need Credentials?** You need credentials only if
you plan to directly call Managed Service for Apache Spark APIs from your application or from
a browser. If you plan on using the Google Cloud console or the
[Google Cloud CLI](https://docs.cloud.google.com/sdk/gcloud/reference/dataproc) to
create and manage clusters and to submit jobs, you only need to be logged in
to the SDK with the `gcloud init` command.

## Optional: Set up a VM

If you plan to run [gcloud CLI](https://docs.cloud.google.com/sdk/docs.md.txt) from a
Compute Engine virtual machine (VM) instance, the VM must be set up
to access Google Cloud services.

To test whether your VM is set up correctly, run
`gcloud compute instances describe YOUR_VM_INSTANCE_NAME`
from the command line. A service account must be listed that includes the
`https://www.googleapis.com/auth/cloud-platform` scope. For more information
on setting up a VM, see
[Create a VM that uses a user-managed service account](https://docs.cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances.md.txt).

> [!IMPORTANT]
> **Use Cloud Shell to run
> gcloud CLI commands.** As an alternative to setting up your own VM to run SDK commands, open a [Cloud Shell](https://docs.cloud.google.com/shell/docs/launching-cloud-shell.md.txt) session to automatically provision a VM with the necessary scopes, and then run gcloud CLI commands from Cloud Shell.

*** ** * ** ***

[Next Step: Create a Cluster](https://docs.cloud.google.com/managed-spark/docs/guides/create-cluster.md.txt)