Github -> Azure Deployment: Error: Couldn't detect a version for the platform 'python' in the repo.

WrightFlyer 21 Reputation points
2021-06-07T15:35:08.79+00:00

I have created a Web App (python install) in Azure and am trying to set up continuous deployment from GitHub.

I set up the connection via Azure and Github is trying to connect when I push new files in to the codebase but failures are being reported in the Azure deployment centre logs which link to this error report in the Git Hub repository:

Build using AppService-build

Run azure/appservice-build@v2
with:
platform: python
platform-version: 3.8
env:
pythonLocation: /opt/hostedtoolcache/Python/3.8.10/x64
/usr/bin/docker run --name a33c18db127866a56494b8ac479c34ff1e657_8affb8 --label 8a33c1 --workdir /github/workspace --rm -e pythonLocation -e INPUT_PLATFORM -e INPUT_PLATFORM-VERSION -e INPUT_SOURCE-DIRECTORY -e INPUT_OUTPUT-DIRECTORY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/website/website":"/github/workspace" 8a33c1:8db127866a56494b8ac479c34ff1e657 "" "python" "3.8" ""

No source directory was provided -- the root of the repository ('GITHUB_WORKSPACE' environment variable) will be built: '/github/workspace'
No output directory was provided
Platform provided: 'python'
Platform version provided: '3.8'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 131 100 131 0 0 1858 0 --:--:-- --:--:-- --:--:-- 1871

Running command 'oryx build /github/workspace --platform python --platform-version 3.8'
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20201112.1, Commit: a120bb248aa8d208ca5e02d7d9d075196e79cffd, ReleaseTagName: 20201112.1

Build Operation ID: |+JFW77kQOzM=.b4aa810_
Repository Commit : 8a762007f198473cea081d3f24b826b9fd802d42

Detecting platforms...
Could not detect any platform in the source directory.
Error: Couldn't detect a version for the platform 'python' in the repo.

Can anyone help? At the moment I am simply trying to push an index.html file from Visual Studio Code --> GitHub --> Azure.

Many thanks.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Accepted answer
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2021-06-08T12:17:18.853+00:00

    @WrightFlyer , Thanks for posting this question.

    If it's not already done, add this to your yaml file (part of the workflow that builds the web app)

    - name: Install dependencies  
      run: |  
        python -m pip install --upgrade pip  
        pip install -r requirements.txt  
    

    Also, use the AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root.

    To get automated builds from Azure App Service build server, ensure confirm that your repository root has the correct files in your project (*.py, requirements.txt, or runtime.txt).

    Kindly take a look at this sample in the doc and see it helps.
    https://learn.microsoft.com/azure/app-service/deploy-github-actions?tabs=applevel#python


1 additional answer

Sort by: Most helpful
  1. WrightFlyer 21 Reputation points
    2021-06-08T13:43:58.46+00:00

    Super answer ajkuma-MSFT,

    All working now.

    Many thanks.


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.