# IRPCVaultAdmin.SetVaultVariables

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Vault administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/SetVaultVariables/

Badges: `Administration API / specialized` `internal: not for applications` `admin` `session` `idempotent`

Sets the Microsoft Entra ID (Azure AD) consent mode of the vault.

- **Service:** [Vault administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/index.md) `MFiles.IRPCVaultAdmin`
- **gRPC method:** `/MFiles.IRPCVaultAdmin/SetVaultVariables`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/set-vault-variables`
- **Request:** [`SetVaultVariablesRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/SetVaultVariables/index.md#request)
- **Response:** [`SetVaultVariablesResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/SetVaultVariables/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- **For M-Files components only.** M-Files Admin calls it when it sets up Entra ID authentication.
  Applications should not call it.
- Requires a vault session with full control of the vault.
- Accepts only the vault variable `AZUREACTIVEDIRECTORYCONSENTMODE`; any other name fails with an
  invalid-argument error. To change other vault variables, use
  [UpdateVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/UpdateVault/index.md).

<a id="request"></a>

## Request: SetVaultVariablesRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `vaultvariables[]` | repeated [`VaultVariable`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultVariable/index.md) | The vault variables to set; only `AZUREACTIVEDIRECTORYCONSENTMODE` is accepted. |
| `vaultvariables[].name` | `string` | The name of the vault variable. |
| `vaultvariables[].value` | `bytes` | The value of the variable in a serialized format. |
| `update_in_db` | `bool` | True to also store the variables in the vault database. |

<a id="response"></a>

## Response: SetVaultVariablesResponse

No fields.

<a id="related"></a>

## Related methods

- [IRPCVaultsAdmin.UpdateVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/UpdateVault/index.md): Changes the definition of a vault: name and other registration data, data folders, database, file data storage and vault variables.
