0

I want to deploy a Static Web App. Build and deploy stages are specified in azure-pipeline. The pipeline fails when it comes to AzureAppServiceSettings@1 task. That is what I got in log:

Got service connection details for Azure App Service:'xxx-dev-app'
Trying to update App Service Application settings. Data: {"testDb":"test"}    
##[error]Error: Failed to get App service 'xxx-dev-app' application settings. Error: The Resource 'Microsoft.Web/sites/xxx-dev-app' under resource group 'xxx-dev-rg' was not found.

The task in azure-pipeline is:

- task: AzureAppServiceSettings@1
          displayName: Azure App Service Settings
          inputs:
            azureSubscription: 'ServiceConnectionName'
            appName: 'xxx-dev-app'
            resourceGroupName: 'xxx-dev-rg'
            appSettings: |
              [
                {
                  "name": "testDb",
                  "value": "test",
                  "slotSetting": false
                }
              ]

DevOps has a Contributor access level both in the app and resource group. Any suggestions what causes deployment failure?

Harshitha Veeramalla
  • 1,515
  • 2
  • 10
  • 11
anystacy
  • 1
  • 1
  • Hi anystacy, and welcome to Stack Overflow! Can I just make a suggestion? If you copy and paste your pipeline code and your error information into the question, that will make it much better than linking screenshots. Remember, on this site you are encouraged to [Edit](https://stackoverflow.com/posts/72543550/edit) your question to improve it as much as possible. – Vince Bowdren Jun 08 '22 at 09:57
  • It's an obvious question, but: is the app definitely there, in that resource group? The error says it can't be found. – Vince Bowdren Jun 08 '22 at 10:12
  • @VinceBowdren I have already checked it, the app belongs to the resource group. I added log entries prior to failure, kindly check my post again. It looks for me that the pipeline established connection to the app, but something went wrong at appsettings insert. – anystacy Jun 08 '22 at 10:33
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 08 '22 at 14:05
  • Check the app name once, may be it is not valid.Try to rename the app and try again – Harshitha Veeramalla Jun 14 '22 at 06:44

1 Answers1

0

I added a task for artifact downloading as it was proposed by @Daniel Mann, and it worked:

trigger:
- master
pool:
  vmImage: ubuntu-latest
variables:
  buildConfiguration: 'Release'
stages:
- stage: Build
  jobs:
  - job: Build
    displayName: 'Build'
    steps:
      - task: DotNetCoreCLI@2
        inputs:
          command: 'build'
          configuration: 'Release'
          arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration $(buildConfiguration)
      - task: ArchiveFiles@2
        displayName: 'Archive files'
        inputs:
          rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output'
          includeRootFolder: false
          archiveType: zip
          archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
          replaceExistingArchive: true
      - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
        artifact: drop
- stage: Test
  dependsOn: Build
  condition: succeeded()
  jobs:
    - job: Deploy
      displayName: 'Deploy to Test'
      steps:
      - download: current
        artifact: drop
      - task: AzureWebApp@1
        inputs:
          azureSubscription: 'yyy'
          appType: 'webApp'
          appName: 'xxx'
          package: '$(Pipeline.Workspace)/drop/*.zip'
anystacy
  • 1
  • 1