Azure Static Web APP

Sateesh Kumar Sharma 21 Reputation points
2023-06-09T13:27:35.73+00:00
Hi Team ,

I am trying to build Frontend Appplication developed in HTML Javascript and Jquery(Currently hosted on sharepoint 2013) and host it on Azure as Azure Static Web APP.

While createting Static Web APP, I have selescted option Other to deploy the application and configure deployment token in Azure Pipeline.

Azure Pipeline Script:

# Node.js with gulp
# Build a Node.js project using the gulp task runner.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
  - master

pool:
  vmImage: ubuntu-latest

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

- script: |
    npm install
    gulp default --gulpfile gulpfile.js
  displayName: 'npm install and run gulp'

- task: AzureStaticWebApp@0
  inputs:
    app_location: 'dist'
    skip_app_build: true
    api_location: 'public'
    azure_static_web_apps_api_token: $(deployment_token_ssui)
	
=======================================================================

When I started the build , below steps executed.


Step1:

Build Directory- /home/vsts/work/1
Artifacts- /home/vsts/work/1/a

'NodeTool' has been downloaded into '/home/vsts/work/_tasks/NodeTool_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2/0.220.1

'CmdLine' has been downloaded into '/home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.212.0

AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY}

Step 2:

[section]Starting: Checkout apim-ss-ui@master to s
2023-06-08T12:43:15.8733648Z ==============================================================================
2023-06-08T12:43:15.8734121Z Task         : Get sources
2023-06-08T12:43:15.8734333Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2023-06-08T12:43:15.8734470Z Version      : 1.0.0
2023-06-08T12:43:15.8734657Z Author       : Microsoft
2023-06-08T12:43:15.8735031Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2023-06-08T12:43:15.8735198Z ==============================================================================
2023-06-08T12:43:16.3685975Z ##[debug]Processed: ##vso[telemetry.publish area=AzurePipelinesAgent;feature=Checkout]{"RepoType":"Git","HostOS":"Linux"}
2023-06-08T12:43:16.3716284Z ##[debug]Processed: ##vso[plugininternal.updaterepositorypath alias=self;]/home/vsts/work/1/s
2023-06-08T12:43:16.3717541Z ##[debug]Repository requires to be placed at '/home/vsts/work/1/s', current location is '/home/vsts/work/1/s'
2023-06-08T12:43:16.3718000Z Syncing repository: apim-ss-ui (Git)
2023-06-08T12:43:16.3718350Z ##[debug]repository url=https://******@dev.azure.com/NetsGroupIT/OPENAPI/_git/apim-ss-ui
2023-06-08T12:43:16.3750751Z ##[debug]targetPath=/home/vsts/work/1/s
2023-06-08T12:43:16.3753441Z ##[debug]sourceBranch=refs/heads/master

Exited process 1703 with exit code 0
2023-06-08T12:43:16.5896070Z ##[debug]Failed to update oom_score_adj for PID: 1703.
2023-06-08T12:43:16.6009396Z ##[debug]System.UnauthorizedAccessException: Access to the path '/proc/1703/oom_score_adj' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   
   
 Step 3 :
 
 2023-06-08T12:43:31.6245286Z [12:43:31] Using gulpfile ~/work/1/s/gulpfile.js
