Search code examples
powershellazureazure-web-app-serviceazure-powershellazure-deployment

Update Web.config configuration with powershell on Azure Release Script


I'm running my Deployments on the Release Management(Currently Preview) tool in VSO. When you configure a new Release(with the new release management tool on VSO) you can add to the Flow a task named:Azure PowerShell(Run a PowerShell script within an Azure environment)

What i'm trying to do is to Make some changes to the web.config using the Get-WebApplication and then Set-WebConfigurationProperty.

the error i get from the Log is: Process should have elevated status to access IIS configuration data. ##[error]Cannot find a provider with the name 'WebAdministration'.

Is it even possible to run those kind of commands in there or do you i need to use another kind of command to update my web.config?


Solution

  • There is no Azure API to make arbitrary transforms to your web.config.

    Instead, the way this is typically done is to use the deployment time transform engine (e.g. via Web.Debug.config or using Chained Config transforms).