microsoft / azure-maven-plugins

Maven plugins for Azure
MIT License
276 stars 150 forks source link

azure-functions-maven-plugin is not working for China North3 #2487

Open Jiayi429 opened 2 months ago

Jiayi429 commented 2 months ago

we found this plugins was not working for deploying function app to China North 3 with below error: image

please help to fix the issue, thanks!

wstest123 commented 3 weeks ago

@Flanker32 Good day! I saw you are the latest contributor to add comment in the following Region class, https://github.com/microsoft/azure-maven-plugins/blob/develop/azure-toolkit-libs/azure-toolkit-common-lib/src/main/java/com/microsoft/azure/toolkit/lib/common/model/Region.java

Image

The azure-functions-maven-plugin not working for China North3 error blocked us to deploy code to China North3 region. Could you please help check or assign any engineer to follow up this issue?

Flanker32 commented 2 weeks ago

@Jiayi429 , @wstest123 Thanks a lot for your report and really sorry for the late response.

@Jiayi429 Currently event related region (China North 3) did not exists in our constants, we will still send request to azure. And the next line [ERROR] Failed to acquire a mew access token indicates this more likely to be an authentication issue. Could you please help provide the details log for us for better investigation? Besides, does maven plugin works for other regions in China?

wstest123 commented 2 weeks ago

@Flanker32 Thanks for your help! This maven plugin works for CN2 regions and attached the log details:

12:08:28 + az account set -s 51555784-aefd-4335-9063-835f98671acf [Pipeline] sh 12:08:29 + mvn azure-functions:deploy -DfunctionAppName=func-pbwc-n3-dev -DfunctionResourceGroup=rg-pbwc-n3-dev -DfunctionServicePlan=ASP-rgpbwcn3dev-b5c5 12:08:30 [INFO] Scanning for projects... 12:08:30 [WARNING] 12:08:30 [WARNING] Some problems were encountered while building the effective model for com.mypaintshop.functions:mypaintshop_functions:jar:1.0.0-SNAPSHOT 12:08:30 [WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 109, column 22 12:08:30 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> version RELEASE vs ${junit.version} @ line 124, column 21 12:08:30 [WARNING] 12:08:30 [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. 12:08:30 [WARNING] 12:08:30 [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. 12:08:30 [WARNING] 12:08:30 [INFO] 12:08:30 [INFO] ----------< com.mypaintshop.functions:mypaintshop_functions >----------- 12:08:30 [INFO] Building Azure Java Functions 1.0.0-SNAPSHOT 12:08:30 [INFO] --------------------------------[ jar ]--------------------------------- 12:08:30 [INFO] 12:08:30 [INFO] --- azure-functions-maven-plugin:1.19.0:deploy (default-cli) @ mypaintshop_functions --- 12:08:32 [WARNING] 'China North 3' may not be a valid region, please refer to https://aka.ms/maven_function_configuration#supported-regions for valid values 12:08:32 [ERROR] Failed to acquire a new access token. 12:08:32 [INFO] Retry attempts have been exhausted after 0 attempts. 12:08:33 [INFO] Using Azure environment: azure_china. 12:08:33 Auth type: AZURE_CLI 12:08:33 Default subscription: OtD_Dev_N3-dev(51555784-aefd-4335-9063-835f98671acf) 12:08:33 Username: bd4a128c-db32-464f-a079-4dbb6cbb6e6c 12:08:33 [INFO] Subscription: OtD_Dev_N3-dev(51555784-aefd-4335-9063-835f98671acf) 12:08:34 [INFO] Reflections took 202 ms to scan 5 urls, producing 24 keys and 726 values 12:08:36 [INFO] Set function worker runtime to java. 12:08:36 [INFO] Starting deployment... 12:08:38 [WARNING] 'Content-Type' not found. Returning default encoding: JSON 12:08:38 [ERROR] Status code 401, (empty body) 12:08:41 [INFO] ------------------------------------------------------------------------ 12:08:41 [INFO] BUILD FAILURE 12:08:41 [INFO] ------------------------------------------------------------------------ 12:08:41 [INFO] Total time: 10.475 s 12:08:41 [INFO] Finished at: 2024-08-29T12:08:40+08:00 12:08:41 [INFO] ------------------------------------------------------------------------ 12:08:41 [ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.19.0:deploy (default-cli) on project mypaintshop_functions: deploy to Function App with resource creation or updating: Status code 401, (empty body) -> [Help 1] 12:08:41 [ERROR] 12:08:41 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 12:08:41 [ERROR] Re-run Maven using the -X switch to enable full debug logging. 12:08:41 [ERROR] 12:08:41 [ERROR] For more information about the errors and possible solutions, please read the following articles: 12:08:41 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException