[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for Apache Spark™](../index.md) > [Step-by-step guides](index.md) > Environments > Delete the environments.

# Deleting an environment

You can delete an environment if you no longer need it.

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you want to delete an environment.
  1. [Navigate](https://console.yandex.cloud/link/managed-spark) to **Managed Service for Apache Spark™**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/cubes-3.svg) **Environments**.
  1. Click ![image](../../_assets/console-icons/ellipsis.svg) next to the environment and select **Delete**.
  1. In the window that opens, confirm the deletion and click **Delete**.

- gRPC API {#grpc-api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

       ```bash
       export IAM_TOKEN="<IAM_token>"
       ```

    1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
       
       ```bash
       cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
       ```
       
       Below, we assume that the repository contents reside in the `~/cloudapi/` directory.

    1. Call the [EnvironmentService/Delete](../environment/api-ref/grpc/Environment/delete.md) method to delete the environment:

       ```bash
       grpcurl \
         -format json \
         -import-path ~/cloudapi/ \
         -import-path ~/cloudapi/third_party/googleapis/ \
         -proto ~/cloudapi/yandex/cloud/spark/v1/environment/environment_service.proto \
         -rpc-header "Authorization: Bearer $IAM_TOKEN" \
         -d '{
                "environment_id": "<environment_ID>"
            }' \
         spark.api.cloud.yandex.net:443 \
         yandex.cloud.spark.v1.environment.EnvironmentService.Delete
       ```

       To get your environment ID, call the [EnvironmentService/List](../environment/api-ref/grpc/Environment/list.md) method.

    1. Check the [server response](../environment/api-ref/grpc/Environment/delete.md#yandex.cloud.operation.Operation) to make sure your request was successful.

{% endlist %}