I am trying to deploy my spring app to an Azure Spring apps instance. I was able to deploy this app using the azure-spring-apps-maven-plugin in January, however I am now getting errors when attempting to deploy using the azure-spring-apps-maven-plugin, the az cli tool, and the AzureSpringCloud@0 task via Azure Pipelines. I would greatly appreciate if anyone can provide input on this issue.
Attempt #1 - Using azure-spring-apps-maven-plugin
- Ran mvn com.microsoft.azure:azure-spring-apps-maven-plugin:config
- Ran mvn clean package
- Ran mvn com.microsoft.azure:azure-spring-apps-maven-plugin:deploy
Result:
The app deployment starts updating then hangs for about 4 minutes and times out with error "Failed to execute goal com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:deploy (default-cli) on project app: update Azure Spring App deployment (default): Long running operation is Failed or Cancelled."
Attempt #2 - Az cli tool
- Ran the following command
az spring app deploy \
--resource-group <name-of-resource-group> \
--service <service-instance-name> \
--name <app-name> \
--artifact-path target/<jar-name>
Result:
Error "App <app-name> not found". I have verified that the app name is correct and that the app exists.
Attempt #3 - Azure Pipelines
- Created a new pipeline that deploys using AzureSpringCloud@0
- Ran the pipeline
- task: AzureSpringCloud@0
inputs:
azureSubscription: '<subscription-name>(<subscription-id>)'
Action: 'Deploy'
AzureSpringCloud: '/subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.AppPlatform/Spring/<spring-apps-instance-name>'
AppName: '<app-name>'
UseStagingDeployment: false
DeploymentName: 'default'
Package: '$(System.DefaultWorkingDirectory)/target/*.jar'
Result:
Build succeeds, jar file is uploaded and app deployment begins. The task then hangs for 4 mins and exits with error:
##[error]Deployment Failed with Error: {}
##[error]Operation failed: 400 Bad Request
Logs show that the task is waiting for the deployment to finish
##[debug]App update initiated.
##[debug]Awaiting operation completion.
##[debug]App update initiated.
##[debug]Awaiting operation completion.
##[debug]Checking operation status at https://management.azure.com/subscriptions/56356497-c923-4ddf-b48e-0f443e320c21/resourceGroups/rg-hauberk-spring-apps/providers/Microsoft.AppPlatform/locations/eastus/operationResults/34a7de25-9e0b-4365-8224-11bf83fed2dc/Spring/default?api-version=2022-03-01-preview
##[debug]Sending GET request to https://management.azure.com/subscriptions/56356497-c923-4ddf-b48e-0f443e320c21/resourceGroups/rg-hauberk-spring-apps/providers/Microsoft.AppPlatform/locations/eastus/operationResults/34a7de25-9e0b-4365-8224-11bf83fed2dc/Spring/default?api-version=2022-03-01-preview
##[debug][GET]https://management.azure.com/subscriptions/56356497-c923-4ddf-b48e-0f443e320c21/resourceGroups/rg-hauberk-spring-apps/providers/Microsoft.AppPlatform/locations/eastus/operationResults/34a7de25-9e0b-4365-8224-11bf83fed2dc/Spring/default?api-version=2022-03-01-preview
##[debug]Correlation ID from ARM api call response : d2c51988-d91c-4365-99d6-aa468c568f3d
##[debug]https://management.azure.com/subscriptions/56356497-c923-4ddf-b48e-0f443e320c21/resourceGroups/rg-hauberk-spring-apps/providers/Microsoft.AppPlatform/locations/eastus/operationResults/34a7de25-9e0b-4365-8224-11bf83fed2dc/Spring/default?api-version=2022-03-01-preview ==> https://management.azure.com/subscriptions/56356497-c923-4ddf-b48e-0f443e320c21/resourceGroups/rg-hauberk-spring-apps/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/default/operationId/34a7de25-9e0b-4365-8224-11bf83fed2dc?api-version=2022-03-01-preview
##[debug]202: Accepted
The task continues to poll this endpoint until it receives a 400 response:
##[debug]400: Bad Request
##[debug]Error in awaiting operation completion
##[error]Deployment Failed with Error: {}
##[debug]Processed: ##vso[task.issue type=error;]Deployment Failed with Error: {}
##[debug]task result: Failed
##[error]Operation failed: 400 Bad Request
##[debug]Processed: ##vso[task.issue type=error;]Operation failed: 400 Bad Request
##[debug]Processed: ##vso[task.complete result=Failed;]Operation failed: 400 Bad Request
During attempts 1&3, it appears as it the .jar is uploaded and deployment begins. The process then hangs for 4 minutes until it times out because the deployment never completes.
Solutions I have tried:
- Creating a new spring project and trying to deploy it (same outcome)
- Re-creating the Azure Spring Apps instance (same outcome)
- Downgrading the app's java version (17->11) (same outcome)