How to execute PowerShell Script after Deployment?

rajindersingh's Avatar


11 Jun, 2015 02:53 PM

We are deploying our application in Azure using AppVeyor
When a developer checks in code we do a build and use inline deployment to deploy the code to development.
We have environment deployments configured for Test and Production.
I understand that vNext will have a unified deployment model but I need to come up a short term solution to meet our needs.

I need to deploy Azure SDK 2.6 diagnostic extension for cloud services. I know that AppVeyor will add native support to deploy diagnostic extensions but I cannot wait for that to take place.

I blogged about to deploy diagnostic extension here:

With SDK 2.6 we have an ability to specify a diagnostic storage account in service configuration file.
When we build the project and package it a XMLl file is generated with all the diagnostic configuration with the help of PowerShell cmdlet
Set-AzureServiceDiagnosticsExtension other options are to use New-AzureDeployment and Set-AzureDeployment to pass in the diagnostic configuration.

For now I was considering just checking my diagnostic configuration file for each environment into VS Online.
So I will have diagnostic configuration for dev, test and production environment.

Given the current capabilities of AppVeyor how can I execute a powershell script at the end of inline build/deployment or environment provider based deployment to deploy deployment diagnostic extension.

Can I just create a separate project(s) that just execute the powershell script. I will create one for dev, test and prod.
I will call/trigger them from inline build/deploy and somehow trigger them after environment based deployment as well.

I have never done a custom build. I don't want to build an elegant solution because I know AppVeyor will add support to deploy diagnostic extensions.

Let me know if any body has suggestions, examples for how to do this.

  1. Support Staff 1 Posted by Feodor Fitsner on 11 Jun, 2015 07:30 PM

    Feodor Fitsner's Avatar

    "Script" deployment provider could be implemented with an additional project. There could be a simple repo with just one PowerShell script downloading/unzipping artifacts and doing the deployment. Artifacts could be easily downloaded using PowerShell:

    Using this "deployment project" you can start deployment by either "New build" button on it or from another build using AppVeyor REST API:

    Build version to deploy can be passed in environment variable to that project.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac