Sarva
Sarva

Reputation: 333

Skip web.config file while taking pull request in VSTS

I have created 3 different environments for dev, staging and production. I'm using VSTS for the deployment. I have 3 different branches created in VSTS for dev, staging and production. In the application web.config file what all I have is Azure KeyVault client details. I fetch all secrets and connection strings from Azure KeyVault. Each environment has different KeyVault client details. I'm just wondering if there any way to skip web.config file while taking a pull request from one branch to another.

<configuration>
   <appSettings>
     <add key="KeyvaultClientId" value="XXXXXXX-2033-493f-XXXX-9849c38920a8"/>
     <add key="KeyvaultClientSecret" value="yOVJK/XXXXXXXXXXXXXXXXXXXXXXXXXX="/>
     <add key="KeyvaultVaultName" value="https://XXXXkeyvault.vault.azure.net/"/>   
   </appSettings>
    ...
    ...
</configuration>

Upvotes: 0

Views: 750

Answers (1)

Sheethal J S
Sheethal J S

Reputation: 430

I would suggest you try by ignore the file using gitignore to prevent tracking of files to prevent Git from staging unwanted files.

Check this https://learn.microsoft.com/en-us/vsts/git/tutorial/ignore-files?view=vsts&tabs=visual-studio document for more information and let us know if this helps.

Upvotes: 1

Related Questions