Giter VIP home page Giter VIP logo

spring-apps-deploy's Introduction

GitHub Action for deploying to Azure Spring Apps

GitHub Actions support an automated software development lifecycle workflow. With GitHub Actions for Azure Spring Apps you can create workflows in your repository to manage your deployment of Azure Spring Apps conveniently.

Prerequisites

Set up GitHub repository and authenticate

You need an Azure service principal credential to authorize Azure login action. To get an Azure credential, execute the following commands on your local machine:

az login
az ad sp create-for-rbac --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID> --sdk-auth

To access to a specific resource group, you can reduce the scope:

az ad sp create-for-rbac --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP> --sdk-auth

The command should output a JSON object:

{
  "clientId": "<GUID>",
  "clientSecret": "<GUID>",
  "subscriptionId": "<GUID>",
  "tenantId": "<GUID>",
  ...
}

Dependencies on other GitHub Actions

  • Checkout Checkout your Git repository content into GitHub Actions agent.
  • Authenticate using the Azure Login Action with the Azure service principal credential prepared as mentioned above. Examples are given later in this article.

End-to-End Sample Workflows

Deploying

To production

Azure Spring Apps supports deploying to deployments with built artifacts (e.g., JAR or .NET Core ZIP) or source code archive. The following example deploys to the default production deployment in Azure Spring Apps using JAR file built by Maven. This is the only possible deployment scenario when using the Basic SKU:

name: AzureSpringApps
on: push
env:
  ASC_PACKAGE_PATH: ${{ github.workspace }}
  AZURE_SUBSCRIPTION: <azure subscription id>

jobs:
  deploy_to_production:
    runs-on: ubuntu-latest
    name: deploy to production with artifact
    steps:
      - name: Checkout Github Action
        uses: actions/checkout@v2
        
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: maven build, clean
        run: |
          mvn clean package

      - name: Login via Azure CLI
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: deploy to production with artifact
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: Deploy
          service-name: <service instance name>
          app-name: <app name>
          use-staging-deployment: false
          package: ${{ env.ASC_PACKAGE_PATH }}/**/*.jar

The following example deploys to the default production deployment in Azure Spring Apps using source code.

name: AzureSpringApps
on: push
env:
  ASC_PACKAGE_PATH: ${{ github.workspace }}
  AZURE_SUBSCRIPTION: <azure subscription id>

jobs:
  deploy_to_production:
    runs-on: ubuntu-latest
    name: deploy to production with soruce code
    steps:
      - name: Checkout Github Action
        uses: actions/checkout@v2

      - name: Login via Azure CLI
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: deploy to production step with soruce code
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: deploy
          service-name: <service instance name>
          app-name: <app name>
          use-staging-deployment: false
          package: ${{ env.ASC_PACKAGE_PATH }}

Blue-green

The following examples deploy to an existing staging deployment. This deployment will not receive production traffic until it is set as a production deployment. You can set use-staging-deployment true to find the staging deployment automatically or just allocate specific deployment-name. We will only focus on the spring-apps-deploy action and leave out the preparatory jobs in the rest of the article.

# environment preparation configurations omitted
    steps:
      - name: blue green deploy step use-staging-deployment
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: deploy
          service-name: <service instance name>
          app-name: <app name>
          use-staging-deployment: true
          package: ${{ env.ASC_PACKAGE_PATH }}/**/*.jar
# environment preparation configurations omitted
    steps:
      - name: blue green deploy step with deployment-name
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: deploy
          service-name: <service instance name>
          app-name: <app name>
          deployment-name: staging
          package: ${{ env.ASC_PACKAGE_PATH }}/**/*.jar

For more information on blue-green deployments, including an alternative approach, see Blue-green deployment strategies.

Creating new deployment

The following example shows how to create a new staing deployment. CPU and memory can be allocated when creating new deployment.

# environment preparation configurations omitted
    steps:
      - name: blue green deploy step with deployment-name
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: deploy
          service-name: <service instance name>
          app-name: <app name>
          create-new-deployment: true
          deployment-name: staging
          cpu: <cpu>
          memory: <memory>
          package: ${{ env.ASC_PACKAGE_PATH }}/**/*.jar

Custom container image support

To deploy directly from a existing container image, use the following template.

# environment preparation configurations omitted
    steps:
      - name: Deploy custom container image
        uses: Azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: deploy
          service-name: <service instance name>
          app-name: <app name>
          deployment-name: <deployment name>
          container-registry: <container registry>
          registry-username: <registry username>
          registry-password: <registry password>
          container-image: <container image>

