skip to Main Content

I have a Repo in Azure Repos named as DogwoodWebPortal , it has 2 branches
1st branch is : main
2nd branch is : development

I want to create a yaml pipeline which will deploy 2nd branch : development to azure static web app

this is the pipeline i’m creating but it is providing me an error

trigger:
  branches:
    include:
    - development

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'

- script: |
    npm install --legacy-peer-deps
  displayName: 'Install dependencies'
- task: AzureStaticWebApp@0
  inputs:
    app_location: 'path/to/DogwoodWebPortal'
    app_branch: 'development'
    azure_static_web_apps_api_token: '' #not mentioning my api token here , since stackoverflow is public but i'm entering in my pipeline

Error : App Directory Location: ‘path/to/DogwoodWebPortal’ is invalid. Could not detect this directory. Please verify your deployment configuration file reflects your repository structure.

2

Answers


  1. Chosen as BEST ANSWER

    So this was fixed , First it was running on the main and I edited the pipeline and got to see the branch option where I selected development branch

    enter image description here

    Click on "RUN"

    and tagged the "development" branch

    enter image description here


  2. The documentation says

    The directory location of the application source code, relative to the working directory.’

    In this context, it means the app_location value needs to be set to folder of the files in your git repo.

    For example, if the files are in an src folder, that would be the value. If your code is all at the root of the repo it can be left empty. It is hard to answer the exact value without knowing the folder structure of your repo.

    An additional point it is good to see you not posting in the value of your API key however it is recommended to use a Libary Set with a secure value so you are also not committing it to Git.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search