If you need to write an initialization module or you're writing some code to automate your continuous integration process, it's very likely you may need to get the file path where your App_data folder lives on your server.  Luckily, this is pretty easy using this snippet

 EPiServer.Framework.Configuration.EPiServerFrameworkSection.Instance.AppData.BasePath

As you can see, getting the base path out of Episerver is easy, however, on a lot of projects, the basepath might be set like this:

  <appData basePath="App_Data" />
  

If you try and run File.Exists() on this value it will obviously fail. Adding file paths into a web.config and checking that into source control isn't ideal, as every developer will likely have the website installed in different locations. Instead, I'd recommend using a method like this:

            var appDataBasePath = EPiServer.Framework.Configuration.EPiServerFrameworkSection.Instance.AppData.BasePath;

            if (appDataBasePath.ToLower() == "app_data") 
{
addDataBasePath = $@"{AppDomain.CurrentDomain.BaseDirectory}{appDataBasePath}";
            }

Enjoy!