title | description | author | ms.author | ms.service | ms.topic | ms.date |
---|---|---|---|---|---|---|
Access audit logs - Azure CLI - Azure Database for MariaDB |
This article describes how to configure and access the audit logs in Azure Database for MariaDB from the Azure CLI. |
ajlam |
andrela |
mariadb |
conceptual |
4/13/2020 |
You can configure the Azure Database for MariaDB audit logs from the Azure CLI.
Important
Audit log functionality is currently in preview.
To step through this how-to guide, you need:
[!INCLUDE cloud-shell-try-it.md]
Important
This how-to guide requires that you use Azure CLI version 2.0 or later. To confirm the version, at the Azure CLI command prompt, enter az --version
. To install or upgrade, see Install Azure CLI.
Enable and configure audit logging using the following steps:
-
Turn on audit logs by setting the audit_logs_enabled parameter to "ON".
az mariadb server configuration set --name audit_log_enabled --resource-group myresourcegroup --server mydemoserver --value ON
-
Select the event types to be logged by updating the audit_log_egitvents parameter.
az mariadb server configuration set --name audit_log_events --resource-group myresourcegroup --server mydemoserver --value "ADMIN,CONNECTION"
-
Add any MariaDB users to be excluded from logging by updating the audit_log_exclude_users parameter. Specify users by providing their MariaDB user name.
az mariadb server configuration set --name audit_log_exclude_users --resource-group myresourcegroup --server mydemoserver --value "azure_superuser"
-
Add any specific MariaDB users to be included for logging by updating the audit_log_include_users parameter. Specify users by providing their MariaDB user name.
az mariadb server configuration set --name audit_log_include_users --resource-group myresourcegroup --server mydemoserver --value "sampleuser"
- Learn more about audit logs in Azure Database for MariaDB
- Learn how to configure audit logs in the Azure portal