Use of Managed Identity to Access Key Vault to an app
I have created the Azure Key Vault for connection string. After the configuration setup I am able to get the data using the key-vault in ASP.Net MVC deployed in Azure. Locally, I tested the app and found no issue since I am able to connect but I am thinking about where to use the Managed Identity. I have read several documents they are talking about key-Vault but I am unable to grasp the use of the managed identity relevant to the MVC app and secret of Key Vault. I am figuring out if I am missing something at this point. Can someone help?
Managed Identity is used when the App Service is uploaded to Azure. When you run locally, it uses your credentials to access the Key Vault. Once you upload to Azure, you'll need a different identity since you won't be logged into the app in that manner. The Managed Identity assigned to your application prevents the need to hard code the identity into the application and is also more secure by not requiring an explicit client secret.