Skip to content

posts/azure-functions-custom-configuration #5

Closed

Description

@TechWatching

Activity

  1. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by Cat Coache on 30/11/2020 20:13:59

    Hi Alexandre! Thanks for this detailed posting. Really helpful. But I am still a little confused about how you construct "InvoiceConfiguration". From what I check from the dependency injection doc,
    public class MyOptions
    {
    public string MyCustomSetting { get; set; }
    }
    Will translate to the following in local.settings.json
    {
    "IsEncrypted": false,
    "Values": {
    "MyOptions:MyCustomSetting": "Foobar"
    }
    }
    But what we are looking for the service bus trigger connection strin is something like:
    {
    "IsEncrypted": false,
    "Values": {
    "ServiceBusConnectionString": "Foobar"
    }
    }
    I don't know how to construct the right MyOptions to set connectionstring.

  2. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by Alexandre on 30/11/2020 22:11:26

    Hi Cat. Yes that is exactly that. Not sure to understand correctly what you want to do, but concerning the service bus trigger connection string you will not be able to use custom configuration source as it is not recommanded to use that with triggers like I say in my last paragraph:
    https://uploads.disquscdn.c...
    Just for you to understand my sample, in it the InvoiceConfiguration options are injected in my IInvoiceService and use there.

  3. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by Paweł Żółtaniecki on 01/02/2021 15:42:38

    Thank you for your article. It is really helpful. But I do not understand how it helps in local development environment. On Azure it is recommended to use Managed Identity to be authorized in key vault. How you receive your secrets on local env from the key vault?

  4. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by Alexandre on 09/02/2021 09:42:52

    You just have to authorize your user (the one connected to Visual Studio) to access the key vault and it works. What is nice is that the same code will work on Azure (with Managed Identity indeed) and locally (with your user identity).

  5. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by Paweł Żółtaniecki on 10/02/2021 12:20:01

    thank you for you answer. I did not know about such possibilities of VS

  6. TechWatching commented on Oct 19, 2021

    @TechWatching
    OwnerAuthor

    Comment written by John on 17/02/2021 14:28:22

    Just to be extra clear... the values inside your local.settings.json, they must correspond to the names of the secrets saved in the vault, right?

  7. changed the title [-]You almost no longer need keyvault references for Azure Functions.[/-] [+]posts/azure-functions-custom-configuration[/+] on Oct 20, 2021
  8. Repository owner locked and limited conversation to collaborators on Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions