1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pythonランタイムを使ったAzure function で Remote build failed!が出たときの対処法

Posted at

ローカルデプロイ時、warningが出たメッセージをよく読みましょう。

Local python version '3.11.9' is different from the version expected for your deployed Function App. This may result in 'ModuleNotFound' errors in Azure Functions. Please create a Python Function App for version 3.11 or change the virtual environment on your local machine to match 'Python|3.12'.

3.11.9じゃなくて、3.12を使ってほしいんだよなぁ(チッ)と言われているので、3.12を使いましょう。

下記URLから3.12の最新版をダウンロードしましょう。
https://www.python.org/downloads/windows/
ダウンロード後、複数のpythonのバージョンを使うことになるので、切り替えをお願いします。

インストール時、pyランチャーをインストールする。
そうするとターミナルでpy -3.12と入力すると切り替えられるよ。
環境変数の上から読み込まれるので、pythonコマンドを変更したい場合は、python312のインストールを上の方に移動しよう。

以下からモジュールのアップデートと環境のアップデートをしようね。

PS:C\<path>>py -3.12 -m venv .venv

仮想環境のアクチベート

PS:C\<path>>. .venv/Scripts/Activate.ps1

モッジュールアップデート前にヴァージョンを確認しましょう。

(.venv)PS:C\<path>>py -V
Python 3.12.10

モジュールのアップデート

(.venv)PS:C\<path>>py -m pip install -r ./requirements.txt
Successfully installed.***

ローカルからアップロードし、リモートビルド

(.venv)PS:C\<path>>func azure functionapp publish <function_name>
Getting site publishing info...
[2025-08-09T05:03:00.078Z] Starting the function app deployment...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 14 MB [#################################################################################]
Remote build in progress, please wait...
Updating submodules.

~ 中略 ~

Downloading and extracting 'python' version '3.12.11' to '/tmp/oryx/platforms/python/3.12.11'...
Detected image debian flavor: bullseye.
Skipping download of python version 3.12.11 as it is available in external sdk provider cache...
Extracting contents...
Successfully extracted python version 3.12.11 from external sdk provider cache...
Done in 35 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.12.11/bin/python3.12
Creating directory for command manifest file if it does not exist
Removing existing manifest file

Running pip install...
Done in 14 sec(s).
[05:04:15+0000] Collecting azure-functions (from -r requirements.txt (line 5))
[05:04:15+0000]   Downloading azure_functions-1.23.0-py3-none-any.whl.metadata (7.3 kB)

[notice] A new release of pip is available: 25.1.1 -> 25.2
[notice] To update, run: pip install --upgrade pip
Not a vso image, so not writing build commands
Preparing output...

Copying files to destination directory '/tmp/build/expressbuild'...
Done in 4 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.
Copying .ostype to manifest output directory.

Done in 58 sec(s).
Writing the artifacts to a Zip file
Running post deployment command(s)...

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Triggering recycle (preview mode disabled).
Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build succeeded!

Remote build succeeded!と言っているので信じてみましょう。
終わり。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?