Error: Couldn't detect a version for the platform 'python' in the repo

Karthik Somu 20 Reputation points
2025-06-11T16:12:33.83+00:00

Hello Team

We have developed Azure funciton from visual studio and it works locally and when try to deploy to Azure Portal, its resulted below error,

could you please help what needs to be done?

Thanks

4:57:13 PM fun-internal-nonpdn: Fetching changes.

4:57:14 PM fun-internal-nonpdn: Starting LocalZipHandler

4:57:14 PM fun-internal-nonpdn: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/fa100dc9-9117-4b40-9c42-7e84d6205191.zip (0.00 MB) to /tmp/zipdeploy/extracted

4:57:14 PM fun-internal-nonpdn: Exception in extracting and setting permissions on the zip file System.IO.Abstractions.FileInfoWrapper:System.IO.InvalidDataException: Central Directory corrupt.

4:57:14 PM fun-internal-nonpdn: ---> System.IO.IOException: Invalid argument : '/tmp/zipdeploy/fa100dc9-9117-4b40-9c42-7e84d6205191.zip'

4:57:14 PM fun-internal-nonpdn: at System.IO.Strategies.FileStreamHelpers.ThrowInvalidArgument(SafeFileHandle )

4:57:14 PM fun-internal-nonpdn: at System.IO.Strategies.OSFileStreamStrategy.Seek(Int64 , SeekOrigin )

4:57:14 PM fun-internal-nonpdn: at System.IO.Strategies.BufferedFileStreamStrategy.Seek(Int64 , SeekOrigin )

4:57:14 PM fun-internal-nonpdn: at System.IO.FileStream.Seek(Int64 , SeekOrigin )

4:57:14 PM fun-internal-nonpdn: at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()

4:57:14 PM fun-internal-nonpdn: --- End of inner exception stack trace ---

4:57:14 PM fun-internal-nonpdn: at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()

4:57:14 PM fun-internal-nonpdn: at System.IO.Compression.ZipArchive..ctor(Stream , ZipArchiveMode , Boolean , Encoding )

4:57:14 PM fun-internal-nonpdn: at System.IO.Compression.ZipArchive..ctor(Stream , ZipArchiveMode )

4:57:14 PM fun-internal-nonpdn: at Kudu.Services.Deployment.PushDeploymentController.LocalZipFetch(IRepository repository, DeploymentInfoBase deploymentInfo, String targetBranch, ILogger logger, ITracer tracer) in /tmp/KuduLite/Kudu.Services/Deployment/PushDeploymentController.cs:line 1214

4:57:17 PM fun-internal-nonpdn: Updating submodules.

4:57:18 PM fun-internal-nonpdn: Preparing deployment for commit id '973fa955-c'.

4:57:19 PM fun-internal-nonpdn: PreDeployment: context.CleanOutputPath False

4:57:19 PM fun-internal-nonpdn: PreDeployment: context.OutputPath /home/site/wwwroot

4:57:19 PM fun-internal-nonpdn: Repository path is /tmp/zipdeploy/extracted

4:57:19 PM fun-internal-nonpdn: Running oryx build...

4:57:19 PM fun-internal-nonpdn: Command: oryx build /tmp/zipdeploy/extracted -o /tmp/build/expressbuild --platform python --platform-version 3.10.4 -i /tmp/8dda900a4dc0055 -p packagedir=.python_packages/lib/site-packages

4:57:20 PM fun-internal-nonpdn: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx

4:57:20 PM fun-internal-nonpdn: Error: Couldn't detect a version for the platform 'python' in the repo.

4:57:20 PM fun-internal-nonpdn: You can report issues at https://github.com/Microsoft/Oryx/issues

4:57:20 PM fun-internal-nonpdn: Oryx Version: 0.2.20250522.1+cada9e85564f034d18420f8b5b38b3cf2259f321, Commit: cada9e85564f034d18420f8b5b38b3cf2259f321, ReleaseTagName: 20250522.1

4:57:20 PM fun-internal-nonpdn: Build Operation ID: b965660211b2af8a

4:57:20 PM fun-internal-nonpdn: Repository Commit : 973fa955-ca29-4928-bd99-bfe9347613c3

4:57:20 PM fun-internal-nonpdn: OS Type : bullseye

4:57:20 PM fun-internal-nonpdn: Image Type : githubactions

4:57:20 PM fun-internal-nonpdn: Primary SDK Storage URL: https://oryx-cdn.microsoft.io

4:57:20 PM fun-internal-nonpdn: Backup SDK Storage URL: https://oryxsdks-cdn.azureedge.net

4:57:20 PM fun-internal-nonpdn: Detecting platforms...

4:57:20 PM fun-internal-nonpdn: Could not detect any platform in the source directory.

4:57:21 PM fun-internal-nonpdn: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /tmp/build/expressbuild --platform python --platform-version 3.10.4 -i /tmp/8dda900a4dc0055 -p packagedir=.python_packages/lib/site-packages

4:57:32 PM fun-internal-nonpdn: Syncing triggers...

4:57:34 PM fun-internal-nonpdn: Querying triggers...

4:57:38 PM fun-internal-nonpdn: No HTTP triggers found.

Thanks

Karthik

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,867 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ranashekar Guda 2,430 Reputation points Microsoft External Staff Moderator
    2025-06-13T18:29:38.03+00:00

    Hello @Karthik Somu,
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: Error: Couldn't detect a version for the platform 'python' in the repo

    Solution: It's due to the firewall blocking the required Python dependency for downloading, hence this failure. Therefore, we must speak to the network team to add a firewall rule that allows the dependency to be downloaded during deployment to the portal.

    also, we must have all below requirement is in place and must be installed using pip install -r requirements.txt, so that its resolved all issues.

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    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.