Skip to content
logo
Percona Monitoring and Management
Microsoft Azure
Initializing search
    percona/pmm-doc
    percona/pmm-doc
    • Welcome
        • Network
        • Docker
        • Podman
        • Helm
        • Virtual Appliance
        • AWS Marketplace
        • Easy-install script
        • MySQL
        • MongoDB
        • PostgreSQL
        • ProxySQL
        • Amazon RDS
        • Microsoft Azure
          • Activate Microsoft Azure
          • Required settings
          • Setting up a MySQL instance
          • Adding an Azure Instance
            • MariaDB
            • PostgreSQL
          • To discover databases on Azure
            • Get the subscription ID
            • Create a new application to get the tenant ID, client ID and the client secret.
            • Adding an Azure Instance on pmm-client side
        • Google Cloud Platform
        • Linux
        • External Services
        • HAProxy
        • Remote instances
      • User Interface
      • Percona Alerting
        • Prepare a storage location
          • MongoDB backup prerequisites
          • Create MongoDB on-demand and scheduled backups
          • Create MongoDB PITR backups
          • Restore a MongoDB backup
          • MongoDB Backup and Restore support matrix
          • MySQL backup prerequisites
          • Create a MySQL backup
          • Restore a MySQL backup
        • Edit a scheduled backup
        • Delete a backup
        • Configure access control
        • Labels for access control
        • Create access roles
        • Manage access roles
        • Assign roles to users
        • Use Case
      • Query Analytics
      • Working with Advisors
      • Configure
      • Manage users
      • Upgrade
      • Secure
      • Optimize
      • Annotate
      • Share dashboards and panels
      • Extend Metrics
      • Resolve issues
        • Check Percona Portal account information
      • Architecture
      • UI components
      • PMM components and versions
      • Data handling in PMM
      • Develop Advisor checks
      • PMM Inventory
        • Manage dashboards
            • Advanced Data Exploration
            • VictoriaMetrics
            • VictoriaMetrics Agents Overview
            • Environment Summary
            • Kubernetes Pods Status
            • Kubernetes Volumes
          • DBaas
            • Disk Details
            • Network Details
            • Memory Details
            • Node Temperature Details
            • Nodes Compare
            • Nodes Overview
            • Node Summary
            • NUMA Details
            • Processes Details
            • Prometheus Exporters Overview
            • MySQL Command/Handler Counters Compare
            • MySQL InnoDB Compression Details
            • MySQL InnoDB Details
            • MySQL MyISAM/Aria Details
            • MySQL MyRocks Details
            • MySQL Instance Summary
            • MySQL Instances Compare
            • MySQL Instances Overview
            • MySQL Wait Event Analyses Details
            • MySQL Performance Schema Details
            • MySQL Query Response Time Details
            • MySQL Replication Summary
            • MySQL Group Replication Summary
            • MySQL Table Details
            • MySQL User Details
            • MySQL TokuDB Details
            • Experimental MongoDB Collection Details
            • Experimental MongoDB Oplog Details
            • MongoDB Cluster Summary
            • MongoDB Instance Summary
            • MongoDB Instances Overview
            • MongoDB Instances Compare
            • MongoDB ReplSet Summary
            • MongoDB InMemory Details
            • MongoDB MMAPv1 Details
            • MongoDB WiredTiger Details
            • PostgreSQL Instance Summary
            • PostgreSQL Instances Compare
            • Experimental PostgreSQL Vacuum Monitoring
          • ProxySQL Dashboards
            • PXC/Galera Cluster Summary
            • Experimental PXC/Galera Cluster Summary
            • PXC/Galera Nodes Compare
            • HAProxy Instance Summary
        • pmm-admin - PMM Administration Tool
        • pmm-agent - PMM Client agent
      • API
      • VictoriaMetrics
      • ClickHouse
      • PostgreSQL
      • Glossary
      • Introduction
      • DBaaS architecture
        • Setting up DBaaS
        • Create a Kubernetes Cluster
        • Deleting Kubernetes clusters
        • Activating DBaaS
        • Add a Kubernetes cluster automatically
        • Add a Kubernetes cluster manually
        • Manage allowed component versions
          • OLM installation
          • Operators installation
        • Add a DB Cluster
        • Manage a DB Cluster
        • Delete a DB Cluster
        • Create a database cluster from a template
      • Backup and restore
    • FAQ
      • PMM 2.39.0
      • PMM 2.38.1
      • PMM 2.38.0
      • PMM 2.37.1
      • PMM 2.37.0
      • PMM 2.36.0
      • PMM 2.35.0
      • PMM 2.34.0
      • PMM 2.33.0
      • PMM 2.32.0
      • PMM 2.31.0
      • PMM 2.30.0
      • PMM 2.29.1
      • PMM 2.29.0
      • PMM 2.28.0
      • PMM 2.27.0
      • PMM 2.26.0
      • PMM 2.25.0
      • PMM 2.24.0
      • PMM 2.23.0
      • PMM 2.22.0
      • PMM 2.21.0
      • PMM 2.20.0
      • PMM 2.19.0
      • PMM 2.18.0
      • PMM 2.17.0
      • PMM 2.16.0
      • PMM 2.15.1
      • PMM 2.15.0
      • PMM 2.14.0
      • PMM 2.13.0
      • PMM 2.12.0
      • PMM 2.11.1
      • PMM 2.11.0
      • PMM 2.10.1
      • PMM 2.10.0
      • PMM 2.9.1
      • PMM 2.9.0
      • PMM 2.8.0
      • PMM 2.7.0
      • PMM 2.6.1
      • PMM 2.6.0
      • PMM 2.5.0
      • PMM 2.4.0
      • PMM 2.3.0
      • PMM 2.2.2
      • PMM 2.2.1
      • PMM 2.2.0
      • PMM 2.1.0
      • PMM 2.0.1
      • PMM 2.0.0
      • Copyright and licensing information
      • Trademark policy

    • Activate Microsoft Azure
    • Required settings
    • Setting up a MySQL instance
    • Adding an Azure Instance
      • MariaDB
      • PostgreSQL
    • To discover databases on Azure
      • Get the subscription ID
      • Create a new application to get the tenant ID, client ID and the client secret.
      • Adding an Azure Instance on pmm-client side

    Microsoft Azure¶

    Caution

    Microsoft Azure functionality is currently in technical preview and is subject to change.

    Activate Microsoft Azure¶

    The Microsoft Azure feature is turned off by default. To turn it on:

    1. Go to Configuration → Settings → Advanced Settings.

    2. Click the toggle in the Technical preview features section of the page.

    Required settings¶

    It is possible to use PMM for monitoring Azure database instances like other remote instances. In this case, the PMM Client is not installed on the host where the database server is deployed. By using the PMM web interface, you connect to the Azure DB instance. Discovery is not yet implemented in PMM but it is possible to add known instances by providing the connection parameters.

    First of all, ensure that there is the minimal latency between PMM Server and the Azure instance.

    Second, add a firewall rule to enable access from PMM Client like this:

    !image

    Setting up a MySQL instance¶

    Query Analytics requires you to configure Performance Schema as the query source, because the slow query log is stored on the Azure side, and QAN agent is not able to read it. Enable the performance_schema option under Parameter Groups in Azure MySQL databases.

    When adding a monitoring instance for Azure, specify a unique name to distinguish it from the local MySQL instance. If you do not specify a name, it will use the client’s host name.

    Create the pmm user with the following privileges on the Azure MySQL database instance that you want to monitor:

    CREATE USER 'pmm'@'%' IDENTIFIED BY 'pass';
    GRANT SELECT, PROCESS, REPLICATION CLIENT ON *.* TO 'pmm'@'%';
    ALTER USER 'pmm'@'%' WITH MAX_USER_CONNECTIONS 10;
    

    Adding an Azure Instance¶

    Follow the instructions for remotes instances explained here, Azure MySQL databases are similar to AWS RDS databases.

    Example:

    !image

    and be sure to set Performance Schema as the query collection method for Query Analytics.

    !image

    MariaDB¶

    MariaDB up to version 10.2 works out of the box but starting with MariaDB 10.3 instrumentation is disabled by default and cannot be enabled since there is no SUPER role in Azure-MariaDB. So, it is not possible to run the required queries to enable instrumentation. Monitoring will work but Query Analytics won’t receive any query data.

    PostgreSQL¶

    For PostgreSQL follow the same methods used for MySQL and MariaDB and enable track_io_timing in the instance configuration to enable Query Analytics.

    !image

    For Query Analytics, set the server parameter:

    pg_stat_statements.track = all
    

    To discover databases on Azure¶

    You need to get the Client ID, Client Secret, Tenant ID and Subscription ID.

    Get the subscription ID¶

    1. Search Subscriptions, click on your subscription name !
    2. Copy the subscription ID !

    Create a new application to get the tenant ID, client ID and the client secret.¶

    1. Search for Azure Active Directory !
    2. Register a new application:

    !

    ! ! 3. At this point you can copy the client and tenant IDs. ! 4. Create an application secret. ! ! ! 5. Copy the value of the application secret. Once you leave this page you won’t be able to see the secret again and you will have to generate a new one. ! 6. Give API access permissions to your application.

    6.1. Search for **Subscriptions** like in step 1.
    
    6.2. Select your application and grant **Monitor Reader** permissions. This might require you to have admin permissions in your Azure account.
    

    ! ! ! !

    When you fill in all fields press the Discover button and you will see a list of available databases for monitoring.

    !

    You can monitor 6 types of databases:

    • Microsoft.DBforMySQL/servers
    • Microsoft.DBforMySQL/flexibleServers
    • Microsoft.DBforMariaDB/servers
    • Microsoft.DBforPostgreSQL/servers
    • Microsoft.DBforPostgreSQL/flexibleServers
    • Microsoft.DBforPostgreSQL/serversv2

    You can find more details on how to create DB on Azure at:

    • https://docs.microsoft.com/en-us/azure/postgresql/
    • https://docs.microsoft.com/en-us/azure/mysql/

    Tip

    You must set pg_stat_statements.track = all in your PostgreSQL Server settings to use PMM Query Analytics. (Read more.)

    !

    In the list of databases on the Discovery page click Start Monitoring to add the selected Azure Database to PMM.

    Fill in all required fields and click Add service.

    !

    PMM can use 3 exporters to collect metrics:

    • Azure Metrics Exporter – collect “system” metrics related to DB.

      • node_cpu_average
      • azure_resource_info
      • node_filesystem_size_bytes
      • azure_memory_percent_average
      • azure_storage_percent_average
      • azure_storage_used_bytes_average
      • node_network_receive_bytes_total
      • node_network_transmit_bytes_total
    • mysql_exporter or postgres_exporter – to collect database related metrics.

    • PMM Agent to collect queries related metrics using pg_stat_statements for PostgreSQL or Performance Schema for MySQL (MariaDB)

    Adding an Azure Instance on pmm-client side¶

    TLS/SSL is enforced on the server by default. So please download the certificate needed to communicate over SSL with your Azure Database. It can be done on Networking tab for your Azure Database instance.

    !

    Also enforced TLS/SSL connection option can be disabled on server side.

    Command for adding an azure database service for monitoring without TLS/SSL.

    pmm-admin add mysql --username=azureuser --password=secure --host=azuremysql.mysql.database.azure.com --service-name=azure1 --query-source=perfschema
    

    Downloaded certificate is named DigiCertGlobalRootCA.crt.pem.

    An example of the command for adding an Azure database service for monitoring with TLS/SSL would be:

    pmm-admin add mysql --username=azureuser --password=secure --host=azuremysql.mysql.database.azure.com --service-name=azure1 --query-source=perfschema --tls --tls-ca=DigiCertGlobalRootCA.crt.pem --tls-cert=client-cert.pem --tls-key=client-key.pem --tls-skip-verify
    

    Contact us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-09-22
    Percona LLC, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better. Read more about Percona Cookie Policy.