Updating variables in web.config outside appSettings

Solution 1:

Add a parameters.xml to your project, as described here: https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/configuring-parameters-for-web-package-deployment

specify parameter there, for example, "myEndpointAddress".

Then in IIS Web Deploy Task use additional arguments to pass the value -setParam:name='myEndPointAddress',value='new_value'