microsoft / NubesGen

Going to production on Azure is only one `git push` away
https://nubesgen.com
MIT License
301 stars 65 forks source link

[BUG] Bicep Azure Spring Cloud Bicep error: Java 17 not supported for type Jar #312

Open jimbethancourt opened 2 years ago

jimbethancourt commented 2 years ago

Describe the bug When attempting to execute an Azure Spring Cloud Bicep template, the following error message is generated and information about the deployment is not written to the console:

{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"Conflict","message":"{\r\n  \"status\": \"Failed\",\r\n  \"error\": {\r\n    \"code\": \"ResourceDeploymentFailure\",\r\n    \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"DeploymentFailed\",\r\n        \"message\": \"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.\",\r\n        \"details\": [\r\n          {\r\n            \"code\": \"BadRequest\",\r\n            \"message\": \"{\\r\\n  \\\"error\\\": {\\r\\n    \\\"code\\\": \\\"BadArgument\\\",\\r\\n    \\\"message\\\": \\\"Invalid arguments: properties.source.runtimeVersion with value Java_17 is not supported for type Jar\\\",\\r\\n    \\\"target\\\": null,\\r\\n    \\\"details\\\": [\\r\\n      {\\r\\n        \\\"code\\\": \\\"BadArgument\\\",\\r\\n        \\\"message\\\": \\\"properties.source.runtimeVersion with value Java_17 is not supported for type Jar\\\",\\r\\n        \\\"target\\\": \\\"properties.source.runtimeVersion\\\",\\r\\n        \\\"details\\\": null\\r\\n      }\\r\\n    ]\\r\\n  }\\r\\n}\"\r\n          }\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}"}]}}

Also seeing the message in the output immediately after the command is issued:

C:\Code\myproj\bicep\modules\spring-cloud\spring-cloud.bicep(65,23) : Warning BCP036: The property "runtimeVersion" expected a value of type "'Java_11' | 'Java_8' | 'NetCore_31' | null" but the provided value is of type "'Java_17 '". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues] C:\Code\myproj\bicep\modules\application-insights\app-insights.bicep(29,21) : Warning BCP036: The property "Application_Type" expected a value of type "'other' | 'web'" but the provided value is of type "'java'". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]

I'm not sure if this is an issue with NubesGen, Bicep, or Azure Spring Cloud. I've previously created an Azure Spring Cloud instance with Java 17 by hand, but this is my first time to create it with Bicep.

An Azure Spring Cloud instance is created along with an application, but the application is in an invalid state.

To Reproduce Steps to reproduce the behavior: On nubesgen.com:

  1. Specify Bicep template
  2. Select Application Type: Spring Boot Application
  3. Select App size: Basic
  4. Select Database: Azure SQL Database / Serverless
  5. Check Application Insights
  6. Download the Bicep templates
  7. run the command
    az deployment sub create --name 'demo{environment}' --location eastus --template-file main.bicep

Expected behavior Information about the deployment should be generated

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context if Java_17 is changed to Java_11 in spring-cloud.bicep the deployment information is successfully generated

jimbethancourt commented 2 years ago

Noticed my local Bicep installation needs to be upgraded. Will upgrade and follow up.

jimbethancourt commented 2 years ago

Issue still happens after upgrading bicep locally.

cmaneu commented 2 years ago

Hi @jimbethancourt, Thanks for reporting that issue. I'll have a look at it.

cmaneu commented 2 years ago

There is a discrepancy between the bicep documentation and how the portal create things.

image