Facing issue in deploying .net application to web app to azure

Salil Singh 20 Reputation points
2024-05-15T16:33:51.68+00:00

Hi Team,

I have written a buid and deployment pipeline to deploy a .net application to a web app in azure.

Hi Team,

I have written build and deployment pipelines to deploy a .net application on web app. Build pieline is producing artefact but deployment pipeline is erroring. Below are details in pipelines and error/s.

Below is yml code for build pipeline -

trigger:

  • main

stages:

  • stage: Build jobs:
    • job: Build pool: vmImage: 'windows-latest' variables: solution: '**/*.sln' buildPlatform: 'Any CPU' buildConfiguration: 'Release' steps:
      • task: NuGetToolInstaller@1
      • task: NuGetCommand@2 inputs: restoreSolution: '$(solution)'
      • task: VSBuild@1 inputs: solution: '$(solution)' msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"' platform: '$(buildPlatform)' configuration: '$(buildConfiguration)'
      • task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'drop' publishLocation: 'Container'

Below is yml code for deployment pipeline -

trigger: none

resources:

pipelines:

  • pipeline: AppPackage source: salilrbl24.UpdatedPipelineTest branch: main trigger: branches:
    • main

pool:

vmImage: windows-latest

jobs:

  • deployment: DeployWeb displayName: deploy Web App

    Creates an environment if it doesn't exist.

    environment: 'main' strategy:

    Default deployment strategy, more coming...

    runOnce:
      deploy:
      
      
       steps:
      
      
       - task: DownloadBuildArtifacts@0
      
      
         displayName: download
      
      
         inputs:
      
      
      
           
      
      
          buildType: specific
      
      
          downloadType: specific
      
      
          artifactName: 'drop'
      
      
          downloadPath: '$(System.DefaultWorkingDirectory)'
      
      
       - task: AzureRmWebAppDeployment@4
      
      
         displayName: deploy
      
      
         inputs:
      
      
          ConnectionType: 'AzureRM'
      
      
          azureSubscription: 'name of subscription'
      
      
          appType: 'webApp'
      
      
          WebAppName: 'webappsal'
      
      
          packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip'
    
      ```Facing below issue during run of deployment pipeline - 
    
    
    
2024-05-14T14:30:54.0404030Z ##[section]Starting: download
2024-05-14T14:30:54.0412245Z ==============================================================================
2024-05-14T14:30:54.0412723Z Task         : Download build artifacts
2024-05-14T14:30:54.0412940Z Description  : Download files that were saved as artifacts of a completed build
2024-05-14T14:30:54.0413245Z Version      : 0.239.1
2024-05-14T14:30:54.0413565Z Author       : Microsoft Corporation
2024-05-14T14:30:54.0413774Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/download-build-artifacts
2024-05-14T14:30:54.0414009Z ==============================================================================
2024-05-14T14:30:55.2262149Z ##[error]Unhandled: Input required: definition
2024-05-14T14:30:55.2282003Z ##[error]Error: Input required: definition

at Object.getInput (D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\node_modules\azure-pipelines-task-lib\task.js:226:15) at D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:126:44 at Generator.next (<anonymous>) at fulfilled (D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

2024-05-14T14:30:55.2692337Z     throw err;
2024-05-14T14:30:55.2692833Z     ^
2024-05-14T14:30:55.2693122Z 
2024-05-14T14:30:55.2693556Z Error: Input required: definition
2024-05-14T14:30:55.2694856Z     at Object.getInput (D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\node_modules\azure-pipelines-task-lib\task.js:226:15)
2024-05-14T14:30:55.2695847Z     at D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:126:44
2024-05-14T14:30:55.2697437Z     at Generator.next (<anonymous>)
2024-05-14T14:30:55.2698221Z     at fulfilled (D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:5:58)
2024-05-14T14:30:55.2698871Z     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-05-14T14:30:55.2699279Z 
2024-05-14T14:30:55.2699695Z Node.js v20.11.1
2024-05-14T14:30:55.2702250Z ##[error]artifact-engine: unhandled exception Error: Input required: definition

at Object.getInput (D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\node_modules\azure-pipelines-task-lib\task.js:226:15) at D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:126:44 at Generator.next (<anonymous>) at fulfilled (D:\a_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.239.1\main.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

2024-05-14T14:30:55.3239989Z ##[section]Finishing: download
     Apologies if I am putting too much data here, but I need to resolve the error. Requesting to please let me know what is going wrong here.
```Thanks,

Salil

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,370 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 37,751 Reputation points Microsoft Employee
    2024-05-15T18:25:30.9333333+00:00

    @Salil Singh
    Azure Devops is not currently supported here on Microsoft QnA.

    The Community Members and Engineers are actively answering questions in dedicated forums here. Please post your question in that forum:

    https://developercommunity.visualstudio.com/spaces/21/index.html

    https://azure.microsoft.com/en-in/support/devops/

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.