-1

I have one release pipeline where i am deploying latest/selected artifacts to one web app. I want to release the same artifacts to multiple web app in single release pipeline.

I have two option in my mind.

  1. Create a multiple task with each web app. (this is achievable but every time pipeline changes requires whenever there is new web app getting in picture)
  2. using Power shell but not sure why my command is not working here . getting error as The term 'Publish-AzWebApp' is not recognized as the name of a cmdlet, Though this command is working fine in local system but not in pipeline.
Publish-AzWebApp -ResourceGroupName gggroup -Name $app -ArchivePath $(System.DefaultWorkingDirectory)/**/*.zip

this command will run in loop.

Any suggestion!!!

Theo
  • 57,719
  • 8
  • 24
  • 41
  • Hi there, I have updated my answer and hope it can help you~ – Jane Ma-MSFT Mar 17 '21 at 08:32
  • Hi @JaneMa-MSFT thanks for the reply . It was the version issue in Devops command and now i am able to do deploy the package into multiple web app in powershell loops. – SanjayThakur Apr 06 '21 at 06:05
  • Hi @JaneMa-MSFT SCM also helped me lot for accessing the file after and before deployment to web app But i don't want this feature to be enable for my web app as per security concern. Do you know how to disable this? – SanjayThakur Apr 06 '21 at 06:09

1 Answers1

0

For option 2, Publish-AzWebApp is a step for classic deployment. However, modules for classic deployment are not supported in PowerShell task of Azure DevOps services any more.

Instead, you can use the Azure PowerShell task.

Also, you can deploy ZIP file with REST APIs then invoke the REST APIs using PowerShell.

POST https://<app_name>.scm.azurewebsites.net/api/zipdeploy

The POST request must contain the .zip file in the message body. The deployment credentials for your app are provided in the request by using HTTP BASIC authentication. Click this document for detailed information.

Jane Ma-MSFT
  • 4,461
  • 1
  • 6
  • 12
  • I have just found [this answer](https://stackoverflow.com/a/53222386/14026068) provide a sample script of invoking the REST API. – Jane Ma-MSFT Mar 15 '21 at 06:27