microsoft / azure-gradle-plugins

Azure Plugins for Gradle
MIT License
45 stars 28 forks source link

azureFunctionsPackage task fails when using Azure Functions Plugin for Gradle 1.15.0 #177

Closed taisuke-fujimoto closed 4 months ago

taisuke-fujimoto commented 10 months ago

When updating to Azure Functions Plugin for Gradle 1.15.0, azureFunctionsPackage task now fails with the error below.

Execution failed for task ':azureFunctionsPackage'.
> generate configuration files and prepare staging directory

This does not occur before 1.14.0.

Here is a sample repository: https://github.com/taisuke-fujimoto/azure-gradle-plugins-1.15.0-bug

Checked on my PC (Windows 10) and GitHub Actions (Ubuntu latest).

cportma commented 10 months ago

same for me, running it with --stacktrace I see the following stacktrace. I tried both my own project and the repo of @taisuke-fujimoto

Caused by: org.gradle.api.GradleException: Cannot package functions due to error: null
        at com.microsoft.azure.plugin.functions.gradle.task.PackageTask.build(PackageTask.java:57)
        ... 122 more
Caused by: java.lang.NullPointerException
        at com.microsoft.azure.toolkit.lib.common.operation.OperationContext.setTelemetryProperties(OperationContext.java:46)
        at com.microsoft.azure.plugin.functions.gradle.task.PackageTask.build(PackageTask.java:44)
        ... 122 more
snesm commented 6 months ago

pricingTier and region parameters are either newly required or poorly handled (creating the null exception) if they don't exist.

davidsalter commented 6 months ago

Region is probably always needed, but pricingTier can be optional if you're using an app service plan instead of consumption plan. I've submitted a PR that will stop this NPE if the pricingTier is not specified.

https://github.com/microsoft/azure-gradle-plugins/pull/180

taisuke-fujimoto commented 5 months ago

@Flanker32 Please include in the changelog that the required properties have changed. Also, please update the wiki.

Flanker32 commented 5 months ago

@taisuke-fujimoto @davidsalter @snesm Thank you all for your support. Yes, this should be an regression of the gradle plugin, and we have merged the PR from @davidsalter, which will be shipped in our June release.

Flanker32 commented 4 months ago

@taisuke-fujimoto @davidsalter @snesm We have released functions gradle plugin 1.16.1, which includes the fix for this issue, thanks again for your help!