1

I have an 'azure powershell task' running in my VSTS release after my 'deploy to azure site' task. In the powershell script, i have some transformations that i need to run on several of the files on the website, all based on the deployments variables.

The problem is I can't find the directory for the website. The root directory that the task is run under is something like:

D:\a_tasks\AzurePowerShell_71a1931a-effb-3d2e-8fd8-f7472a07cb62\3.1.18\

how do i point it to the d:\home\site\wwwroot\ , is there a build/release variable that automatically picks the deployment site location? Or can i just write out 'd:\home\site\wwwroot\' and expect that to not change in the future?

2 Answers 2

1

thats not how it works (if I got you right). your script will run on your build\release agent, not on the webapp. You would need to use native kudu capability to achieve what you want to achieve: https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script

Sign up to request clarification or add additional context in comments.

2 Comments

is there any way to include the kudu script in an azure release task? to have it read from my library variables inside the release? I'm not seeing any real easy way for them to play with each other
you could use the post deployment script action of the Azure App Service Deploy task in Azure Devops and use inline\script from file and pass parameters to it, i think
0

I would suggest to use kudu interface for both deploying the site and making transformations.

You could keep the code of both actions in your PowerShell scripts. As a result, You will gain a lot of freedom in customization and boost extendability. It would be best if you attach them as build artifact / or repository reference.

If you add your automation scripts as a package you will bound version of deployment scripts with each release. It enables backwards compatibility (between deployment code - application code).

Pipeline definition example

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.