# How to Configure Functions Functions are blocks of code that run on demand without the need to manage any infrastructure. Develop on your local machine, test your code from the command line (using `doctl`), then deploy to a production namespace or App Platform — no servers required. If you have deployed a function through the DigitalOcean Control Panel, you can configure it using its **Settings** tab. **Note**: Functions that have been deployed from the command line using `doctl` should be configured through their `project.yml` file instead. Any settings changed in the control panel could be overwritten by future command line deploys. See the [Project Configuration YAML File reference](https://docs.digitalocean.com/products/functions/reference/project-configuration/index.html.md) for more information on configuring settings using `project.yml`. To get to a function’s **Settings** tab, first navigate to the function in the control panel: find the function that you’d like to update in the function list, then click its name to go to the function’s **Source** tab. Then, click the **Settings** tab. From this tab you can configure the function’s runtime, resource limits, environmental variables, and its access and security settings. You can also destroy the function to permanently delete it. ## Runtime Setting A function’s runtime is the programming language environment that runs your code. To change the runtime, click the **Edit** text beside the runtime setting. Choose a new runtime from the drop-down menu, then press **Save** to save the selection. **Warning**: If you change your runtime to a completely different language, your function’s code is replaced with example code for the new language. If you change to a different version of the same language, your code remains unchanged. ## Resource Limits The **Limits** section allows for editing the function’s timeout and memory limits. Click the **Edit** text to change these settings. - **Timeout**: entered in milliseconds (ms), this setting determines the maximum length of time your function runs before it is terminated. This is useful for automatically ending function invocations that are taking longer than expected due to errors or connectivity issues. The maximum timeout is 15 minutes. - **Memory**: entered in megabytes (MB), this is the amount of memory resources available to your function. The maximum memory setting is currently 1,024 MB (1 GB). ## Environment Variables The **Environment Variables** section shows how many environment variables are currently set. Click the **Edit** text to edit the variables. The editing interface shows the current variables, a button for the **Raw Editor**, and a form where you can add key/value pairs one at a time. To add an environment variable, fill out the **Add Environment Variable** form, then press **Add**. This screenshot shows the user adding an `example_key=demo` variable. After pressing **Add** the variable is added to the list of variables. From here, **you must press *Save* to save the changes to your variables** and exit out of the editing interface. An alternate way of adding and editing environment variables is to use the raw editor. This can be useful for copying and pasting multiple variables at once. Click the **Raw Editor** button to open the editor. You may add `key=value` pairs following standard `.env` file rules. Hit **Save** and the variables is parsed and the list of variables is updated. Press **Save** again to save the new set of variables and exit the editing interface. ## Access & Security This section allows you to control settings related to **Web Functions** and function authentication. It also shows example `curl` commands for invoking the current function. **Web Functions** are functions that are accessible through normal HTTP methods such as `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, and `OPTIONS`. These functions are expected to be synchronous, meaning they accept requests, do their work, and return a response as soon as possible (within the configured timeout). Click the **Edit** text to configure the **Web Functions** Settings. There are three checkboxes to configure: - **Web Function**: determines if the web function feature is enabled. If you disable web functions, you can still access your function through the authenticated REST API. - **Raw HTTP**: when enabled, the function receives requests as base64-encoded text, instead of a parsed JSON body. - **Secure Web Function**: by default, web functions can be invoked by anybody who knows the function URL. To require authentication, enable **Secure Web Function**. This prompts you to enter a secret token, which you then need to provide in the `x-require-whisk-auth` header for each request. To authenticate with the REST API, use a namespace access key. See [How to Manage Namespace Access Keys](https://docs.digitalocean.com/products/functions/how-to/manage-namespace-access/index.html.md) to create and manage access keys. ## Destroy Function To permanently destroy your function, click **Destroy**. A confirmation form pops up. Enter the function name into the field and then press **Destroy** again to confirm. You can read more about the **Destroy** feature in [How to Destroy Functions](https://docs.digitalocean.com/products/functions/how-to/destroy/index.html.md)