--- title: "Edit a function" description: "Change a Functions function's code, environment variables, or system configuration, and what Save does to its version." content_type: "how-to" product: "functions" platform: "MyAccount" url: "/myaccount/functions/how-to/edit-a-function/" topic: ["edit"] relationships: {"requires":["/myaccount/functions/how-to/create-a-function/"]} --- # Edit a function You can change a function after you create it: its code and requirements, its environment variables, and its system configuration. Saving your changes rebuilds and redeploys the function. ## Before you begin Open the function once it is **Running** or **Failed**. You can edit and save a failed function like any other. A function's code, environment variables, and settings are read-only while it is **Creating** or **Deploying**. ## Open the function In **Compute > Functions**, under **Actions**, click the pencil icon for the function. You can also click the function's name. The function's page opens with its code editor. ## Edit the code and environment Edit the code and the requirements file in their tabs. You can also replace the code with a fresh ZIP in the upload area above the editor. See [Upload code as a ZIP](/myaccount/functions/how-to/upload-code-as-a-zip/). Add or change **Environment variables** in **Function Configuration**. See [Use environment variables](/myaccount/functions/how-to/use-environment-variables/) for the naming rules. ## Edit the system configuration Open the **System Configuration** tab. There you can change: - **Memory**: 128, 256, 512, or 1024 MB. - **Timeout (sec)**: the seconds a function can run, from 1 to 600. - **Enable Dedicated Replica** and **Minimum Replica**, for CPU and container functions. See [Keep a function ready with dedicated replicas](/myaccount/functions/how-to/keep-a-function-ready-with-dedicated-replicas/). The function's name, runtime, and hardware stay as you set them when you created it. To change any of them, create a new function. See [Create a function](/myaccount/functions/how-to/create-a-function/). ## Save the changes Once you change the code, the environment variables, or the system configuration, the **Try** button above the editor becomes **Save**. On a **Failed** function, **Save** is available once you change something. Click **Save**. Saving rebuilds and redeploys the function. On the **Python 3.11 (Http)** sample, a saved edit takes about 15 seconds to redeploy. A new function's **Version** is 0, and the first saved edit makes it 1. Each later save raises it by one. ## Check that the change applied Select the function in the Functions list and open the **Info** tab below the list. Check that **Version** went up by one. Call the function again to confirm the new behaviour. See [Call a function](/myaccount/functions/how-to/call-a-function/). If the function fails after an edit, check its logs. See [View logs and monitoring](/myaccount/functions/how-to/view-logs-and-monitoring/) and [Troubleshooting Functions](/myaccount/functions/troubleshooting/functions/).