Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 2.51 KB

howto-configure-audit-logs-cli.md

File metadata and controls

56 lines (40 loc) · 2.51 KB
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

Configure and access audit logs in the Azure CLI

You can configure the Azure Database for MariaDB audit logs from the Azure CLI.

Important

Audit log functionality is currently in preview.

Prerequisites

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.

Configure audit logging

Enable and configure audit logging using the following steps:

  1. 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
    
  2. 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"
    
  3. 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"
    
  4. 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"
    

Next steps

  • Learn more about audit logs in Azure Database for MariaDB
  • Learn how to configure audit logs in the Azure portal