Azure / Azure-Spring-Apps

Azure Spring Cloud
MIT License
8 stars 5 forks source link

Custom Probe feature cannot be used with ContainerProbeSettings together #15

Closed ezYakaEagle442 closed 1 year ago

ezYakaEagle442 commented 1 year ago

Describe the bug I have a GH Workflow which deploys an App using Probes and it fails with error Custom Probe feature cannot be used with ContainerProbeSettings together

  DEPLOYMENT_JVM_OPTIONS: -Xms512m -Xmx512m -Dspring.profiles.active=mysql,key-vault,cloud

  DEPLOYMENT_VERSION: 2.6.6
  DEPLOYMENT_RUNTIME_VERSION: Java_11
  DEPLOYMENT_CPU: 500m
  DEPLOYMENT_MEMORY: 512Mi
  DEPLOYMENT_INSTANCE_COUNT: 1

  DEPLOYMENT_DISABLE_PROBE: false
  DEPLOYMENT_ENABLE_STARTUP_PROBE: true
  DEPLOYMENT_ENABLE_LIVENESS_PROBE: true
  DEPLOYMENT_ENABLE_READINESS_PROBE: true

  GRACE_PERIOD: 30

  DEPLOYMENT_STARTUP_PROBE_CFG: src/main/resources/startupProbe.json
  DEPLOYMENT_LIVENESS_PROBE_CFG: src/main/resources/livenessProbe.json
  DEPLOYMENT_READINESS_PROBE_CFG: src/main/resources/readinessProbe.json

  DEPLOYMENT_CREATE_NEW: true

  STAGING_DEPLOYMENT_NAME: blue
  DEPLOYMENT_STAGING: true
  DEPLOYMENT_ACTION: deploy

            echo "About to deploy vets-service to a Staging environment"
            az spring app deploy \
            --name ${{ env.VETS_SERVICE }} \
            --service ${{ env.AZURE_SPRING_APPS_SERVICE }} -g ${{ env.RG_APP }} \
            --artifact-path ${{ needs.build.outputs.VETS_SERVICE_PACKAGE_PATH }} \
            --deployment $DEPLOYMENT_NAME \
            --disable-probe ${{ env.DEPLOYMENT_DISABLE_PROBE }} \
            --enable-startup-probe ${{ env.DEPLOYMENT_ENABLE_STARTUP_PROBE }} \
            --enable-liveness-probe ${{ env.DEPLOYMENT_ENABLE_LIVENESS_PROBE }} \
            --enable-readiness-probe ${{ env.DEPLOYMENT_ENABLE_READINESS_PROBE }} \
            --startup-probe-config $VETS_SERVICE_STARTUP_PROBE_CFG \
            --liveness-probe-config $VETS_SERVICE_LIVENESS_PROBE_CFG \
            --readiness-probe-config $VETS_SERVICE_READINESS_PROBE_CFG \
            --termination-grace-period-seconds ${{ env.GRACE_PERIOD }} \
            --env SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT=${{ env.SPRING_CLOUD_AZURE_KEY_VAULT_ENDPOINT }} VETS_SVC_APP_IDENTITY_CLIENT_ID=${{ env.VETS_SVC_APP_IDENTITY_CLIENT_ID }} SPRING_CLOUD_AZURE_TENANT_ID=${{ env.SPRING_CLOUD_AZURE_TENANT_ID }} \
            --jvm-options="${{ env.DEPLOYMENT_JVM_OPTIONS }}" \
            --version ${{ env.DEPLOYMENT_VERSION }} \
            --runtime-version ${{ env.DEPLOYMENT_RUNTIME_VERSION }}      
About to deploy vets-service to a Staging environment
WARNING: Argument '--enable-startup-probe' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--enable-liveness-probe' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--enable-readiness-probe' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--startup-probe-config' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--liveness-probe-config' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--readiness-probe-config' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Argument '--termination-grace-period-seconds' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: This command usually takes minutes to run. Add '--verbose' parameter if needed.
WARNING: [1/3] Requesting for upload URL.
WARNING: [2/3] Uploading package to blob.
WARNING: [3/3] Updating deployment in app "vets-service" (this operation can take a while to complete)
ERROR: Invalid arguments: Custom Probe feature cannot be used with ContainerProbeSettings together.
Error: Process completed with exit code 1.

To Reproduce Steps to reproduce the behavior:

  1. use the Probe Config described at the end of this issue
  2. Run the ASA App deploy command as described above
  3. See error Custom Probe feature cannot be used with ContainerProbeSettings together

Expected behavior A clear and concise description of what you expected to happen.

Screenshots N/A

Additional context

StartUp Probe

{
    "probe": {
            "initialDelaySeconds": 120,
            "periodSeconds": 60,
            "timeoutSeconds": 30,
            "failureThreshold": 10,
            "successThreshold": 1,
            "probeAction": {
                "type": "ExecAction",
                "command":  ["ls"]
            }
    }
}

liveness Probe

{
    "probe": {
            "initialDelaySeconds": 120,
            "periodSeconds": 60,
            "timeoutSeconds": 30,
            "failureThreshold": 10,
            "successThreshold": 1,
            "probeAction": {
                "type": "HTTPGetAction",
                "scheme": "HTTP",
                "path": "/actuator/health/liveness"
            }
    }
}

Probe

{
    "probe": {
            "initialDelaySeconds": 120,
            "periodSeconds": 60,
            "timeoutSeconds": 30,
            "failureThreshold": 10,
            "successThreshold": 1,
            "probeAction": {
                "type": "HTTPGetAction",
                "scheme": "HTTP",
                "path": "/actuator/health/readiness"
            }
    }
}
allxiao commented 1 year ago

The --disable-probe ${{ env.DEPLOYMENT_DISABLE_PROBE }} option cannot be used together with the other probe settings:

            --enable-startup-probe ${{ env.DEPLOYMENT_ENABLE_STARTUP_PROBE }} \
            --enable-liveness-probe ${{ env.DEPLOYMENT_ENABLE_LIVENESS_PROBE }} \
            --enable-readiness-probe ${{ env.DEPLOYMENT_ENABLE_READINESS_PROBE }} \
            --startup-probe-config $VETS_SERVICE_STARTUP_PROBE_CFG \
            --liveness-probe-config $VETS_SERVICE_LIVENESS_PROBE_CFG \
            --readiness-probe-config $VETS_SERVICE_READINESS_PROBE_CFG \