Share via

Upload a project

YCKOR 1 Reputation point
2022-07-29T20:15:09.017+00:00

Hello!

I want to upload my project/web app in a few days, I am wondering how I should set the environment variables when it comes to accessing the secret keys? Right now I Just have them in my Launchsettings.JSON (Coding in C#).

Should I Deploy a virtual environment to handle that part? Or a HTTP app ?

Azure Key Vault
Azure Key Vault

An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,396 Reputation points Microsoft Employee Moderator
    2022-07-29T20:49:23.17+00:00

    Hi @YCKOR ,

    You can use Key Vault references to achieve this.

    Use Key Vault references in an ASP.NET Core app
    Use Key Vault references for App Service and Azure Functions

    From the guide:

    Key Vault references can be used as values for Application Settings, allowing you to keep secrets in Key Vault instead of the site config. Application Settings are securely encrypted at rest, but if you need secret management capabilities, they should go into Key Vault.

    To use a Key Vault reference for an app setting, set the reference as the value of the setting. Your app can reference the secret through its key as normal. No code changes are required.

    There was a similar discussion on Stack Overflow in which a user was hoping to do this. You can create an identity for the application and allow the key vault to accept requests from it using via Access policies on the key vault.

    Let me know if this helps.

    -

    If the information provided was helpful to you, please remember to "mark as answer" so that others in the community with similar questions can more easily find a solution.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. YCKOR 1 Reputation point
    2022-07-29T21:35:10.4+00:00

    Thank you for this very fast answer, before I accept it, I would like to know;

    I have set up the Key vault, and the Az CLI credentials generated:

    "AZURE_CLIENT_ID": "example id",
    "Azure_CLIENT_SECRET": "some secret",
    "AZURE_TENTANT_ID": "some tenant id"

    Theese variables were put in my launchsettings.JSON, the reference, is to Hide the enviroment variables, or is it the same topic? Thank you again in advance.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.