How can I implement Microsoft's Azure KeyVault in a ASP.NET Framework 4.7.1 WebForms application to override values in web.config with values from KeyVault? I do see references that we need a minimum version of .NET Framework 4.7.1 in order to do it but the examples Microsoft provides are for .NET Core. I have my configs as web.config files instead of appsettings.json. I also have Global.asax.cs files instead of Startup.cs and Program.cs.
How to Override Web.config values with Azure KeyVault in .NET Framework 4.7.1
13.2k views Asked by Bmoe At
1
There are 1 answers
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in .NET-4.0
- How to establish 1:1 relationship with 2 composite keys in EF6 (not core)
- Windows Forms cloning buttons/forms keeps cloning many times
- Containerize a .net framework 4.5.1 mvc template app give error on permissions
- Changing .NET runtime at runtime
- Where does System.Security.Cryptography.RijndaelManaged..ctor() call come from (HASP-wrapped DLL)?
- Code analysis only shows CSxxx and IDExxx notes I see no CAxxx messages
- Local Reports in Visual Studio 2022
- Update Telerik.DataAccess.Core 2015.1.225.1 Assemblies to most recent nuget package
- Ps command not running under windows service
- NET Framework 4.0 breaks Com Interop - vb6 calling c# dll failing when changing target framework from 3.5 to 4.0 or higher
- Why is IHttpHandler's ProcessRequest method not getting the original URL in the context in .NET Framework?
- Sending email via Outlook365 from VB6/VB.net 4.0 application
- iTextSharp not protecting PDF with password
- System.IO.FileNotFoundException: Unable to load file or assembly Microsoft.SqlServer.Management.SqlParser
- Extract ECDSA non-exportable private key from x509 certificate
Related Questions in AZURE-KEYVAULT
- Unable to connect to Azure Keyvault when I deploy ASP.NET Core 6 Web API (C#) , the docker image to docker desktop app
- Automating key rotations for resources used in an application
- Entra authentication without storing secrets or certificate information in client code
- Does Install4j support code signing using Azure Key Vault?
- Error Fetching Azure Key Vault Secret in Fabric Notebook for Azure SQL Database JDBC Connection
- Azure Key Vault Logs: Success with Forbidden ResultSignature
- Pass An Azure Key Vault Secret To The Azure Databricks Spark Submit Job Using Parameters
- How to add new secrets (from Azure Key Vault) to the variable group in Azure Devops
- Authentication to Azure Key Vault
- Terraform Pipeline Key Vault secret deployment with Private Endpoint
- Prevent user login to Azure App Registration
- unable to link customer managed key within azure storage account get the error Your system-assigned identity does not have access to the key vault
- Trying to understand why Azure App access is more secure with Certificate vs Secret
- Running databricks notebooks in ADF: "Invalid client secret provided"
- Script Hangs in Windows 10 While Accessing Azure Key Vault Secrets, Works in Windows 11: Need Assistance
Related Questions in .NET-4.7.1
- How to moq an HttpContext for a method the implements IHttpHandler's ProcessRequest in .NET framework (not core)?
- the program works on .NET framework 4.7.1 and doesn't work on .NET 6.0
- How do I get the error message from a HttpClient.GetAsync in .net Framework 4.7.1?
- HttpClient.SendAsync throwing nullreference exception on http 204
- How to map a list in response to a different list in a variable
- Any idea whether TLS 1.3 works with .NET framework 4.7.1?
- The type 'JsonPropertyAttribute' exists in both NestV5, and Newtonsoft.Json
- Could not load file or assembly 'Microsoft.Azure.Services.AppAuthentication, Version=1.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
- How to Override Web.config values with Azure KeyVault in .NET Framework 4.7.1
- Can I publish .net framework 4.7.1 solution with dotnet publish command in Azure DevOps
- snmp trap listener no message receiving
- How to resolve key/value pair with external .config file
- C# .NET Framework 4.7.2 in VS 2019 - keep out my clientID and client secret / gitignore / Key Vault
- c# convert downloaded string with special language chars
- Error: ASP.NET Ajax client-side framework failed to load after some updates on host
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
To implement Microsoft's Azure KeyVault in a ASP.NET Framework 4.7.1 WebForms application , first you need to create an Azure Key Vault.
Connecting to Azure Key Vault:
To connect to Azure Key Vault from Visual Studio, you need to right click on the project and select Add > Connected Service menu.
From the options, choose Secure Secrets with Azure Key Vault option.
Now you may need to sign in if not already signed in to your account and then select rquired key vault from the list.
And click on the Add button to add key vault reference to your application. This will add reference of the NuGet package Microsoft.Configuration.ConfigurationBuilders.Azure to the project.
Also it will add some configuration in the Web.Config file.
(OR)
Open your web.config file, and write the following code:
a) Add configSections and configBuilders as below with your keyvault name
b) Find the appSettings tag, add an attribute configBuilders="AzureKeyVault", and add a line as below:
c) Edit the About method in HomeController.cs, to display the value for confirmation.
This way you can connect and use Azure Key Vault in your classic ASP.NET MVC applications,if you’re application running is using .NET Framework 4.7 or later versions.
You can refer following documents for the detailed explaination of the same :