You have to use Azure App service Deploy task or Azure Web App task to deploy your app which is hosted in Azure. Now, to do that, firstly you need to create a service connection to Azure DevOps to connect your Azure Subscription. And after that, you need to add Azure App Service Deploy task/Azure Web App task at the end of your pipeline.
Prefer this example to understand it better.
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'SubscriptionServiceConnectionName'
appType: 'webAppLinux'
WebAppName: 'MyWebAppName'
Package: '$(Build.ArtifactStagingDirectory)/dist/'
StartupCommand: 'npm run start:prod'
I hope this will work.
Want to become an Azure DevOps expert? join azure devops certification now!!