Setting production deployment

The following example will set the current staging deployment as production, effectively swapping which deployment will receive production traffic.

# environment preparation configurations omitted
    steps:
      - name: set production deployment step
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: set-production
          service-name: <service instance name>
          app-name: <app name>
          use-staging-deployment: true

Deleting a staging deployment

The "Delete Staging Deployment" action allows you to delete the deployment not receiving production traffic. This frees up resources used by that deployment and makes room for a new staging deployment:

# environment preparation configurations omitted
    steps:
      - name: Delete staging deployment step
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: delete-staging-deployment
          service-name: <service instance name>
          app-name: <app name>

Create or update build

The following example will create or update an build resource.

# environment preparation configurations omitted
    steps:
      - name: Create or update build
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: build
          service-name: <service instance name>
          build-name: <build name>
          package: ${{ env.ASC_PACKAGE_PATH }}
          builder: <builder>

Delete build

The following example will delete an build resource.

# environment preparation configurations omitted
    steps:
      - name: Delete build
        uses: azure/spring-apps-deploy@v1
        with:
          azure-subscription: ${{ env.AZURE_SUBSCRIPTION }}
          action: delete-build
          service-name: <service instance name>
          build-name: <build name>

Arguments

[!NOTE] Some arguments are only applicable for certain settings of the action argument. The Action column below specifies the pertinent actions for each argument. Any argument listed as Required is only required for the pertinent Action(s).

Argument
Action
Required Description
action all Required The action to be performed by this task.
One of: deploy, set-production, delete-staging-deployment, build, delete-build
Default value: deploy
azure-subscription all Required The Azure subscription ID for the target Azure Spring Apps instance.
service-name all Required The name of the Azure Spring Apps service instance.
app-name deploy
set-production
delete-staging-deployment
Optional The name of the Azure Spring Apps app to deploy. The app must exist prior to task execution.
use-staging-deployment deploy
set-production
Optional If set to true, apply the task to whichever deployment is set as the staging deployment at time of execution. If set to false, apply the task to the production deployment.
Default value: true
deployment-name deploy
set-production
Optional The name of the deployment to which the action will apply. It overrides the setting of use-staging-deployment.
create-new-deployment deploy Optional If set to true and the deployment specified by deployment-name does not exist at execution time, it will be created.
Default value: false
package deploy
build
Required The file path to the package containing the application to be deployed (.jar file for Java, .zip for .NET Core) or to a folder containing the application source to be built.
Default value: ${{ github.workspace }}/**/*.jar
target-module deploy Optional Child module to be deployed, required for multiple jar packages built from source code.
cpu deploy Optional The CPU resource quantity. It should be 500m or number of CPU cores. It is effective only when creating new deployment.
Default value: 1
memory deploy Optional The memory resource quantity. It should be 512Mi or #Gi, e.g., 1Gi, 3Gi. It is effective only when creating new deployment.
Default value: 1Gi
runtime-version deploy Optional The runtime stack for the application.
One of: Java_8, Java_11, NetCore_31,
Default value: Java_11
environment-variables deploy Optional Environment variables to be entered using the syntax '-key value'. Values containing spaces should be enclosed in double quotes.
Example: -CUSTOMER_NAME Contoso -WEBSITE_TIME_ZONE "Eastern Standard Time"
jvm-options deploy Optional A string containing JVM Options.
Example: -Dspring.profiles.active=mysql
dotnetcore-mainentry-path deploy Optional A string containing the path to the .NET executable relative to zip root.
version deploy Optional The deployment version. If not set, the version is left unchanged.
build-name build
delete-build
Optional (Enterprise Tier Only) The build name.
builder deploy
build
Optional (Enterprise Tier Only) Build service builder used to build the executable.
build-cpu deploy
build
Optional (Enterprise Tier Only) CPU resource quantity for build container. Should be 500m or number of CPU cores. Default: 1
build-memory deploy
build
Optional (Enterprise Tier Only) Memory resource quantity for build container. Should be 512Mi or #Gi, e.g., 1Gi, 3Gi. Default: 2Gi.
build-env deploy
build
Optional (Enterprise Tier Only) Space-separated environment variables for the build process using the syntax '-key value'.
Example: -CUSTOMER_NAME Contoso -WEBSITE_TIME_ZONE "Eastern Standard Time"
config-file-patterns deploy Optional (Enterprise Tier Only) Config file patterns separated with ',' to decide which patterns of Application Configuration Service will be used. Use '""' to clear existing configurations.
container-registry deploy Optional The registry of the container image.
Default value: docker.io
registry-username deploy Optional The username of the container registry.
registry-password deploy Optional The password of the container registry.
container-image deploy Optional The container image.
container-command deploy Optional The command of the container.
container-args deploy Optional The arguments of the container.
language-framework deploy Optional The language framework of the container.
enable-liveness-probe deploy Optional If false, will disable the liveness probe of the app instance. Allowed values: false, true.
enable-readiness-probe deploy Optional If false, will disable the readiness probe of the app instance. Allowed values: false, true.
enable-startup-probe deploy Optional If false, will disable the startup probe of the app instance. Allowed values: false, true.
termination-grace-period-seconds deploy Optional Optional duration in seconds the app instance needs to terminate gracefully.
liveness-probe-config deploy Optional A json file path indicates the liveness probe config.
readiness-probe-config deploy Optional A json file path indicates the readiness probe config.
startup-probe-config deploy Optional A json file path indicates the startup probe config.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

