Filing to deploy static files from Azure DevOps due to Oryx
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
It was discussed here before and on Microsoft/Oryx , but none of the “old” solutions worked for me.
I have a simple Azure DevOps repository, with index.html in root path, as well as in /src directory.
```
src/index.html
azure-pipelines.yml
index.html
```
Azure Pipeline has deployment_token variable configured.
azure-pipelines.yml I’ve tried with many combinations like
```
- task: AzureStaticWebApp@0
inputs:
app_location: '/'
#output_location: 'src'
#app_artifact_location: 'src'
#app_build_command: 'echo WHY'
#skip_app_build: false
verbose: true
azure_static_web_apps_api_token: '$(deployment_token)'
# env:
# BUILD_SOURCESDIRECTORY: $(Pipeline.Workspace)
```
But the best result I could achieve, gave me Oryx errors "**Error: Could not detect the language from repo.**" and "**Failed to find a default file in the app artifacts folder (/). Valid default files: index.html,Index.html.**":
```
##[section]Starting: AzureStaticWebApp
==============================================================================
Task : Deploy Azure Static Web App
Description : [PREVIEW] Build and deploy an Azure Static Web App
Version : 0.194.2
Author : Microsoft Corporation
Help : https://aka.ms/swadocs
==============================================================================
[command]/bin/bash /azp/_work/_tasks/AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a/0.194.2/launch-docker.sh
[37mDeploymentId: 112cdebc-2c2f-4ce0-9d5f-a2410a050f7b [0m
[37m [0m
[37mVerbose logging enabled [0m
[37mBuild timeout not specified, defaulting to 15 minutes [0m
[37mApp Directory Location: '/' was found. [0m
[37mNo Api directory specified. Azure Functions will not be created. [0m
[37mLooking for event info [0m
[37mEvent info parsed from action options. [0m
[37mStarting to build app with Oryx [0m
[33mAzure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx [0m
[37mCalling oryx build /working_dir -o /ss-oryx/app --manifest-dir /ss-oryx/app-manifest -p require_build -p disable_recursive_lookup=true -p ORYX_APP_TYPE="static-sites" [0m
[37m---Oryx build logs--- [0m
[37m [0m
[37m [0m
[37mOperation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx [0m
[37mYou can report issues at https://github.com/Microsoft/Oryx/issues [0m
[37m [0m
[37mOryx Version: 0.2.20211001.1, Commit: f0cbc9b1f0d056493cdb36f92b62f11921c87261, ReleaseTagName: 20211001.1 [0m
[37m [0m
[37mBuild Operation ID: |SFeMRx9Jnoc=.ad17ea4b_ [0m
[37m [0m
[37mDetecting platforms... [0m
[37mCould not detect any platform in the source directory. [0m
[31mError: Could not detect the language from repo. [0m
[37m [0m
[37m [0m
[37m---End of Oryx build logs--- [0m
[37mOryx build has completed. Took 0.5283402 seconds. Exit Code: 2 [0m
[33mOryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support. [0m
[37mCopying unbuilt assets from /working_dir to oryx app build folder /ss-oryx/app [0m
[37mCopied unbuilt assets from /working_dir to oryx app build folder /ss-oryx/app [0m
[37mFinished building app with Oryx [0m
[33mCould not find staticwebapp.config.json file. [0m
[31mFailed to find a default file in the app artifacts folder (/). Valid default files: index.html,Index.html. [0m
[31mIf 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. [0m
[31mIf your application requires build steps, please validate that a default file exists in the build output directory. [0m
[31m [0m
[37m [0m
[33mFor further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/ [0m
[33mIf you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/ [0m
[33mExiting [0m
##[error]Error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: AzureStaticWebApp
```
Any attempt to change app_location or output_location ended up with worse error.
Tried forcing different Oryx behavior by setting COMMAND, CUSTOM_BUILD_COMMAND, ENABLE_ORYX_BUILD, SCM_DO_BUILD_DURING_DEPLOYMENT variables, but I don’t think they are propagated to docker build command.
P.S.: due to limitations of new Azure accounts (0 Microsoft-hosted jobs available), I’m running my own pipeline Agent in Docker (with DinD).
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#linux
Please help. What is the simplest way how to deploy static pages from Azure Repository to Azure Static Web Pages? Is there perhaps direct API of some sort (except GitHub)?
Thanks.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.