> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup and administration

> Learn how to set up and activate Cognite Functions, configure permissions, and prepare your environment to deploy Python code in CDF.

The [Functions service](/api-reference/concepts/20230101/functions) provides a **scalable**, **secure**, and **automated** way to host and run the **Python** code.

The Python code can range from basic operations and data transformations to deploying advanced machine learning models. For example, you can use Functions to:

* Preprocess data, transform and validate data, convert data to the same unit, and detect deviation from estimated production.
* Convert from simple to complex calculations: interpolation, production trends, computing gas rates, generating alarms based on events.
* Create statistical models for forecasting oil/water separation and time series smoothing.

## Before you start

* Make sure you have [registered the Cognite API and the CDF application in Microsoft Entra ID](/cdf/access/entra/guides/configure_cdf_azure_oidc) and [set up Microsoft Entra ID and CDF groups](/cdf/access/entra/guides/create_groups_oidc).

* You must also have the [Python SDK](https://github.com/cognitedata/cognite-sdk-python) installed in your environment if you want to create functions using the SDK.

* To use functions, a **user** or an **application** must be a member of a CDF group with these **capabilities**:

  | Action                                                             | Required capabilities                                     |
  | ------------------------------------------------------------------ | --------------------------------------------------------- |
  | Create functions                                                   | `functions:write`, `files:read`, `files:write`            |
  | Call functions                                                     | `functions:run` (or `functions:write`), `sessions:create` |
  | List and retrieve functions, schedules, calls, responses, and logs | `functions:read`                                          |
  | Schedule functions                                                 | `functions:write`, `sessions:create`                      |
  | Delete functions and schedules                                     | `functions:write`                                         |

<Info>
  Read more about [capabilities](/cdf/access/guides/capabilities).
</Info>

## Activate Cognite Functions in CDF

Before creating a Cognite Function, you may have to activate functions in CDF.

<Steps>
  <Step title="Navigate to Functions">
    Navigate to <span class="ui-element">Data fusion</span> > <span class="ui-element">Build solutions</span> > <span class="ui-element">Functions</span>.

    * If you see the warning: `Cognite Functions is not activated for the project`, select **Activate** to request activation.

    * If you see the **Upload function** button, your project is already activated for Cognite Functions.
  </Step>

  <Step title="Wait for activation">
    Activation can take up to two hours. The **Activation in progress** message will be shown until the process has been completed.

    <Check>
      The **Upload function** button is available when the activation is completed.
    </Check>
  </Step>
</Steps>

You can now create Cognite Functions using CDF, [the Functions API](/api-reference/concepts/20230101/functions), or the [Python SDK](https://cognite-sdk-python.readthedocs-hosted.com/en/latest/functions.html).
