1

I am trying to deploy a hello world react js project. I am having problem with this specific section of the yml code. The full yml file is here, https://gist.github.com/Jay-study-nildana/aaa22f47da2c288dc1b04b53028f126f

    # Publish website to Azure App Service using CLI (WebApp)
    - name: Publish Website to WebApp
      uses: Azure/cli@v2
      with:
        inlineScript: |
             az webapp deploy --name ${{ env.WEBAPP-NAME }} --resource-group ${{ env.RESOURCE-GROUP }} --src-path ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}  

and the env variables

#Environment variables https://docs.github.com/en/actions/learn-github-actions/environment-variables
env:
  RESOURCE-GROUP: devops_rg_oct1a
  LOCATION: centralindia
  TEMPLATE-FILE: infra/webapp.bicep
  SUBSCRIPTION-ID: 
  WEBAPP-NAME: devopswebappoct1a
  AZURE_WEBAPP_PACKAGE_PATH: '.'      # set this to the path to your web app project, defaults to the repository root
  NODE_VERSION: '18.x'                # set this to the node version to use

note: I can see in the azure portal that the web app is provisioned just fine. So, Azure CLI is able to successfully login with the service principal which has full access to deploy.

note: I used an identical script for dot net deployment, which worked fine. Now, I am using the example, given here, https://github.com/Azure/actions-workflow-samples/blob/master/AppService/node.js-webapp-on-azure.yml, and modifying it to work with my existing yml file. The linked file uses 'AZURE_WEBAPP_PUBLISH_PROFILE' but I am trying to make the deploy happen with azure cli, as it already worked for my dot net deployment.

and the error is this.

20s
Run Azure/cli@v2
  with:
    inlineScript: az webapp deploy --name devopswebappoct1a --resource-group devops_rg_oct1a --src-path .      
  
    azcliversion: agentazcliversion
  env:
    RESOURCE-GROUP: devops_rg_oct1a
    LOCATION: centralindia
    TEMPLATE-FILE: infra/webapp.bicep
    SUBSCRIPTION-ID: 
    WEBAPP-NAME: devopswebappoct1a
    AZURE_WEBAPP_PACKAGE_PATH: .
    NODE_VERSION: 18.x
  
Starting script execution via docker image mcr.microsoft.com/azure-cli:2.64.0
WARNING: Deployment type: static. To override deployment type, please specify the --type parameter. Possible values: war, jar, ear, zip, startup, script, static
WARNING: Initiating deployment
WARNING: Deploying from local path: .
ERROR: Either '.' is not a valid local file path or you do not have permissions to access it
Error: Error: az cli script failed.
cleaning up container...
MICROSOFT_AZURE_CLI_1727760580737_CONTAINER
Error: az cli script failed.

1 Answer 1

0

You are downloading

infra/webapp.bicep

into

bicep-template/webapp.bicep

Is this what your deployment expects? If not, remove or adjust line 76.

Sign up to request clarification or add additional context in comments.

2 Comments

my issue is not with the bicep file. The app is provisioning just fine. the issue is the azure cli is not able to find the deployment destination in the web app.
further, even if I remove the bicep file (and simply provision the app from Azure Portal manually, I still get the same error). ultimately, I am simply trying to deploy a node js app via github actions using the azure cli

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.