title: Is it a kind of Microsoft Azure bug for adding pgaudit Azure postgresql?
body: <p>I am trying to setup pgaudit structure in Azure PostgreSql for pgaudit log I fallowed instuction of microsoft by using below link.</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/postgresql/concepts-audit" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/postgresql/concepts-audit</a>. But I can not see anything when I run</p>
  <pre><code>AzureDiagnostics
  | where ResourceProvider ==&quot;MICROSOFT.DBFORPOSTGRESQL&quot; 
  | where Category == &quot;PostgreSQLLogs&quot;
  | where Message contains &quot;AUDIT:&quot; 
  
  
  </code></pre>
  <p>When I read some article ;</p>
  <p>It needs that In Azure Database for PostgreSQL, pgaudit.log cannot be set using a - (minus) sign shortcut as described in the pgAudit documentation. All required statement classes (READ, WRITE etc) should be individually specified.But in Azure PostGre, You need to be superuser make pgaudit got permission with READ,WRITE.</p>
  <p>But ;</p>
  <p>Now when i try to create SUPERUSER , by giving the command
  CREATE USER TESTER SUPERUSER; ---&gt; it gives me error saying
  must be superuser to create superuser</p>
  <p>THat's the point? How can I give pgAudit rights and how can I see audit logs in Azure.I applied above instructions but I can not see audilts log in Kusto queries results? Why?</p>
  <p>By default, when a server is created we have the following 3 roles defined, which you can also see when you run <code>SELECT rolname FROM pg_roles;</code> –</p>
  <ol>
  <li>azure_pg_admin</li>
  <li>azure_superuser</li>
  <li>server admin login – the admin login the user created the server with – which by default is a member of azure_pg_admin.</li>
  </ol>
  <p>My roles in Azure :</p>
  <pre><code>
                                            List of roles
      Role name    |                         Attributes                         |    Member of
  -----------------+------------------------------------------------------------+------------------
   azure_pg_admin  | Cannot login                                               | {}
   azure_superuser | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
   my_admin        | Create role, Create DB                                     | {azure_pg_admin}
   my_db           | Create role, Create DB                                     | {azure_pg_admin}
  </code></pre>