How to use MSI for development in visual studio?
As of Visual Studio 2017 15.8.something, the extension which juunas mentioned is built into Visual Studio.
Tools -> Options -> Azure Service Authentication -> Account Selection
Check out the docs for the DefaultAzureCredential (.NET) which explain how to set this up for both development and Managed Identity.
Below are the links for some of the other supported languages.
Java
JavaScript
Python