Moving configuration items from one environment to another using resources

Every application that you develop will have many configuration items (such as application settings as connection strings) that will be stored in Web.Config files for all your .NET-based web applications. 

In the traditional on-premises world, the Web.Config file would be located in the server and the file would be accessible to all people who have access to the server. Although it is possible to encrypt all the configuration items of Web.Config, it had its limitations, and they're not easy to decrypt every time you want to view or update them.

In the Azure PaaS world, with Azure App Services, you still can have the Web.Config files and they work as they used to in the traditional on-premises world. However, Azure App Service provides us with additional feature in terms of application settings, where you can configure these settings (either manually or via ARM templates), and these settings are stored in an encrypted format. But you can view them as normal text in the portal if you have access.

Depending on the application type, the number of application settings might grow to a large size, and if you want to create new environments, then creating these application settings would take quite a bit of time. In this recipe, we will learn a tip of exporting and importing these application settings from a lower environment (say, Dev) to a higher environment (say, Prod).