microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.49k stars 2.61k forks source link

[BUG]: Java 21 deployment doesn't work on AzureSpringCloud@0 #19609

Open peeteto opened 7 months ago

peeteto commented 7 months ago

New issue checklist

Task name

Azure Spring Apps

Task version

0.234.0

Issue Description

Azure spring apps documentation stated the following: https://learn.microsoft.com/en-us/azure/spring-apps/enterprise/concept-app-customer-responsibilities#java-runtime-version "You can choose any LTS Java version as the major version that's officially supported and receives regular updates."

They also made java 21 version available on Azure Spring Apps image

But whenever we deploy our application, which uses java 21 as runtime at Azure Portal

            - task: AzureSpringCloud@0
              name: DeployToPrd
              inputs:
                azureSubscription: 'azure_subscription'
                Action: 'Deploy'
                AzureSpringCloud: 'azure_app_definition'
                AppName: 'app-name'
                RuntimeVersion: 'Java_21' # This property doesn't matter. If you pass 'Java_11' or even nothing, as long as the Azure Spring App is set to java 21, the deployment will not succeed
                UseStagingDeployment: false
                DeploymentName: 'default'
                Package: '$(System.ArtifactsDirectory)/*.jar'

It gives the following error

{
  "error": {
    "code": "BadArgument",
    "message": "Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
    "target": null,
    "details": [
      {
        "code": "BadArgument",
        "message": "properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
        "target": "properties.source.runtimeVersion",
        "details": null
      }
    ]
  }
}

We just migrated most of our projects to java21, so this issue is very unfortunate..

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04.4

Relevant log output

{
  "error": {
    "code": "BadArgument",
    "message": "Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
    "target": null,
    "details": [
      {
        "code": "BadArgument",
        "message": "properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
        "target": "properties.source.runtimeVersion",
        "details": null
      }
    ]
  }
}

