0
votes

I have some nupkg files generated in my build pipeline which I intend to push to azure app-service. I am using Azure App Service Deploy Task which supports only zip files.

I need a mechanism to push nupkg files on azure app-service and unpack them. I am not sure, if Post Deployment Action section can be used.

Update to explain my use-case:

There are some dll and configuration files(yaml,json) which are bundled as nupkg files in my build pipeline. I want to push those files to app service using the Azure App Service Deploy Task. Once these files are pushed to app-service, I want to unpack those files to extract the dll and yaml files and perform some tasks like moving them and run some powershell commands.

3

3 Answers

1
votes

Please see steps below, to use Nuget and run powershell scripts as part of you release process. You need to make sure the files are configured correctly before you deploy them and this is what the release pipeline for.

  1. Create a new Release
  2. Create a empty job
  3. Add Download Package Task - configure with the feed and package ( this downloads and extract)
  4. Add Powershell Task - configure and run powerhsell
  5. Then you can run your powershell scripts here.
  6. Add Archive files task to zip up the files to be deployed
  7. Add the Deploy Azure App Service and point to that zip file

I hope this helps,

Jon

0
votes

I'm not sure what it is you're trying to do, but typically nuget package files aren't utilized to deploy Azure app services.

Assuming you're using .NET core, have a look at this doc: https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops

In particular, look at the section "Publish artifacts to Azure Pipelines" as this will produce the zip files you'll utilize in your release pipeline.

0
votes

Typically, you want to do all your file manipulations prior to pushing these files up to your Azure App Service. Changing files on the server itself is not a scenario that DevOps normally supports.

You have the option of automating these file changes via the Kudu API and PowerShell, then running the script via the Release process. Here's an article I found: https://blog.kloud.com.au/2016/08/30/interacting-with-azure-web-apps-virtual-file-system-using-powershell-and-the-kudu-api/

I have a similar scenario in an Angular application that requires me to manipulate the build output. These manipulations include running a script which changes environment variables in JSON files, but this script is run during the release process prior to deploying the files to the Azure App Service. This could be an option for you.

Another option could be using a Docker image. I ran into a scenario a year ago where I had developed a solution that required Chromium. It worked great on my machine, but when I went to deploy, I had no way of installing Chromium on the App Service. App services are understandably restricted when it comes to environmental dependencies.

My workaround was to use a Docker image. You can do pretty much anything you want in a Docker image. Once you have your image, your app service can then run your Docker image. Here's a doc to get you started: https://docs.microsoft.com/en-us/learn/modules/deploy-run-container-app-service/

Hope this helps, @IkeMtz