File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change 6868
6969 - name : Terraform Apply
7070 run : terraform apply -var="environment=${{ inputs.environment }}" -auto-approve tfplan
71-
72- - name : Get API Management outputs
73- run : |
74- terraform output -json > outputs.json
75- echo "Terraform outputs saved successfully"
76-
77- - name : Test API endpoint
78- run : |
79- GATEWAY_URL=$(terraform output -raw gateway_url | xargs)
80- echo "Testing API endpoint at: ${GATEWAY_URL}/sample/get"
81- for i in {1..5}; do
82- echo "Attempt $i..."
83- HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "Ocp-Apim-Subscription-Key: placeholder" "${GATEWAY_URL}/sample/get")
84- echo "HTTP Status: $HTTP_CODE"
85- if [ "$HTTP_CODE" = "401" ] || [ "$HTTP_CODE" = "403" ]; then
86- echo "✓ API is responding (auth required is expected)"
87- break
88- elif [ "$HTTP_CODE" = "200" ]; then
89- echo "✓ API is responding"
90- break
91- else
92- echo "✗ API not responding yet, waiting 30 seconds..."
93- sleep 30
94- fi
95- done
You can’t perform that action at this time.
0 commit comments