Full task logs with system.debug enabled

 
2024-03-06T11:52:10.6281963Z ##[debug]Evaluating condition for step: 'DeployToPrd'
2024-03-06T11:52:10.6282856Z ##[debug]Evaluating: SucceededNode()
2024-03-06T11:52:10.6283110Z ##[debug]Evaluating SucceededNode:
2024-03-06T11:52:10.6283569Z ##[debug]=> True
2024-03-06T11:52:10.6283829Z ##[debug]Result: True
2024-03-06T11:52:10.6284100Z ##[section]Starting: DeployToPrd
2024-03-06T11:52:10.6289608Z ==============================================================================
2024-03-06T11:52:10.6289756Z Task         : Azure Spring Apps
2024-03-06T11:52:10.6289833Z Description  : Deploy applications to Azure Spring Apps and manage deployments.
2024-03-06T11:52:10.6289963Z Version      : 0.234.0
2024-03-06T11:52:10.6290047Z Author       : Microsoft Corporation
2024-03-06T11:52:10.6290128Z Help         : https://learn.microsoft.com/en-gb/azure/devops/pipelines/tasks/reference/azure-spring-cloud-v0?view=azure-pipelines
2024-03-06T11:52:10.6290280Z ==============================================================================
2024-03-06T11:52:10.7912608Z ##[debug]Using node path: /home/vsts/agents/3.236.0/externals/node16/bin/node
2024-03-06T11:52:11.0165889Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2024-03-06T11:52:11.0173472Z ##[debug]loading inputs and endpoints
2024-03-06T11:52:11.0177443Z ##[debug]loading INPUT_CONNECTEDSERVICENAME
2024-03-06T11:52:11.0187795Z ##[debug]loading INPUT_ACTION
2024-03-06T11:52:11.0189367Z ##[debug]loading INPUT_AZURESPRINGCLOUD
2024-03-06T11:52:11.0190798Z ##[debug]loading INPUT_APPNAME
2024-03-06T11:52:11.0192685Z ##[debug]loading INPUT_DEPLOYMENTTYPE
2024-03-06T11:52:11.0194179Z ##[debug]loading INPUT_USESTAGINGDEPLOYMENT
2024-03-06T11:52:11.0196648Z ##[debug]loading INPUT_CREATENEWDEPLOYMENT
2024-03-06T11:52:11.0198799Z ##[debug]loading INPUT_DEPLOYMENTNAME
2024-03-06T11:52:11.0200220Z ##[debug]loading INPUT_PACKAGE
2024-03-06T11:52:11.0202500Z ##[debug]loading INPUT_REGISTRYSERVER
2024-03-06T11:52:11.0204755Z ##[debug]loading INPUT_IMAGENAME
2024-03-06T11:52:11.0207601Z ##[debug]loading INPUT_ENVIRONMENTVARIABLES
2024-03-06T11:52:11.0209892Z ##[debug]loading INPUT_RUNTIMEVERSION
2024-03-06T11:52:11.0211933Z ##[debug]loading ENDPOINT_AUTH_42da1d61-80e0-4dd5-b434-557d95cf4a5e
2024-03-06T11:52:11.0213045Z ##[debug]loading ENDPOINT_AUTH_SCHEME_42da1d61-80e0-4dd5-b434-557d95cf4a5e
2024-03-06T11:52:11.0214448Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_42da1d61-80e0-4dd5-b434-557d95cf4a5e_AUTHENTICATIONTYPE
2024-03-06T11:52:11.0215789Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_42da1d61-80e0-4dd5-b434-557d95cf4a5e_TENANTID
2024-03-06T11:52:11.0217110Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_42da1d61-80e0-4dd5-b434-557d95cf4a5e_SERVICEPRINCIPALID
2024-03-06T11:52:11.0218154Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_42da1d61-80e0-4dd5-b434-557d95cf4a5e_SERVICEPRINCIPALKEY
2024-03-06T11:52:11.0219730Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2024-03-06T11:52:11.0222067Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2024-03-06T11:52:11.0223428Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2024-03-06T11:52:11.0226678Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2024-03-06T11:52:11.0228176Z ##[debug]loaded 23
2024-03-06T11:52:11.0232929Z ##[debug]Agent.ProxyUrl=undefined
2024-03-06T11:52:11.0234109Z ##[debug]Agent.CAInfo=undefined
2024-03-06T11:52:11.0234497Z ##[debug]Agent.ClientCert=undefined
2024-03-06T11:52:11.0234885Z ##[debug]Agent.SkipCertValidation=undefined
2024-03-06T11:52:11.1214699Z ##[debug]agent.proxyurl=undefined
2024-03-06T11:52:11.1215591Z ##[debug]VSTS_ARM_REST_IGNORE_SSL_ERRORS=undefined
2024-03-06T11:52:11.1216127Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_855c60dd-563a-430b-8bcb-3c01f0b51d25_build_87_0
2024-03-06T11:52:11.1243218Z ##[debug]check path : /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.1245501Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.1246437Z ##[debug]system.culture=en-US
2024-03-06T11:52:11.1266684Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3521883Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3525118Z ##[debug]Agent.TempDirectory=/home/vsts/work/_temp
2024-03-06T11:52:11.3527258Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3709436Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3712757Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3720035Z Starting deployment task execution
2024-03-06T11:52:11.3723652Z ##[debug]check path : /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/task.json
2024-03-06T11:52:11.3726364Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/task.json
2024-03-06T11:52:11.3728091Z ##[debug]system.culture=en-US
2024-03-06T11:52:11.3768494Z ##[warning]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3775830Z ##[debug]Processed: ##vso[task.issue type=warning;]Resource file has already set to: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-03-06T11:52:11.3778122Z ##[debug]check path : /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-webdeployment-common/module.json
2024-03-06T11:52:11.3778752Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureSpringCloud_5679292e-de0e-473a-948e-4874d2d8ef97/0.234.0/node_modules/azure-pipelines-tasks-webdeployment-common/module.json
2024-03-06T11:52:11.3779235Z ##[debug]system.culture=en-US
2024-03-06T11:52:11.3779709Z global['_vsts_task_lib_loaded'] = true
2024-03-06T11:52:11.3779875Z Started getParameters
2024-03-06T11:52:11.3780102Z global['_vsts_task_lib_loaded'] = true
2024-03-06T11:52:11.3780434Z ##[debug]ConnectedServiceName=42da1d61-80e0-4dd5-b434-557d95cf4a5e
2024-03-06T11:52:11.3780936Z ##[debug]AzureSpringCloud=/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu
2024-03-06T11:52:11.3781388Z ##[debug]Action=Deploy
2024-03-06T11:52:11.3781720Z ##[debug]AppName=admin-service
2024-03-06T11:52:11.3782045Z ##[debug]DeploymentType=Artifacts
2024-03-06T11:52:11.3782393Z ##[debug]UseStagingDeployment=false
2024-03-06T11:52:11.3782727Z ##[debug]CreateNewDeployment=false
2024-03-06T11:52:11.3783048Z ##[debug]Action=Deploy
2024-03-06T11:52:11.3783380Z ##[debug]UseStagingDeployment=false
2024-03-06T11:52:11.3783706Z ##[debug]DeploymentName=default
2024-03-06T11:52:11.3784346Z ##[debug]EnvironmentVariables=-spring.profiles.active prd
2024-03-06T11:52:11.3784693Z ##[debug]JvmOptions=undefined
2024-03-06T11:52:11.3785030Z ##[debug]RuntimeVersion=Java_21
2024-03-06T11:52:11.3785376Z ##[debug]DotNetCoreMainEntryPath=undefined
2024-03-06T11:52:11.3785721Z ##[debug]Version=undefined
2024-03-06T11:52:11.3786035Z ##[debug]Builder=undefined
2024-03-06T11:52:11.3786355Z ##[debug]RegistryServer=docker.io
2024-03-06T11:52:11.3786819Z ##[debug]RegistryUsername=undefined
2024-03-06T11:52:11.3787165Z ##[debug]RegistryPassword=undefined
2024-03-06T11:52:11.3787539Z ##[debug]ImageName=hello-world:v1
2024-03-06T11:52:11.3787876Z ##[debug]ImageCommand=undefined
2024-03-06T11:52:11.3788210Z ##[debug]ImageArgs=undefined
2024-03-06T11:52:11.3788542Z ##[debug]ImageLanguageFramework=undefined
2024-03-06T11:52:11.3789410Z ##[debug]Package=/home/vsts/work/1/a/*.jar
2024-03-06T11:52:11.3789774Z ##[debug]Finding files matching input: /home/vsts/work/1/a/*.jar
2024-03-06T11:52:11.3790164Z ##[debug]Matching glob pattern: /home/vsts/work/1/a/*.jar
2024-03-06T11:52:11.3790515Z ##[debug]Index of first wildcard: 20
2024-03-06T11:52:11.3790868Z ##[debug]find root dir: /home/vsts/work/1/a/
2024-03-06T11:52:11.3791206Z ##[debug]findPath: '/home/vsts/work/1/a/'
2024-03-06T11:52:11.3791558Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
2024-03-06T11:52:11.3791940Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2024-03-06T11:52:11.3792629Z ##[debug]findOptions.followSymbolicLinks: 'true'
2024-03-06T11:52:11.3793002Z ##[debug]findOptions.skipMissingFiles: 'false'
2024-03-06T11:52:11.3793345Z ##[debug]  /home/vsts/work/1/a/ (directory)
2024-03-06T11:52:11.3794023Z ##[debug]  /home/vsts/work/1/a/admin-service-1.0.0-SNAPSHOT.jar (file)
2024-03-06T11:52:11.3794372Z ##[debug]2 results
2024-03-06T11:52:11.3795195Z ##[debug]patternRoot: ''
2024-03-06T11:52:11.3797795Z ##[debug]matchOptions.debug: 'undefined'
2024-03-06T11:52:11.3799338Z ##[debug]matchOptions.nobrace: 'undefined'
2024-03-06T11:52:11.3799914Z ##[debug]matchOptions.noglobstar: 'undefined'
2024-03-06T11:52:11.3801058Z ##[debug]matchOptions.dot: 'undefined'
2024-03-06T11:52:11.3801527Z ##[debug]matchOptions.noext: 'undefined'
2024-03-06T11:52:11.3801942Z ##[debug]matchOptions.nocase: 'false'
2024-03-06T11:52:11.3802336Z ##[debug]matchOptions.nonull: 'undefined'
2024-03-06T11:52:11.3802732Z ##[debug]matchOptions.matchBase: 'true'
2024-03-06T11:52:11.3803145Z ##[debug]matchOptions.nocomment: 'undefined'
2024-03-06T11:52:11.3803568Z ##[debug]matchOptions.nonegate: 'undefined'
2024-03-06T11:52:11.3803983Z ##[debug]matchOptions.flipNegate: 'undefined'
2024-03-06T11:52:11.3804418Z ##[debug]pattern: '/home/vsts/work/1/a/*.jar'
2024-03-06T11:52:11.3804792Z ##[debug]expanding braces
2024-03-06T11:52:11.3805187Z ##[debug]applying include pattern against original list
2024-03-06T11:52:11.3816079Z ##[debug]1 matches
2024-03-06T11:52:11.3816604Z ##[debug]1 final results
2024-03-06T11:52:11.3817680Z ##[debug]Task parameters: {"ConnectedServiceName":"42da1d61-80e0-4dd5-b434-557d95cf4a5e","AzureSpringApps":"/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu","Action":"Deploy","AppName":"admin-service","DeploymentType":"Artifacts","UseStagingDeployment":false,"CreateNewDeployment":false,"DeploymentName":"default","EnvironmentVariables":"-spring.profiles.active prd","RuntimeVersion":"Java_21","RegistryServer":"docker.io","ImageName":"hello-world:v1","Package":{"_path":"/home/vsts/work/1/a/admin-service-1.0.0-SNAPSHOT.jar"}}
2024-03-06T11:52:11.3906794Z ##[debug]Pre-deployment Step Started
2024-03-06T11:52:11.3907176Z ##[debug]USE_MSAL=true
2024-03-06T11:52:11.3907526Z ##[debug]MSAL - USE_MSAL override is found: true
2024-03-06T11:52:11.3907908Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth scheme = ServicePrincipal
2024-03-06T11:52:11.3908351Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data subscriptionid = c737beed-c80c-4b61-9d6a-147d4d913d32
2024-03-06T11:52:11.3909060Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data subscriptionname = application-prod
2024-03-06T11:52:11.3909930Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth param serviceprincipalid = ***
2024-03-06T11:52:11.3910399Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data activeDirectoryAuthority = https://login.microsoftonline.com/
2024-03-06T11:52:11.3910855Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth param tenantid = 54b32463-5bef-4521-80dd-22552509dfe0
2024-03-06T11:52:11.3911407Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e=https://management.azure.com/
2024-03-06T11:52:11.3911812Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data environment = AzureCloud
2024-03-06T11:52:11.3912224Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth scheme = ServicePrincipal
2024-03-06T11:52:11.3912622Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data msiclientId = undefined
2024-03-06T11:52:11.3913076Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
2024-03-06T11:52:11.3913747Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data AzureKeyVaultServiceEndpointResourceId = https://vault.azure.net
2024-03-06T11:52:11.3914220Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data AzureKeyVaultDnsSuffix = vault.azure.net
2024-03-06T11:52:11.3914633Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data ScopeLevel = Subscription
2024-03-06T11:52:11.3915045Z ##[debug]MSAL - getEndpoint - useGraphActiveDirectoryResource=false
2024-03-06T11:52:11.3915410Z ##[debug]MSAL - getEndpoint - useMSAL=true
2024-03-06T11:52:11.3916306Z ##[debug]MSAL - getEndpoint - endpoint={"subscriptionID":"c737beed-c80c-4b61-9d6a-147d4d913d32","subscriptionName":"application-prod","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"54b32463-5bef-4521-80dd-22552509dfe0","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.core.windows.net/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription"}
2024-03-06T11:52:11.3917173Z ##[debug]MSAL - getEndpoint - connectedServiceName=42da1d61-80e0-4dd5-b434-557d95cf4a5e
2024-03-06T11:52:11.3917588Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth param authenticationType = spnKey
2024-03-06T11:52:11.3917971Z ##[debug]credentials spn endpoint
2024-03-06T11:52:11.3918479Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth param serviceprincipalkey = ***
2024-03-06T11:52:11.3918920Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e data EnableAdfsAuthentication = false
2024-03-06T11:52:11.3919330Z ##[debug]42da1d61-80e0-4dd5-b434-557d95cf4a5e auth param apitoken = undefined
2024-03-06T11:52:11.3920972Z ##[debug]{"subscriptionID":"c737beed-c80c-4b61-9d6a-147d4d913d32","subscriptionName":"application-prod","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"54b32463-5bef-4521-80dd-22552509dfe0","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.azure.com/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription","authenticationType":"spnKey","servicePrincipalKey":***,"isADFSEnabled":false,"applicationTokenCredentials":{"connectedServiceName":"42da1d61-80e0-4dd5-b434-557d95cf4a5e","clientId":"***","tenantId":"54b32463-5bef-4521-80dd-22552509dfe0","baseUrl":"https://management.azure.com/","authorityUrl":"https://login.microsoftonline.com/","activeDirectoryResourceId":"https://management.azure.com/","isAzureStackEnvironment":false,"authType":"spnKey","secret":***,"isADFSEnabled":false,"useMSAL":true,"tokenMutex":{"_semaphore":{"_value":1,"_cancelError":{},"_weightedQueues":[],"_weightedWaiters":[]}}}}
2024-03-06T11:52:11.3922314Z ##[debug]Initializeing service client
2024-03-06T11:52:11.3922788Z ##[debug]Finished initializeing service client
2024-03-06T11:52:11.3923127Z ##[debug]Deployment Step Started
2024-03-06T11:52:11.3923466Z ##[debug]Deployment action
2024-03-06T11:52:11.3923785Z ##[debug]This is jar package 
2024-03-06T11:52:11.3924111Z ##[debug]Deploying with specified name.
2024-03-06T11:52:11.3924478Z ##[debug]Finding deployments for app admin-service
2024-03-06T11:52:11.3925028Z ##[debug]Sending GET request to https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments?api-version=2022-03-01-preview
2024-03-06T11:52:11.3925676Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-03-06T11:52:11.3926032Z ##[debug]agent.proxyurl=undefined
2024-03-06T11:52:11.3926367Z ##[debug]agent.proxybypasslist=undefined
2024-03-06T11:52:11.3926722Z ##[debug]MSAL - ServicePrincipal - clientSecret is used.
2024-03-06T11:52:11.3927163Z ##[debug][Wed, 06 Mar 2024 11:52:11 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-03-06T11:52:12.1000140Z ##[debug]MSAL - retrieved token - isFromCache?: false
2024-03-06T11:52:12.1001792Z ##[debug]CLIENT_RESETSTREAMONRETRY=undefined
2024-03-06T11:52:12.1002728Z ##[debug][GET]https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments?api-version=2022-03-01-preview
2024-03-06T11:52:12.4308247Z ##[debug]Agent environment resources - Disk: / Available 19195.00 MB out of 74244.00 MB, Memory: Used 612.00 MB out of 6921.00 MB, CPU: Usage 47.68%
2024-03-06T11:52:12.5040974Z ##[debug]Correlation ID from ARM api call response : 7ec4d12d-3465-4839-bc36-2adc92ab4232
2024-03-06T11:52:12.5042057Z ##[debug]Found deployments.
2024-03-06T11:52:12.5053955Z ##[debug]Found deployment names: default
2024-03-06T11:52:12.5055638Z ##[debug]Obtaining the current service and its properties
2024-03-06T11:52:12.5056539Z ##[debug]Sending GET request to https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu?api-version=2022-03-01-preview
2024-03-06T11:52:12.5057462Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-03-06T11:52:12.5058312Z ##[debug][Wed, 06 Mar 2024 11:52:12 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-03-06T11:52:12.5073948Z ##[debug]MSAL - retrieved token - isFromCache?: true
2024-03-06T11:52:12.5074857Z ##[debug]CLIENT_RESETSTREAMONRETRY=undefined
2024-03-06T11:52:12.5075742Z ##[debug][GET]https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu?api-version=2022-03-01-preview
2024-03-06T11:52:12.7775905Z ##[debug]Correlation ID from ARM api call response : 1de988de-fbaa-486b-a71a-70531411a938
2024-03-06T11:52:12.7777019Z ##[debug]Service information obtained
2024-03-06T11:52:12.7777772Z ##[debug]Service sku obtained
2024-03-06T11:52:12.7778584Z ##[debug]Starting deployment.
2024-03-06T11:52:12.7781998Z ##[debug]Obtaining upload target.
2024-03-06T11:52:12.7782816Z ##[debug]Sending POST request to https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/getResourceUploadUrl?api-version=2022-03-01-preview
2024-03-06T11:52:12.7818226Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-03-06T11:52:12.7822733Z ##[debug][Wed, 06 Mar 2024 11:52:12 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-03-06T11:52:12.7823270Z ##[debug]MSAL - retrieved token - isFromCache?: true
2024-03-06T11:52:12.7823685Z ##[debug]CLIENT_RESETSTREAMONRETRY=undefined
2024-03-06T11:52:12.7824666Z ##[debug][POST]https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/getResourceUploadUrl?api-version=2022-03-01-preview
2024-03-06T11:52:13.3536034Z ##[debug]Correlation ID from ARM api call response : 70ac90e1-f6bf-4460-a768-bdd6adb8b06d
2024-03-06T11:52:13.3539602Z ##[debug]uploading file to URL: https://8e463b3deefe4d8f849004ea.file.core.windows.net/e5ae6c1e458e440f8fe90b5663678ae9/resources/50a246683dae4198bd6f207983ec0d59ebd95f33baddd73b86ef4000137b8491-2024030611-fdb0667c-b4b9-4d81-9578-88bcb6609f27?sv=2020-08-04&se=2024-03-06T13%3A52%3A13Z&sr=f&sp=w&sig=kNO3C58mJmwUbGnpOQyxJ2mBh7TwtZHd8Oh73Ya%2FKkw%3D
2024-03-06T11:52:13.3570993Z Starting upload of /home/vsts/work/1/a/admin-service-1.0.0-SNAPSHOT.jar
2024-03-06T11:52:13.6902380Z { loadedBytes: 4194304 }
2024-03-06T11:52:13.6954742Z { loadedBytes: 8388608 }
2024-03-06T11:52:13.7084247Z { loadedBytes: 12582912 }
2024-03-06T11:52:13.7291083Z { loadedBytes: 16777216 }
2024-03-06T11:52:13.7324131Z { loadedBytes: 20971520 }
2024-03-06T11:52:13.8595002Z { loadedBytes: 25165824 }
2024-03-06T11:52:13.8745340Z { loadedBytes: 29360128 }
2024-03-06T11:52:13.8939833Z { loadedBytes: 33554432 }
2024-03-06T11:52:13.9088589Z { loadedBytes: 37748736 }
2024-03-06T11:52:13.9345781Z { loadedBytes: 41943040 }
2024-03-06T11:52:13.9657278Z { loadedBytes: 46137344 }
2024-03-06T11:52:13.9920224Z { loadedBytes: 50331648 }
2024-03-06T11:52:14.0134491Z { loadedBytes: 52508535 }
2024-03-06T11:52:14.0536792Z { loadedBytes: 56702839 }
2024-03-06T11:52:14.0540261Z Upload of /home/vsts/work/1/a/admin-service-1.0.0-SNAPSHOT.jar completed.
2024-03-06T11:52:14.0543320Z ##[debug]Environment variables modified.
2024-03-06T11:52:14.0544078Z ##[debug]Environment Variables: {"spring.profiles.active":"prd"}
2024-03-06T11:52:14.0546936Z Updating admin-service, deployment default...
2024-03-06T11:52:14.0547847Z ##[debug]Query deployment default for app admin-service
2024-03-06T11:52:14.0549045Z ##[debug]Sending GET request to https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments/default?api-version=2022-03-01-preview
2024-03-06T11:52:14.0550103Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-03-06T11:52:14.0553092Z ##[debug][Wed, 06 Mar 2024 11:52:14 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-03-06T11:52:14.0570469Z ##[debug]MSAL - retrieved token - isFromCache?: true
2024-03-06T11:52:14.0571263Z ##[debug]CLIENT_RESETSTREAMONRETRY=undefined
2024-03-06T11:52:14.0574386Z ##[debug][GET]https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments/default?api-version=2022-03-01-preview
2024-03-06T11:52:14.3795388Z ##[debug]Correlation ID from ARM api call response : 77ad3c45-1ea9-485a-ad20-bf1f4cc5bfa0
2024-03-06T11:52:14.3796120Z ##[debug]Found deployment ${deploymentName} for app ${appName}.
2024-03-06T11:52:14.3797538Z ##[debug]Sending PATCH request to https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments/default?api-version=2022-03-01-preview
2024-03-06T11:52:14.3801457Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-03-06T11:52:14.3802284Z ##[debug][Wed, 06 Mar 2024 11:52:14 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-03-06T11:52:14.3809373Z ##[debug]MSAL - retrieved token - isFromCache?: true
2024-03-06T11:52:14.3810076Z ##[debug]CLIENT_RESETSTREAMONRETRY=undefined
2024-03-06T11:52:14.3811234Z ##[debug][PATCH]https://management.azure.com/subscriptions/c737beed-c80c-4b61-9d6a-147d4d913d32/resourceGroups/rg-strouwi-prod-northeu/providers/Microsoft.AppPlatform/Spring/sapp-strouwi-prod-northeu/apps/admin-service/deployments/default?api-version=2022-03-01-preview
2024-03-06T11:52:14.9497771Z ##[debug]Correlation ID from ARM api call response : 59b65da5-71d5-49e6-920a-95b069ffa2e2
2024-03-06T11:52:14.9498199Z {
2024-03-06T11:52:14.9498355Z   "error": {
2024-03-06T11:52:14.9498529Z     "code": "BadArgument",
2024-03-06T11:52:14.9499209Z     "message": "Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
2024-03-06T11:52:14.9499477Z     "target": null,
2024-03-06T11:52:14.9499646Z     "details": [
2024-03-06T11:52:14.9499801Z       {
2024-03-06T11:52:14.9499948Z         "code": "BadArgument",
2024-03-06T11:52:14.9500211Z         "message": "properties.source.runtimeVersion with value Java_21 is not supported for type Jar",
2024-03-06T11:52:14.9500494Z         "target": "properties.source.runtimeVersion",
2024-03-06T11:52:14.9500683Z         "details": null
2024-03-06T11:52:14.9500855Z       }
2024-03-06T11:52:14.9500998Z     ]
2024-03-06T11:52:14.9501155Z   }
2024-03-06T11:52:14.9501296Z }
2024-03-06T11:52:14.9512367Z Status Code: 400
2024-03-06T11:52:14.9512566Z Bad Request
2024-03-06T11:52:14.9514150Z ##[debug]Processed: ##vso[task.logissue type=error;code=BadArgument;]
2024-03-06T11:52:14.9515226Z ##[error]Deployment Failed with Error: {"statusCode":400,"message":"Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar","code":"BadArgument","details":[{"code":"BadArgument","message":"properties.source.runtimeVersion with value Java_21 is not supported for type Jar","target":"properties.source.runtimeVersion","details":null}]}
2024-03-06T11:52:14.9516214Z ##[debug]Processed: ##vso[task.issue type=error;]Deployment Failed with Error: {"statusCode":400,"message":"Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar","code":"BadArgument","details":[{"code":"BadArgument","message":"properties.source.runtimeVersion with value Java_21 is not supported for type Jar","target":"properties.source.runtimeVersion","details":null}]}
2024-03-06T11:52:14.9517271Z ##[debug]task result: Failed
2024-03-06T11:52:14.9517776Z ##[error]Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar
2024-03-06T11:52:14.9518477Z ##[debug]Processed: ##vso[task.issue type=error;]Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar
2024-03-06T11:52:14.9529588Z ##[debug]Processed: ##vso[task.complete result=Failed;]Invalid arguments: properties.source.runtimeVersion with value Java_21 is not supported for type Jar
2024-03-06T11:52:14.9643520Z ##[section]Finishing: DeployToPrd
 

