Programmatically setup nLog to log to SQL

I'm trying to programmatically setup nLog to log to an Azure-hosted SQL database.

Here is the code in a Windows Forms App (.Net Framework) showing how I am trying to do this.

However, when checking the Asure SQL database I'm not getting anything logged.

What am I doing wrong?

    private void button1_Click(object sender, EventArgs e)
    {
        // Configure NLog programmatically
        LoggingConfiguration loggingConfiguration = new LoggingConfiguration();

        // Setup database target
        DatabaseTarget databaseTarget = new DatabaseTarget();
        databaseTarget.ConnectionString = @"data source=tcp:AAAAAAAAA.database.windows.net,1433;initial catalog=myCloud;persist security info=False;user id=BBBBBBBB;password=CCCCCCCC;multipleactiveresultsets=False;connect timeout=30;encrypt=True;trustservercertificate=False;App=EntityFramework";
        databaseTarget.CommandText = @"insert into dbo.Log (Application, Logged, Level, Message, Username, ServerName, Port, Url, Https, ServerAddress, RemoteAddress, Logger, CallSite, Exception) values (@Application, @Logged, @Level, @Message, @Username, @ServerName, @Port, @Url, @Https, @ServerAddress, @RemoteAddress, @Logger, @Callsite, @Exception)";
        databaseTarget.Parameters.Add(new DatabaseParameterInfo("@Application", new NLog.Layouts.SimpleLayout("${processname}")));
        databaseTarget.Parameters.Add(new DatabaseParameterInfo("@Logged", new NLog.Layouts.SimpleLayout("${date}")));
        databaseTarget.Parameters.Add(new DatabaseParameterInfo("@Level", new NLog.Layouts.SimpleLayout("${level}")));
        databaseTarget.Parameters.Add(new DatabaseParameterInfo("@Message", new NLog.Layouts.SimpleLayout("${message}")));
        databaseTarget.Parameters.Add(new DatabaseParameterInfo("@Username", new NLog.Layouts.SimpleLayout("${identity}")));
        loggingConfiguration.AddTarget("database", databaseTarget);

        // Setup database logging rule
        LoggingRule databaseTargetRule = new LoggingRule("*", LogLevel.Trace, databaseTarget);
        loggingConfiguration.LoggingRules.Add(databaseTargetRule);

        // Assign the newly created configuration to the active LogManager NLog instance
        LogManager.Configuration = loggingConfiguration;

        Logger log = LogManager.GetLogger("AzureFunction");

        for(int i=0; i<200; i++)
            log.Info($"hello {i}!");
    }