1

Is there now a way to set the Trigger Properties(Name/Connection) using the value from Azure App Configuration?.

I added a startup class that reads the data from Azure App Configuration but it seems the trigger set its properties earlier than that, therefore not able to bind the data that came from the app configuration.

I also found this thread about it but im not sure if there is a new update?: https://github.com/MicrosoftDocs/azure-docs/issues/63419 https://github.com/Azure/AppConfiguration/issues/203

  • Hi!, Could you please share some code? Are you deploying to a app service ? In that case I would advice you try to connect to the deployed app service via ```kudu``` ( advance settings console ) and from the cmd console write a ```set``` command to check how your appservice environment variable name expects to be named, because there is a mismatch between the local development and the deployed environment. Check that for example n the case of SQL connection string forthe appservice expects a environment variable called something like SQLCONNSTR_{x}, but locally is called just {x} – Rod Ramírez Dec 23 '20 at 01:29

1 Answers1

1

You can do this. The following code gets the name of the queue to monitor from an app setting, and it gets the queue message creation time in the insertionTime parameter:

public static class BindingExpressionsExample
{
    [FunctionName("LogQueueMessage")]
    public static void Run(
        [QueueTrigger("%queueappsetting%")] string myQueueItem,
        DateTimeOffset insertionTime,
        ILogger log)
    {
        log.LogInformation($"Message content: {myQueueItem}");
        log.LogInformation($"Created at: {insertionTime}");
    }
}

Similarly, you can use this approach for other triggers.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Harshita Singh
  • 4,590
  • 1
  • 10
  • 13