# Enable Audit Logging on Azure MySQL Servers to Enhance Security and Compliance

- Source: https://support.icompaas.com/support/solutions/articles/62000234787-enable-audit-logging-on-azure-mysql-servers-to-enhance-security-and-compliance
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Azure Database Services Benchmark v1.0.0](https://support.icompaas.com/support/solutions/62000112693) › [Azure Database Services Benchmark](https://support.icompaas.com/support/solutions/folders/62000169261)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**

-   **Level 2**  
    

**Description:** Enabling the audit\_log\_enabled parameter on MySQL servers logs actions such as connection attempts, DDL (Data Definition Language), DML (Data Manipulation Language) access, and other queries. This helps in identifying, troubleshooting, and improving performance by keeping track of all database interactions.

**Rationale:** Enabling audit logging allows database administrators to monitor critical activities and review database access patterns, which is essential for security audits, troubleshooting, and performance optimization. It is particularly useful for compliance with standards requiring audit trails for security events.

**Impact:**

-   Pros:  
    
    -   Provides detailed logs for security and performance analysis.  
        
    -   Helps track unauthorized access or malicious activities.  
        
    -   Supports compliance and audit requirements.  
        
-   Cons:  
    
    -   Increased storage costs due to the logs generated, especially on high-traffic servers.  
        
    -   May require additional configuration for managing large log files.  
        

**Default Value:**

The audit\_log\_enabled parameter is set to OFF by default.

**Pre-requisites:** Ensure that proper log management and storage solutions are in place to handle the audit logs.

**Remediation**

**Test Plan:**

**Using Azure Portal:**

1.  Log in to Azure Portal: [https://portal.azure.com](https://portal.azure.com/).  
    
2.  Go to Azure Database for MySQL Servers.  
    
3.  For each database, under the Settings section, click on Server parameters.  
    
4.  Ensure the audit\_log\_enabled parameter is set to ON.
    

**Using Azure CLI:**1\. Run the following command to check the audit\_log\_enabled parameter:

az mysql server show --resource-group <resource-group-name> --name <server-name> --query "properties.parameters.audit\_log\_enabled"

  

-   The output should show true if the parameter is enabled.
    

**Implementation Plan:**

**Using Azure Portal:**

1.  Log in to Azure Portal.  
    
2.  Navigate to Azure Database for MySQL Servers.  
    
3.  Select the database instance.  
    
4.  Under Settings, click on Server parameters.  
    
5.  Set the audit\_log\_enabled parameter to ON and save.
    

**Using Azure CLI:**1\. To enable the audit\_log\_enabled parameter, run the following command:

az mysql server configuration set --resource-group <resource-group-name> --server-name <server-name> --name audit\_log\_enabled --value ON

  

**Backout Plan:**

**Using Azure Portal:**

1.  Go to Azure Database for MySQL Servers.  
    
2.  Under Settings, click on Server parameters.  
    
3.  Change the audit\_log\_enabled parameter to OFF and save.
    

**Using Azure CLI:**1.  To disable the audit\_log\_enabled parameter, run:

az mysql server configuration set --resource-group <resource-group-name> --server-name <server-name> --name audit\_log\_enabled --value OFF

**References:**

-   [How to Configure Audit Logs for MySQL Database Servers  
    ](https://docs.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-audit-logs-portal)
    
-   [Enable Logging for Security Investigation](https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-logging-threat-detection#lt-3-enable-logging-for-security-investigation)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
