3

I am trying to run a post deployment script to delete few files from azure website(app service-kudu). I am using visual studio online 2015 for CI-build definition. I want to add a post deployment script that can delete few files from app service(site\wwwroot..).

I looked into [How to add a custom post deployment script to azure websites?

On this link it is mentioned to add POST_DEPLOYMENT_ACTION in app setting on azure portal. I am unable to understand what will be the exact path of the script . If I write a cmd script and keep in the folder where solution file is present. Now what will be the exact path ?

Community
  • 1
  • 1
  • Before we answer, can you expand on "using VSO 2015 for CI-build definition"? The post deployment script only works in some scenarios like VSTS git deployment (you have to set up continuous deployment from VSTS on portal). – Suwat Ch Jan 10 '17 at 07:55
  • We are using VSO 2015 only, so how can we call any post deployment script in this, Also we are using TFS as source control. – Mohit Arora Jan 10 '17 at 10:07

1 Answers1

2

If you are using a VSTS build definition, your build is happening in VSTS and is not using Kudu. As such, this post deployment hook feature is not available.

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Hi David. Is this still true? There is a *Publish using Web Deploy* checkmark within the *Azure App Service Deploy* in VSTS. I thought the task is using the Kudu REST API to deploy the app? – Martin Brandl Jun 06 '17 at 05:47
  • 1
    It's using the Kudu API to copy files and execute commands, but all the actual building is happening on the VSTS servers. Confusion comes from the fact that 'kudu' means more than one thing. – David Ebbo Jun 06 '17 at 05:49
  • Thanks for the quick response. So there is no way to get some post deployment scripts triggered after a deployment through VSTS? – Martin Brandl Jun 06 '17 at 05:53
  • I'm no VSTS expert, but I would think it should be possible to add extra rules in the build definition that make additional calls into Kudu to execute a specific script. Out just won't quite be the same as the existing post deployment feature used in full Kudu based deployments. – David Ebbo Jun 06 '17 at 05:55
  • Okay, I probably have to use that. One last question, you have written a Kudu extension *SettingsAPISampleSiteExtension* which returns some site settings. This would be a solution in a SPA web app where the SPA can retrieve the middleware URL using e. g. `sitename.scm.azurewebsites.net/settings/apibase` . However, currently this doesn't work *without* authentication. Is it possible to run a kudu site extension that *doesn't* require authentication? – Martin Brandl Jun 06 '17 at 06:18
  • This last question does not seem related to the current topic. Would be best to take it elsewhere so we keep this one clean – David Ebbo Jun 06 '17 at 13:57
  • You are right. I will delete this and my last comment in a few hour to keep it clean. Thanks for your help. – Martin Brandl Jun 07 '17 at 06:21