Azure Pipeline-Fehler beim Bereitstellen von Azure Functions
Beim Bereitstellen einer Azure Function, die IronPDF verwendet, kann der folgende Fehler auftreten, wenn DeploymentType in Ihrer Azure Pipeline auf auto oder zipDeploy eingestellt ist.
[0714/125524.684:FATAL:gpu_data_manager_impl_private.cc(440)] GPU process isn't usable. Goodbye.
Dieser Fehler tritt auf, weil zipDeploy die nativen Binärdateien, von denen IronPDF abhängt, einschließlich der Chromium Embedded Framework (CEF) Komponenten, nicht korrekt beibehält. Wenn diese Binärdateien nach der Bereitstellung fehlen oder beschädigt sind, schlägt der GPU-Prozess zur Laufzeit fehl.
Lösung
Ändern Sie DeploymentType zu webDeploy in der AzureRmWebAppDeployment@4-Aufgabe. Diese Bereitstellungsmethode bewahrt alle nativen Binärdateien, einschließlich CEF, während des Bereitstellungsprozesses.
Stellen Sie außerdem zipAfterPublish: false im Veröffentlichungs-Schritt ein, damit der Ausgabeordner vor der Bereitstellung nicht gezippt wird.
Das folgende Pipeline-YAML zeigt die vollständig empfohlene Konfiguration:
jobs:
- job:
steps:
- checkout: self
displayName: Checkout Repository
lfs: true
- task: AzureCLI@2
displayName: Check Azure CLI Installation
inputs:
azureSubscription: '<your-azure-subscription-name>'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: 'az --version'
- task: DotNetCoreCLI@2
displayName: Restore Function Project
inputs:
command: 'restore'
projects: '<path-to-your-csproj>'
- task: DotNetCoreCLI@2
displayName: Build Function Project
inputs:
command: 'build'
projects: '<path-to-your-csproj>'
arguments: '--configuration Release --no-restore --verbosity normal'
- task: DotNetCoreCLI@2
displayName: Publish Function Project
inputs:
command: publish
arguments: '--configuration Release --no-build --output $(Build.ArtifactStagingDirectory)/publish_output'
projects: '<path-to-your-csproj>'
publishWebProjects: false
modifyOutputPath: false
zipAfterPublish: false
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy Azure Function App'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '<your-azure-subscription-name>'
appType: 'functionApp'
WebAppName: '<your-azure-function-app-name>'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
jobs:
- job:
steps:
- checkout: self
displayName: Checkout Repository
lfs: true
- task: AzureCLI@2
displayName: Check Azure CLI Installation
inputs:
azureSubscription: '<your-azure-subscription-name>'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: 'az --version'
- task: DotNetCoreCLI@2
displayName: Restore Function Project
inputs:
command: 'restore'
projects: '<path-to-your-csproj>'
- task: DotNetCoreCLI@2
displayName: Build Function Project
inputs:
command: 'build'
projects: '<path-to-your-csproj>'
arguments: '--configuration Release --no-restore --verbosity normal'
- task: DotNetCoreCLI@2
displayName: Publish Function Project
inputs:
command: publish
arguments: '--configuration Release --no-build --output $(Build.ArtifactStagingDirectory)/publish_output'
projects: '<path-to-your-csproj>'
publishWebProjects: false
modifyOutputPath: false
zipAfterPublish: false
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy Azure Function App'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '<your-azure-subscription-name>'
appType: 'functionApp'
WebAppName: '<your-azure-function-app-name>'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
Ersetzen Sie <your-azure-subscription-name>, <path-to-your-csproj> und <your-azure-function-app-name> durch Ihre tatsächlichen Werte. Für die allgemeine Einrichtung und Konfiguration von Azure Functions siehe den Azure-Bereitstellungsleitfaden.