spring-apps-deploy's People

Contributors

allxiao avatar microsoft-github-operations[bot] avatar microsoftopensource avatar ruoyuwang-ms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-apps-deploy's Issues

Support for Java 17 and Spring Boot 3

I have a Java 17/Spring Boot 3 application that I'm able to deploy to Azure Spring Apps using Azure cli.

I prepared a deployment using Actions and I can specify Java_17 as runtime.

- name: Deploy api-gateway
      uses: azure/spring-apps-deploy@v1
      with:
        azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
        action: deploy
        service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
        app-name: ${{ env.API_GATEWAY }}
        use-staging-deployment: false
        package: ${{ github.workspace }}/${{ env.API_GATEWAY_JAR }}
        jvm-options: -Xms2048m -Xmx2048m
        runtime-version: Java_17
        environment-variables: -SPRING_PROFILES_ACTIVE passwordless

There is no validation issues on the action, but the deployment fails. Here the logs on the application side:

Build in Environment Variables
BUILD_IN_EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=https://fmiguel-spring-petclinic.svc.azuremicroservices.io/eureka/eureka
BUILD_IN_SPRING_CLOUD_CONFIG_URI=https://fmiguel-spring-petclinic.svc.azuremicroservices.io/config
BUILD_IN_SPRING_CLOUD_CONFIG_FAILFAST=true
[Azure Spring Cloud] The following environment variables are loaded: SPRING_PROFILES_ACTIVE
Picked up JAVA_TOOL_OPTIONS:  -Xms2048m -Xmx2048m
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2023-01-16 10:28:25.157Z INFO  c.m.applicationinsights.agent - Application Insights Java Agent 3.4.4 started successfully (PID 1, JVM running for 9.397 s)
2023-01-16 10:28:25.232Z INFO  c.m.applicationinsights.agent - Java version: 17.0.5, vendor: Microsoft, home: /usr/lib/jvm/msopenjdk-17
10:28:36.658 [main] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception
java.lang.NoSuchMethodError: 'org.springframework.http.HttpStatus org.springframework.http.ResponseEntity.getStatusCode()'
        at com.microsoft.azure.telemetry.TelemetrySender.sendTelemetryData(TelemetrySender.java:58)
        at com.microsoft.azure.telemetry.TelemetrySender.send(TelemetrySender.java:74)
        at com.microsoft.azure.keyvault.spring.KeyVaultEnvironmentPostProcessorHelper.sendTelemetry(KeyVaultEnvironmentPostProcessorHelper.java:219)
        at com.microsoft.azure.keyvault.spring.KeyVaultEnvironmentPostProcessorHelper.<init>(KeyVaultEnvironmentPostProcessorHelper.java:56)
        at com.microsoft.azure.keyvault.spring.KeyVaultEnvironmentPostProcessor.postProcessEnvironment(KeyVaultEnvironmentPostProcessor.java:40)
        at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109)
        at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
        at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
        at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
        at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
        at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
        at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:352)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
        at org.springframework.samples.petclinic.api.ApiGatewayApplication.main(ApiGatewayApplication.java:50)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
10:28:36.733 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.microsoft.azure.telemetry.TelemetrySender.sendTelemetryData(TelemetrySender.java:58)

