title: Error: Deployment failed Resource is not in the state deploymentSuccessful Finishing: CodeDeployDeployApplication
body: <p>I am quite new to azure devops. I am trying to deploy my app from azure to aws ec2 using codedeploy. The build pipeline is giving &quot;Error: Deployment failed Dev-TitasEcom-Frontend Resource is not in the state deploymentSuccessful&quot; error. I have searched a lot but could not find any proper resource to resolve the issue. Below given the code of azure-pipelines.yaml</p>
  <pre><code>pr:
    branches:
      include:
        - master
        - dev
    paths:
      include:
        - ./*
  
  jobs:
    - job: Build_Job
      displayName: Build
      pool:
        vmImage: 'ubuntu-latest'
        demands:
        - npm
      steps:
      - checkout: self
        clean: false
  #    - powershell: 'npm cache clean  --force'
  #      displayName: 'PowerShell Script'
  #      env:
  #        APPDATA: npm-cache
  
  #    - task: CodeDeployDeployApplication@1
  #      inputs:
  #        awsCredentials: 'AWS Service Con'
  #        regionName: 'us-east-1'
  #        applicationName: 'Dev-TitasEcom-Frontend'
  #        deploymentGroupName: 'Dev-erp-Frontend'
  #        #deploymentRevisionSource: 'workspace'
          #revisionBundle: 'Dev-erp-Frontend-Rev'
  #        bucketName: 'Dev-erp-Frontend'
  #        fileExistsBehavior: 'OVERWRITE'
  #        batch: &quot;true&quot;
      
      - task: CodeDeployDeployApplication@1
        inputs:
          awsCredentials: 'AWS Service Con 1'
          regionName: 'us-east-1'
          applicationName: 'Dev-TitasEcom-Frontend-11'
          deploymentGroupName: 'Dev-erp-Frontend'
          environmentName: 'DevTitasecomFrontend-env-12'
          applicationType: 'version'
          bucketName: 'elasticbeanstalk-us-east-1-3067722226831765'
          fileExistsBehavior: 'OVERWRITE'
          #versionLabel: 'v.0.01'
          batch: &quot;true&quot;
  
      - task: Npm@1
        displayName: 'Npm Install'
        inputs:
          workingDir: &quot;./&quot;
          command: &quot;ci&quot;
      - task: Npm@1
        displayName: 'Lint Client App'
        inputs:
          workingDir: &quot;./&quot;
          command: &quot;custom&quot;
          customCommand: &quot;run lint&quot;
        continueOnError: true
      - task: Npm@1
        displayName: 'Copy Assets'
        inputs:
          workingDir: &quot;./&quot;
          command: &quot;custom&quot;
          customCommand: &quot;run copy-files&quot;
        continueOnError: false
      - task: Npm@1
        displayName: 'Build Client App'
        inputs:
          workingDir: &quot;./&quot;
          command: &quot;custom&quot;
          customCommand: &quot;run build:prod&quot;
  
  # Archive files
      - task: ArchiveFiles@2
        inputs:
          rootFolderOrFile: '$(Build.BinariesDirectory)' 
          includeRootFolder: true 
          archiveType: 'zip' # Options: zip, 7z, tar, wim
          archiveFile: '$(Build.ArtifactStagingDirectory)/www.zip' 
          replaceExistingArchive: true
  
      - task: CopyFiles@2
        inputs:
          Contents: 'www/**'
          TargetFolder: '$(build.artifactstagingdirectory)'
      - task: PublishBuildArtifacts@1
        displayName: 'Publish Artifact'
        inputs:
          PathtoPublish: '$(build.artifactstagingdirectory)'
          ArtifactName: 'titas-ecom-erp'
  </code></pre>