Updating variables in web.config outside appSettings

Add a parameters.xml to your project, as described here: https://learn.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”

How to modify Azure DevOps release definition variable from a release task?

You can use the REST API (Definitions – Update) to update the value of the release definition variable from a release task. Go to the Agent Phase and select Allow Scripts to Access OAuth Token. See Use the OAuth token to access the REST API Grant Project Collection Build Service (xxx) account the edit release … Read more