Repro steps

- task: AzureSpringCloud@0
              name: DeployToPrd
              inputs:
                azureSubscription: 'azure_subscription'
                Action: 'Deploy'
                AzureSpringCloud: 'azure_app_definition'
                AppName: 'app-name'
                RuntimeVersion: 'Java_21' # This property doesn't matter. If you pass 'Java_11' or even nothing, as long as the Azure Spring App is set to java 21, the deployment will not succeed
                UseStagingDeployment: false
                DeploymentName: 'default'
                Package: '$(System.ArtifactsDirectory)/*.jar'
holyhoehle commented 7 months ago

Same here.

As a workaround you could use the AzureCLI@2 task instead. Like so:

- task: AzureCLI@2
  inputs:
    azureSubscription: 'My Sub'
    scriptType: 'pscore'
    scriptLocation: 'inlineScript'
    inlineScript: 'az spring app deploy -s my-spring-app -g my-resourcegroup -n my-app --artifact-path "$(Pipeline.Workspace)/drop_xyz/my-app.jar"'

A quick test looked good so far.

qianz2 commented 6 months ago

Thanks for reporting this! We're working on making java runtime 17 and 21 available for AzureSpringCloudV0 task.

peeteto commented 6 months ago

Hey, And is there any timeframe ?

peeteto commented 6 months ago

@hol

Same here.

As a workaround you could use the AzureCLI@2 task instead. Like so:

- task: AzureCLI@2
  inputs:
    azureSubscription: 'My Sub'
    scriptType: 'pscore'
    scriptLocation: 'inlineScript'
    inlineScript: 'az spring app deploy -s my-spring-app -g my-resourcegroup -n my-app --artifact-path "$(Pipeline.Workspace)/drop_xyz/my-app.jar"'

A quick test looked good so far.

This worked indeed! With the spring cloud task I had also issue with passing environment variables, using the az cli this is also fixed. Great!