2022-05-26 10:06:25 -05:00
---
aliases:
2022-12-09 10:36:04 -06:00
- ../../enterprise/settings-updates/
2022-05-26 10:06:25 -05:00
description: Settings updates at runtime
keywords:
- grafana
- runtime
- settings
title: Settings updates at runtime
weight: 500
---
2021-05-28 06:28:40 -05:00
# Settings updates at runtime
2022-05-25 14:31:49 -05:00
> **Note:** Available in Grafana Enterprise version 8.0 and later.
2021-05-28 06:28:40 -05:00
2022-05-25 14:31:49 -05:00
By updating settings at runtime, you can update Grafana settings without needing to restart the Grafana server.
2021-05-28 06:28:40 -05:00
Updates that happen at runtime are stored in the database and override
2022-10-28 07:13:40 -05:00
[settings from the other sources ]({{< relref "../../configure-grafana/" >}} )
2021-05-28 06:28:40 -05:00
(arguments, environment variables, settings file, etc). Therefore, every time a specific setting key is removed at runtime,
2021-08-06 08:52:36 -05:00
the value used for that key is the inherited one from the other sources in the reverse order of precedence
2021-05-28 06:28:40 -05:00
(`arguments > environment variables > settings file`), being the application default the value used when no one provided
through one of these, at least.
2021-08-06 08:52:36 -05:00
Currently, **it only supports updates on the `auth.saml` section.**
2021-05-28 06:28:40 -05:00
## Update settings via the API
2022-10-28 07:13:40 -05:00
You can update settings through the [Admin API ]({{< relref "../../../developers/http_api/admin/#update-settings" >}} ).
2021-05-28 06:28:40 -05:00
When you submit a settings update via API, Grafana verifies if the given settings updates are allowed and valid. If they are, then Grafana stores the settings in the database and reloads
Grafana services with no need to restart the instance.
2021-08-06 08:52:36 -05:00
So, the payload of a `PUT` request to the update settings endpoint (`/api/admin/settings`)
2021-05-28 06:28:40 -05:00
should contain (either one or both):
2021-08-06 08:52:36 -05:00
2021-05-28 06:28:40 -05:00
- An `updates` map with a key, and a value per section you want to set.
- A `removals` list with keys per section you want to unset.
For example, if you provide the following `updates` :
```json
{
2021-07-30 06:04:13 -05:00
"updates": {
"auth.saml": {
"enabled": "true",
"single_logout": "false"
}
}
2021-05-28 06:28:40 -05:00
}
```
2021-08-06 08:52:36 -05:00
2021-05-28 06:28:40 -05:00
it would enable SAML and disable single logouts. And, if you provide the following `removals` :
2021-08-06 08:52:36 -05:00
2021-05-28 06:28:40 -05:00
```json
{
"auth.saml": ["allow_idp_initiated"]
}
```
it would remove the key/value setting identified by `allow_idp_initiated` within the `auth.saml` .
So, the SAML service would be reloaded and that value would be inherited for either (settings `.ini` file,
environment variable, command line arguments or any other accepted mechanism to provide configuration).
Therefore, the complete HTTP payload would looks like:
```json
{
"updates": {
"auth.saml": {
"enabled": "true",
"single_logout": "false"
}
},
"removals": {
"auth.saml": ["allow_idp_initiated"]
}
}
```
In case any of these settings cannot be overridden nor valid, it would return an error and these settings
won't be persisted into the database.
## Background job (high availability set-ups)
Grafana Enterprise has a built-in scheduled background job that looks into the database every minute for
2021-08-06 08:52:36 -05:00
settings updates. If there are updates, it reloads the Grafana services affected by the detected changes.
2021-05-28 06:28:40 -05:00
The background job synchronizes settings between instances in high availability set-ups. So, after you perform some changes through the
HTTP API, then the other instances are synchronized through the database and the background job.
2021-07-30 06:04:13 -05:00
2022-04-27 09:51:56 -05:00
## Control access with role-based access control
2021-07-30 06:04:13 -05:00
2022-10-28 07:13:40 -05:00
If you have [role-based access control ]({{< relref "../../../administration/roles-and-permissions/access-control/" >}} ) enabled, you can control who can read or update settings.
Refer to the [Admin API ]({{< relref "../../../developers/http_api/admin/#update-settings" >}} ) for more information.