Command
New-ConfigurationDotNetServiceHealthCheck
Creates an HTTP readiness check for DotNet publish service lifecycle verification.
Syntax
New-ConfigurationDotNetServiceHealthCheck
[-ExpectedStatusCode <Int32>]
[-ExpectedValue <String>]
[-Id <String>]
[-JsonPath <String>]
[-OnFailure <Warn| Fail| Skip>]
[-PollIntervalMilliseconds <Int32>]
[-TimeoutSeconds <Int32>]
-Uri <String>
[<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Create a service health check
New-ConfigurationDotNetServiceHealthCheck -Id Runtime -Uri 'http://127.0.0.1:58433/runtime' -JsonPath 'status' -ExpectedValue 'Ready'Parameters
- -ExpectedStatusCode Int32
- Expected HTTP status code. Defaults to 200.
- -ExpectedValue String
- Optional expected JSON scalar value at JsonPath. When omitted, the check only verifies that the path exists.
- -Id String
- Optional check identifier used in logs and failure messages.
- -JsonPath String
- Optional dot-separated JSON path to validate in the response body. Array indexes can be expressed as property[0].
- -OnFailure DotNetPublishPolicyMode
- Policy used when the health check does not pass before timeout.
- Possible values:
Warn,Fail,Skip - -PollIntervalMilliseconds Int32
- Delay in milliseconds between polling attempts.
- -TimeoutSeconds Int32
- Maximum time in seconds to wait for the endpoint to pass.
- -Uri String
- Absolute HTTP or HTTPS endpoint to poll. Supports service lifecycle tokens such as {serviceName}, {outputDir}, and {executablePath}.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.