2023-06-08T12:43:31.6254198Z [12:43:31] Starting 'clean'...
2023-06-08T12:43:31.6283392Z [12:43:31] Starting 'minjs'...
2023-06-08T12:43:31.6383393Z [12:43:31] Starting 'js'...
2023-06-08T12:43:31.6392543Z [12:43:31] Starting 'sass'...
2023-06-08T12:43:31.6400574Z [12:43:31] Starting 'gfx'...
2023-06-08T12:43:31.6428963Z [12:43:31] Finished 'clean' after 17 ms
2023-06-08T12:43:31.6461051Z [12:43:31] Finished 'js' after 7.7 ms
2023-06-08T12:43:31.6463550Z [12:43:31] Finished 'minjs' after 18 ms
2023-06-08T12:43:31.6469205Z [12:43:31] Finished 'sass' after 7.74 ms
2023-06-08T12:43:31.6557848Z [12:43:31] Finished 'gfx' after 16 ms
2023-06-08T12:43:31.6558660Z [12:43:31] Starting 'build'...
2023-06-08T12:43:31.6559400Z [12:43:31] Finished 'build' after 21 μs
2023-06-08T12:43:31.6563411Z [12:43:31] Starting 'rebuild'...
2023-06-08T12:43:31.6563646Z [12:43:31] Finished 'rebuild' after 4.6 μs
2023-06-08T12:43:31.6563843Z [12:43:31] Starting 'default'...
2023-06-08T12:43:31.6564023Z [12:43:31] Finished 'default' after 1.4 μs
2023-06-08T12:43:31.6671500Z ##[debug]Exit code 0 received from tool '/usr/bin/bash'
2023-06-08T12:43:31.6672136Z ##[debug]STDIO streams have closed for tool '/usr/bin/bash'
2023-06-08T12:43:31.6672848Z ##[debug]task result: Succeeded
2023-06-08T12:43:31.6681586Z ##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
2023-06-08T12:43:31.6738007Z ##[section]Finishing: npm install and run gulp

Step 4:

2023-06-08T14:17:41.1974465Z Verbose logging enabled
2023-06-08T14:17:41.2354937Z Build timeout not specified, defaulting to 15 minutes
2023-06-08T14:17:41.2355559Z App Directory Location: 'dist/' was found.
2023-06-08T14:17:41.2360928Z Looking for event info
2023-06-08T14:17:41.2376377Z Event info parsed from action options.
2023-06-08T14:17:41.7106138Z Skipping step to build /working_dir/dist with Oryx
2023-06-08T14:17:41.7110924Z Could not find staticwebapp.config.json file.
2023-06-08T14:17:41.7114952Z Didn't find Oryx manifest file under location: /2d763621-8efe-4a20-b25b-9cc42e9a66fd-swa-oryx/app-manifest/oryx-manifest.toml
2023-06-08T14:17:41.7174299Z Failed to find a default file in the app artifacts folder (dist). Valid default files: index.html,Index.html.
2023-06-08T14:17:41.7174807Z If your application contains purely static content, please verify that the variable 'app_location' in your deployment configuration file points to the root of your application.
2023-06-08T14:17:41.7175195Z If your application requires build steps, please validate that a default file exists in the build output directory.
2023-06-08T14:17:41.7175409Z 
2023-06-08T14:17:41.7372352Z 
2023-06-08T14:17:41.7372822Z For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
2023-06-08T14:17:41.7373254Z If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
2023-06-08T14:17:41.7373513Z Exiting
2023-06-08T14:17:41.8811937Z ##[debug]Exit code 1 received from tool '/usr/bin/bash'
2023-06-08T14:17:41.8815433Z ##[debug]STDIO streams have closed for tool '/usr/bin/bash'
2023-06-08T14:17:41.8844943Z ##[debug]task result: Failed
2023-06-08T14:17:41.8894577Z ##[error]Error: The process '/usr/bin/bash' failed with exit code 1
2023-06-08T14:17:41.8901248Z ##[debug]Processed: ##vso[task.issue type=error;]Error: The process '/usr/bin/bash' failed with exit code 1
2023-06-08T14:17:41.8902241Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: The process '/usr/bin/bash' failed with exit code 1
2023-06-08T14:17:41.8903633Z ##[section]Finishing: AzureStaticWebApp

It seems somethnig wrong during  - task: AzureStaticWebApp@0- Exit code 1 received from tool '/usr/bin/bash'

How can I deal with this error message .

Thank you in advance !!
Static-Web-APP.PNG
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2023-07-02T20:57:46.1933333+00:00

    @Sateesh Kumar Sharma It looks like the Azure Static Web App build is failing with the error message "Failed to find a default file in the app artifacts folder (dist). Valid default files: index.html,Index.html." This error message indicates that the build process is unable to find a default file in the app artifacts folder.

    To resolve this issue, you can try the following steps:

    Ensure that the app_location input in the Azure Static Web App task is pointing to the root of your application. If your application contains purely static content, the app_location should point to the root of your application.

    If your application requires build steps, ensure that a default file exists in the build output directory. The default file should be named either index.html or Index.html.

    Verify that the app_location input in the Azure Static Web App task is pointing to the correct directory where the default file is located.

    0 comments No comments

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.