The following method did not exist:

    'org.springframework.http.HttpStatus org.springframework.http.ResponseEntity.getStatusCode()'

The calling method's class, com.microsoft.azure.telemetry.TelemetrySender, was loaded from the following location:

    jar:file:/tmp/668c2a7f-89a0-4710-af05-68fdde4720c9!/BOOT-INF/lib/azure-spring-boot-2.3.0.jar!/com/microsoft/azure/telemetry/TelemetrySender.class

The called method's class, org.springframework.http.ResponseEntity, is available from the following locations:

    jar:file:/tmp/668c2a7f-89a0-4710-af05-68fdde4720c9!/BOOT-INF/lib/spring-web-6.0.3.jar!/org/springframework/http/ResponseEntity.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.http.ResponseEntity: jar:file:/tmp/668c2a7f-89a0-4710-af05-68fdde4720c9!/BOOT-INF/lib/spring-web-6.0.3.jar!/
    org.springframework.http.HttpEntity: jar:file:/tmp/668c2a7f-89a0-4710-af05-68fdde4720c9!/BOOT-INF/lib/spring-web-6.0.3.jar!/


Action:

Correct the classpath of your application so that it contains compatible versions of the classes com.microsoft.azure.telemetry.TelemetrySender and org.springframework.http.ResponseEntity

Deploying the same application using Azure cli (2.44.0) works.

az spring app deploy  \
  --resource-group ${RESOURCE_GROUP} \
  --service ${SPRING_CLOUD_SERVICE} \
  --name ${API_GATEWAY} \
  --artifact-path ${API_GATEWAY_JAR} \
  --jvm-options='-Xms2048m -Xmx2048m' \
  --runtime-version Java_17 \
  --env SPRING_PROFILES_ACTIVE=passwordless

Is there any library on the Github Action side that needs to be upgraded?

Deployment fails with Error: Action failed with error: deploymentName cannot be null or undefined.

I have a GH Workflow to deploy my *.jar files to ASA which did run fine so far, since the latest release of the ASA GH Action, it does not work anymore.

Deployment fails with the error below :
Error: Action failed with error: deploymentName cannot be null or undefined.

Whereas all the Runner logs show that the deployment-name param was successfully provided :
deployment-name: blue-vets-service

see https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365 :

