0

My .net framework web form application deployed on iis server not able to connect to azure key vault on azure portal. It is on 4.8. Application is working fine on localhost but it is showing error as mentioned belowServer Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The configBuilder 'AppsettingAzureKeyVault' failed while processing the configuration section 'appSettings'.: 'AppsettingAzureKeyVault' GetAllValues() Error: DefaultAzureCredential failed to retrieve a token from the included credentials. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/defaultazurecredential/troubleshoot - EnvironmentCredential authentication unavailable. Environment variables are not fully configured. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/environmentcredential/troubleshoot - ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint. - Visual Studio Token provider can't be accessed at C:\Users\applicayionurl\AppData\Local.IdentityService\AzureServiceAuth\tokenprovider.json - Azure CLI not installed - Az.Account module >= 2.2.0 is not installed. Source Error: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Source File: D:\Websites\Develop\web.config

I had added the required dll from night for azure keyvault. Also added the config builder and set the app settings and connection string accordingly.

I had added all the required setting in iis pool like application client I'd, azure tenant I'd, azure secrets. I had followed the below link https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication-on-premises-apps?tabs=azure-portal%2Ciis-app-pool%2Ccommand-line

1 Answers1

0

web form application hosted on iis server not able to access azure key vault

You need to deploy the Web App in IIS created in Azure VM .

First create an Azure VM in Portal.

enter image description here

  • Enable Managed Identity under Management. enter image description here

  • Download the RDP from the Connect tab. enter image description here

  • Connect to the VM using RDP from the App or by running the Downloaded RDP file. enter image description here

  • Open the VM.

  • Click on Windows => search for Server Manager and click on Add Roles and Features Wizard.

enter image description here

  • Select IIS and continue with the next steps.

enter image description here

  • Zip the WebApp in local and Copy the Zipped WebApp from local to the created VM.
  • Open IIS using the inetmgr in the VM and deploy the App to IIS.

You can refer the code to retrieve Azure Key Vault secrets from .NET Framework App here 1 and 2.

Harshitha
  • 3,784
  • 2
  • 4
  • 9