# Update

Launch stage: GA

`PATCH /api/2.0/accounts/{customer_facing_workspace.account_id}/workspaces/{customer_facing_workspace.workspace_id}`

Updates a workspace.

API scopes: provisioning

Clouds: AWS, Azure

**AWS**

Updates the configuration of a running workspace.

Updatable fields include:
- `credentials_id`: The credential configuration ID.
- `network_id`: The network configuration ID. You can only update this field if the workspace already uses a customer-managed VPC.
- `managed_services_customer_managed_key_id`: The key configuration ID for managed services.
- `storage_customer_managed_key_id`: The key configuration ID for workspace storage. You cannot replace an existing key configuration for workspace storage. This field is only updatable for workspaces without a key configuration for workspace storage.
- `private_access_settings_id`: The private access settings ID. Can add or upgrade PrivateLink support, but you cannot downgrade a workspace that already has PrivateLink support.
- `custom_tags`: The custom tags. If you update the workspace with empty custom tags, no update is applied.
- `network_connectivity_config_id`: The network connectivity configuration ID. Once attached to a workspace, this can be switched but not removed.

**Important**: To update a running workspace, you must first stop all running compute resources in the workspace's VPC in the classic data plane, including all-purpose compute, job compute, pools with running compute, and classic SQL warehouses.

This operation is asynchronous. After calling `PATCH`, poll the workspace with `GET` requests and check the workspace status. The update is successful when the status changes from `PROVISIONING` to `RUNNING`. Wait up to 20 minutes after the workspace is running before creating or using compute.

If you update only the managed services key configuration, you do not need to stop DBFS API calls. For storage customer-managed key configurations, stop all DBFS API calls for 20 minutes while changes take effect.

**Azure**

Updates a workspace configuration. This API allows you to assign the workspace to a network connectivity configuration object. Upon assignment, the network configuration will propagated to the serverless compute plane of your Azure <Databricks> workspace. It will be applied after you create or restart your serverless SQL warehouses. See configure serverless secure connectivity.

## Path parameters

- `customer_facing_workspace` (object, optional)
  - `workspace_id` (int64, optional)
    A unique integer ID for the workspace
  - `workspace_name` (string, optional)
    The human-readable name of the workspace.
    Constraints: `[ 1 .. 100 ] characters`
  - `aws_region` (string, optional)
    **AWS:** The AWS region of the workspace data plane (for example, `us-west-2`).
  - `creation_time` (int64, optional)
    Time in epoch milliseconds when the workspace was created.
  - `deployment_name` (string, optional)
    **AWS:** The deployment name defines part of the subdomain for the workspace. The workspace URL for web application and REST APIs is `<deployment-name>.cloud.databricks.com`.
    Constraints: `<= 64 characters`
  - `workspace_status` (string, optional)
    The status of a workspace
    Possible values: `NOT_PROVISIONED`, `PROVISIONING`, `RUNNING`, `FAILED`, `BANNED`, `CANCELLING`
  - `account_id` (string, optional)
    <Databricks> account ID.
  - `credentials_id` (string, optional)
    ID of the workspace's credential configuration object.
  - `storage_configuration_id` (string, optional)
    ID of the workspace's storage configuration object.
  - `workspace_status_message` (string, optional)
    Message describing the current workspace status.
  - `network_id` (string, required)
    If this workspace is BYO VPC, then the network_id will be populated. If this workspace is not
     BYO VPC, then the network_id will be empty.
  - `pricing_tier` (string, optional)
    Possible values: `UNKNOWN`, `COMMUNITY_EDITION`, `STANDARD`, `PREMIUM`, `ENTERPRISE`, `DEDICATED`
  - `private_access_settings_id` (string, optional)
    ID of the workspace's private access settings object. Only used for PrivateLink. You must specify this ID if you are using [AWS PrivateLink](https://aws.amazon.com/privatelink/) for either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both connection types.
    
     Before configuring PrivateLink, read the [<Databricks> article about PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).",
  - `managed_services_customer_managed_key_id` (string, optional)
    ID of the key configuration for encrypting managed services.
  - `storage_customer_managed_key_id` (string, optional)
    ID of the key configuration for encrypting workspace storage.
  - `azure_workspace_info` (object, optional)
    - `resource_group` (string, optional)
      Azure Resource Group name
    - `subscription_id` (string, optional)
      Azure Subscription ID
  - `custom_tags` (object, optional)
    The custom tags key-value pairing that is attached to this workspace. The key-value pair is a string of utf-8 characters. The value can be an empty string, 
     with maximum length of 255 characters. The key can be of maximum length of 127 characters, and cannot be empty.
  - `network_connectivity_config_id` (string, optional)
    The object ID of network connectivity config.
  - `storage_mode` (string, optional)
    The storage mode of the workspace.
    Possible values: `CUSTOMER_HOSTED`, `DEFAULT_STORAGE`
  - `compute_mode` (string, optional)
    The compute mode of the workspace.
    Possible values: `HYBRID`, `SERVERLESS`

## Returns

Returns the Workspace object.

## Response

```json
{
  "workspace_id": 0,
  "workspace_name": "string",
  "aws_region": "string",
  "creation_time": 0,
  "deployment_name": "string",
  "workspace_status": "string",
  "account_id": "string",
  "credentials_id": "string",
  "storage_configuration_id": "string",
  "workspace_status_message": "string",
  "network_id": "string",
  "pricing_tier": "string",
  "private_access_settings_id": "string",
  "managed_services_customer_managed_key_id": "string",
  "storage_customer_managed_key_id": "string",
  "azure_workspace_info": {
    "resource_group": "string",
    "subscription_id": "string"
  },
  "custom_tags": {},
  "network_connectivity_config_id": "string",
  "storage_mode": "string",
  "compute_mode": "string"
}
```

