> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/google-cloud-functions-services.md).

# Google Cloud Functions services

Configure a Google Cloud Functions service with a function definition manifest, environment version, and artifact source.

A Google Cloud Functions service defines the function you deploy: a function definition manifest linked from your Git repository, the Google Cloud Function environment version, and the artifact source Harness fetches at deploy time.

***

### What you will learn from this topic <a href="#what-you-will-learn-from-this-topic" id="what-you-will-learn-from-this-topic"></a>

* How to link a function definition manifest from a Git repository.
* How to set the Google Cloud Function environment version and add an artifact source.

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* A Git repository, connected through Harness Code, GitHub, Git, GitLab, or Bitbucket, that contains the function definition file.
* The branch and file or folder path of the function definition file in that repository.

***

### Create a Google Cloud Functions service <a href="#create-a-google-cloud-functions-service" id="create-a-google-cloud-functions-service"></a>

1. Go to **Services** and click **New Service**, or edit an existing Google Cloud Functions service.
2. Enter a **Name**. Harness generates the **Id** automatically, for example `service_google-cloud-function_f2a1`.
3. Under **Link the function file from your Git repository**, click **+ Add** to add the function definition manifest.
4. Set the **Google Cloud Function Environment Version**.
5. Under **Artifact source**, click **+ Add** to add the artifact source for the deployable package.
6. Expand **Advanced** or **Metadata** to configure optional settings.
7. Click **Save**.

***

### Add a manifest <a href="#add-a-manifest" id="add-a-manifest"></a>

Clicking **+ Add** under **Link the function file from your Git repository** opens the **Add Manifest** dialog. The manifest type is fixed to **Google Cloud Function Definition**.

| Field                | Default                            | Description                                                                                                 |
| -------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Type**             | `Google Cloud Function Definition` | The manifest type. Fixed and not configurable.                                                              |
| **Source**           | `Harness Code`                     | The Git provider that hosts the function definition file. Also supports GitHub, Git, GitLab, and Bitbucket. |
| **ID**               | —                                  | A name that identifies this manifest.                                                                       |
| **Repository**       | —                                  | The Harness repository that contains the function definition file.                                          |
| **Fetch**            | `Branch`                           | How Harness locates the file in the repository.                                                             |
| **Branch**           | —                                  | The branch to fetch the file from. Shown when **Fetch** is set to **Branch**.                               |
| **File/Folder Path** | —                                  | The path to the function definition file in the repository.                                                 |

***

### Add an artifact source <a href="#add-an-artifact-source" id="add-an-artifact-source"></a>

Clicking **+ Add** under **Artifact source** opens the **Add Primary Artifact** dialog. Artifacts define the source of your application code, and Harness uses these details to fetch the specific version needed for the deployment. **Google Cloud Storage** is the only supported artifact type.

#### Google Cloud Storage <a href="#google-cloud-storage" id="google-cloud-storage"></a>

| Field             | Description                                                 |
| ----------------- | ----------------------------------------------------------- |
| **ID**            | A name that identifies this artifact.                       |
| **Connector**     | The connector used to authenticate to Google Cloud Storage. |
| **Project**       | The Google Cloud project that contains the storage bucket.  |
| **Bucket**        | The Google Cloud Storage bucket that contains the artifact. |
| **Artifact Path** | The path to the artifact file in the bucket.                |

***

### Configure advanced options <a href="#configure-advanced-options" id="configure-advanced-options"></a>

The service editor includes collapsible **Advanced** and **Metadata** sections for additional, optional configuration.

***

### Plugin image reference <a href="#plugin-image-reference" id="plugin-image-reference"></a>

Each Google Cloud Functions step runs a dedicated plugin image. The image is embedded in the step template and is not user-configurable.

| Step          | Plugin image                                           |
| ------------- | ------------------------------------------------------ |
| Deploy        | `harnessdev/google-cloud-function-deploy:0.0.2`        |
| Traffic shift | `harnessdev/google-cloud-function-traffic-shift:0.0.2` |
| Rollback      | `harnessdev/google-cloud-function-rollback:0.0.2`      |

Go to [Google Cloud Functions step library](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/step-library.md) to review each step's inputs and outputs.

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Google Cloud Functions infrastructure](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/google-cloud-functions-infrastructure.md) to configure an infrastructure definition.
* Go to [Deployment strategies](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/google-cloud-functions-deployment-strategies.md) to configure a deployment strategy.