##[debug]Evaluating condition for step: 'Deploy vets-service'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy vets-service
##[debug]Loading inputs
##[debug]Evaluating: secrets.AZURE_SUBSCRIPTION
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AZURE_SUBSCRIPTION'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: env.AZURE_SPRING_APPS_SERVICE
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AZURE_SPRING_APPS_SERVICE'
##[debug]=> 'asa-petcliasa'
##[debug]Result: 'asa-petcliasa'
##[debug]Evaluating: env.VETS_SERVICE
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'VETS_SERVICE'
##[debug]=> 'vets-service'
##[debug]Result: 'vets-service'
##[debug]Evaluating: env.DEPLOYMENT_STAGING
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'DEPLOYMENT_STAGING'
##[debug]=> 'true'
##[debug]Result: 'true'
##[debug]Evaluating: needs.build.outputs.VETS_SERVICE_PACKAGE_PATH
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating needs:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'build'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'outputs'
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'VETS_SERVICE_PACKAGE_PATH'
##[debug]=> '/home/runner/work/azure-spring-apps-petclinic-mic-srv/azure-spring-apps-petclinic-mic-srv/vets-service/asa-spring-petclinic-vets-service-2.6.6.jar'
##[debug]Result: '/home/runner/work/azure-spring-apps-petclinic-mic-srv/azure-spring-apps-petclinic-mic-srv/vets-service/asa-spring-petclinic-vets-service-2.6.6.jar'
##[debug]Evaluating: env.DEPLOYMENT_JVM_OPTIONS
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'DEPLOYMENT_JVM_OPTIONS'
##[debug]=> '-Dspring.cloud.azure.keyvault.secret.endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[0].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[1].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[2].endpoint=https://kv-petcliasa21.vault.azure.net -Xms[51](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:51)2m -Xmx1024m -Dspring.profiles.active=mysql,key-vault,cloud'
##[debug]Result: '-Dspring.cloud.azure.keyvault.secret.endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[0].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[1].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[2].endpoint=https://kv-petcliasa21.vault.azure.net -Xms512m -Xmx1024m -Dspring.profiles.active=mysql,key-vault,cloud'
##[debug]Evaluating: format('-SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT ***0*** -VETS_SVC_APP_IDENTITY_CLIENT_ID ***1*** -SPRING_CLOUD_AZURE_TENANT_ID ***2***', env.SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT, env.VETS_SVC_APP_IDENTITY_CLIENT_ID, env.SPRING_CLOUD_AZURE_TENANT_ID)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> '-SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT ***0*** -VETS_SVC_APP_IDENTITY_CLIENT_ID ***1*** -SPRING_CLOUD_AZURE_TENANT_ID ***2***'
##[debug]..Evaluating Index:
##[debug]....Evaluating env:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT'
##[debug]..=> '***'
##[debug]..Evaluating Index:
##[debug]....Evaluating env:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'VETS_SVC_APP_IDENTITY_CLIENT_ID'
##[debug]..=> '7c4fdc76-698e-4a[53](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:53)-aac8-1e594f4e4a[54](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:54)'
##[debug]..Evaluating Index:
##[debug]....Evaluating env:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'SPRING_CLOUD_AZURE_TENANT_ID'
##[debug]..=> '***'
##[debug]=> '-SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT *** -VETS_SVC_APP_IDENTITY_CLIENT_ID 7c4fdc76-698e-4a53-aac8-1e[59](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:59)4f4e4a54 -SPRING_CLOUD_AZURE_TENANT_ID ***'
##[debug]Result: '-SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT *** -VETS_SVC_APP_IDENTITY_CLIENT_ID 7c4fdc76-[69](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:69)8e-4a53-aac8-1e5[94](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:94)f4e4a54 -SPRING_CLOUD_AZURE_TENANT_ID ***'
##[debug]Evaluating: needs.build.outputs.VETS_SERVICE_DEPLOYMENT
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating needs:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'build'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'outputs'
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'VETS_SERVICE_DEPLOYMENT'
##[debug]=> 'blue-vets-service'
##[debug]Result: 'blue-vets-service'
##[debug]Evaluating: env.DEPLOYMENT_CREATE_NEW
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'DEPLOYMENT_CREATE_NEW'
##[debug]=> 'true'
##[debug]Result: 'true'
##[debug]Evaluating: env.DEPLOYMENT_VERSION
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'DEPLOYMENT_VERSION'
##[debug]=> '2.6.6'
##[debug]Result: '2.6.6'
##[debug]Evaluating: env.DEPLOYMENT_RUNTIME_VERSION
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'DEPLOYMENT_RUNTIME_VERSION'
##[debug]=> 'Java_11'
##[debug]Result: 'Java_11'
##[debug]Loading env

Run Azure/[email protected]
  with:
    azure-subscription: ***
    action: deploy
    service-name: asa-petcliasa
    app-name: vets-service
    use-staging-deployment: true
    package: /home/runner/work/azure-spring-apps-petclinic-mic-srv/azure-spring-apps-petclinic-mic-srv/vets-service/asa-spring-petclinic-vets-service-2.6.6.jar
    jvm-options: -Dspring.cloud.azure.keyvault.secret.endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[0].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[1].endpoint=https://kv-petcliasa21.vault.azure.net -Dspring.cloud.azure.keyvault.secret.property-sources[2].endpoint=https://kv-petcliasa21.vault.azure.net -Xms512m -Xmx1024m -Dspring.profiles.active=mysql,key-vault,cloud
    environment-variables: -SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT *** -VETS_SVC_APP_IDENTITY_CLIENT_ID 7c4fdc76-698e-4a53-aac8-1e594f4e4a54 -SPRING_CLOUD_AZURE_TENANT_ID ***
    deployment-name: blue-vets-service
    create-new-deployment: true
    version: 2.6.6
    runtime-version: Java_11
  env:
    AZ_CLI_VERSION: 2.40.0
    AZURE_SPRING_APPS_SERVICE: asa-petcliasa
    KEYVAULT: kv-petcliasa21
    RG_APP: rg-iac-asa-petclinic-mic-srv
    AZ_STORAGE_NAME: stasapetcliasa
    AZ_BLOB_CONTAINER_NAME: petcliasa-blob
    AZ_BLOB_MAX_CONNECTIONS: 5
StartingUploadOf/home/runner/work/azure-spring-apps-petclinic-mic-srv/azure-spring-apps-petclinic-mic-srv/vets-service/asa-spring-petclinic-vets-service-2.6.6.jar
*** loadedBytes: 4194304 ***
*** loadedBytes: 8388608 ***
*** loadedBytes: 12582912 ***
*** loadedBytes: 16777216 ***
*** loadedBytes: 20971520 ***
*** loadedBytes: 25165824 ***
*** loadedBytes: 29360128 ***
*** loadedBytes: 33554432 ***
*** loadedBytes: 37748736 ***
*** loadedBytes: 41943040 ***
*** loadedBytes: 46137344 ***
*** loadedBytes: 50331648 ***
*** loadedBytes: 54525952 ***
*** loadedBytes: 58720256 ***
*** loadedBytes: 62914560 ***
*** loadedBytes: 67108864 ***
*** loadedBytes: 7[130](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:130)3168 ***
*** loadedBytes: 7[209](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:210)6613 ***
*** loadedBytes: 76290917 ***
*** loadedBytes: 80485[221](https://github.com/ezYakaEagle442/azure-spring-apps-petclinic-mic-srv/actions/runs/3322102903/jobs/5491343365#step:5:222) ***
*** loadedBytes: 84679525 ***
*** loadedBytes: 88873829 ***
CompletedUploadOf/home/runner/work/azure-spring-apps-petclinic-mic-srv/azure-spring-apps-petclinic-mic-srv/vets-service/asa-spring-petclinic-vets-service-2.6.6.jar
##[debug]list deployments response: []
Error: Action failed with error: deploymentName cannot be null or undefined.
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy vets-service

Is this error related to this snippet ? : https://github.com/Azure/spring-apps-deploy/blob/main/src/operations/ActionParameters.ts#L69

RFE: Probe support

How to define ASA Probe using GH Action for Azure Spring Apps ?

Like in Bicep

// https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep
resource customersserviceappdeployment 'Microsoft.AppPlatform/Spring/apps/deployments@2022-09-01-preview' = {
  name: 'aca-${appName}-customers-service-init-v.0.1.0'
  parent: customersserviceapp
  sku: {
    name: azureSpringAppsSkuName
  }
  properties: {
    active: true
    deploymentSettings: {
      addonConfigs: {}
      environmentVariables: {
        XXX: 'foo'
        ZZZ: 'bar'
      }
      containerProbeSettings: {
        disableProbe: false
      }
      livenessProbe: {
        disableProbe: false
        failureThreshold: 5
        initialDelaySeconds: 30
        periodSeconds: 60
        probeAction: {
          type: 'HTTPGetAction'
        }
        successThreshold: 1
        timeoutSeconds: 30

      }
      readinessProbe: {
        disableProbe: false
        failureThreshold: 5
        initialDelaySeconds: 30
        periodSeconds: 60
        probeAction: {
          type: 'HTTPGetAction'
        }
        successThreshold: 1
        timeoutSeconds: 30
      }
      resourceRequests: {
          cpu: any(1)
          memory: any(1)
      }
    }
    
    source: {
      version: '1.0.0'
      
      
      type: 'Jar' // Jar, Container or Source https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep#usersourceinfo
      jvmOptions: '-Dazure.keyvault.uri=${kvURL} -Xms512m -Xmx1024m -Dspring.profiles.active=mysql,key-vault,cloud'
      relativePath: 'spring-petclinic-customers-service' // './target/petclinic-customers-service-2.6.6.jar'
      runtimeVersion: 'Java_11'
      
      type: 'Container' 
      customContainer:  {
        containerImage: 'https://acrpetcliasa.azurecr.io/petclinic/petclinic-customers-service:4242' // Container image of the custom container. This should be in the form of {repository}:{tag} without the server name of the registry	
        command: ['java', '-jar petclinic-customers-service-2.6.6.jar', '--server.port=8080', '--spring.profiles.active=docker,mysql'] 
        server: 'acrpetcliasa.azurecr.io' // 	The name of the registry that contains the container image
        imageRegistryCredential: {
          username: 'AcrUserName'
          password: 'AcrPassword'
        }
        languageFramework: 'Java'
        args: '' // Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
      }
      
      type: 'Source' // Jar, Container or Source https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep#usersourceinfo
      relativePath: 'spring-petclinic-customers-service'
      runtimeVersion: 'Java_11'
      artifactSelector: 'spring-petclinic-customers-service' // Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to the target module/project.
      
    }
  }
}

@RuoyuWang-MS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.