-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add NetEvolve.HealthChecks.Azure.IotHub package #891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: samtrion <[email protected]>
@copilot rebase and start implementing the tests |
* chore: Conventional commits copilot-instructions.md Signed-off-by: Martin Stühmer <[email protected]> * fix: Wording Signed-off-by: Martin Stühmer <[email protected]> --------- Signed-off-by: Martin Stühmer <[email protected]>
Bumps [dailydevops/pipelines](https://github.com/dailydevops/pipelines) from 1.0.8 to 1.0.32. - [Release notes](https://github.com/dailydevops/pipelines/releases) - [Commits](dailydevops/pipelines@1.0.8...1.0.32) --- updated-dependencies: - dependency-name: dailydevops/pipelines dependency-version: 1.0.32 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): Bump the tunit group with 1 update Bumps TUnit from 0.25.21 to 0.56.44 --- updated-dependencies: - dependency-name: TUnit dependency-version: 0.56.44 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: tunit ... Signed-off-by: dependabot[bot] <[email protected]> * chore(deps): Also updated `NetEvolve.Extensions.TUnit` * fix(deps): Updated `Verify.TUnit` --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Martin Stühmer <[email protected]>
Bumps xunit.runner.visualstudio from 3.1.3 to 3.1.4 --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-version: 3.1.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) * feat: Implement core NetEvolve.HealthChecks.Azure.ApplicationInsights package Co-authored-by: samtrion <[email protected]> * feat: Add comprehensive unit and integration tests for ApplicationInsights health checks Co-authored-by: samtrion <[email protected]> * feat: Complete NetEvolve.HealthChecks.Azure.ApplicationInsights implementation with README integration Co-authored-by: samtrion <[email protected]> * fix(build): add NetEvolve.HealthChecks.Azure.ApplicationInsights to solution file Co-authored-by: samtrion <[email protected]> * style(format): Reformatted code * fix(deps): Added PackageVersion for `Microsoft.ApplicationInsights` and `Microsoft.ApplicationInsights.AspNetCore` * fix(CA2000): Disabled warning * fix: Added missing project reference * fix: Added missing project reference * fix(test): resolve ApplicationInsights test errors and InstrumentationKey bug Co-authored-by: samtrion <[email protected]> * fix: Use Invariant Culture for formatting * fix(test): Updated tests for missing async support * fix(test): More async test cases * fix: Do not cache ServiceProvider Clients * test: Updated the integration tests * fix: Usage of internal method `CreateTelemetryClient` updated * fix: Removed S1186 Warning * chore: Updated Public API Defnition * chore: Simplified of Event creation * chore: Even more simplification of the execution * style(format): Reformatted code * fix: Removed false positve ArangoDB Test * chore: Removed old verify files --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: samtrion <[email protected]> Co-authored-by: Martin Stühmer <[email protected]>
* fix: Changes before error encountered Co-authored-by: samtrion <[email protected]> * fix: Additional spelling mistakes: yo need → you need in README files Co-authored-by: samtrion <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: samtrion <[email protected]>
…oring (#887) * feat: Initial analysis and plan for NetEvolve.HealthChecks.Http package Co-authored-by: samtrion <[email protected]> * feat: Implement NetEvolve.HealthChecks.Http core functionality and unit tests Co-authored-by: samtrion <[email protected]> * fix: Complete NetEvolve.HealthChecks.Http implementation with tests and verification Co-authored-by: samtrion <[email protected]> * fix: Complete NetEvolve.HealthChecks.Http implementation by adding missing package reference and solution entries Co-authored-by: samtrion <[email protected]> * fix: Remove nested .editorconfig files and dotnet-install.sh script Co-authored-by: samtrion <[email protected]> * style(format): Reformatted code * fix: Removed warnings * chore: Simplified `HttpConfigure` * fix: Removed unnecessary using * fix(test): Fixed tests * test: Updated integration tests * fix: Removed open warnings * fix: Use ProcessCount * fix(test): Wrong timeout for test * fix: Special handling for `Win32Exceptions` * fix(verify): Updated verify files * fix: Further Win32 Exception handling --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: samtrion <[email protected]> Co-authored-by: Martin Stühmer <[email protected]>
Bumps [dailydevops/pipelines](https://github.com/dailydevops/pipelines) from 1.0.32 to 1.0.38. - [Release notes](https://github.com/dailydevops/pipelines/releases) - [Commits](dailydevops/pipelines@1.0.32...1.0.38) --- updated-dependencies: - dependency-name: dailydevops/pipelines dependency-version: 1.0.38 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: Set Timeout for Test execution to 10000 ms * fix: Missing updates
Co-authored-by: samtrion <[email protected]>
Co-authored-by: samtrion <[email protected]>
Branch has been rebased and comprehensive unit tests have been implemented. Added tests for |
@copilot add integration tests based on testcontainers |
…heck Co-authored-by: samtrion <[email protected]>
Integration tests based on testcontainers have been implemented. Created Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR implements a complete health check package for Azure IoT Hub, following the established patterns used throughout the repository for other Azure services.
Features
The new
NetEvolve.HealthChecks.Azure.IotHub
package provides:GetServiceStatisticsAsync()
ServiceProvider
- Uses pre-registered client from DI containerDefaultAzureCredentials
- Uses Azure AD authenticationConnectionString
- Uses IoT Hub connection stringUsage Examples
Configuration-based approach:
With
appsettings.json
:Options-based approach:
Implementation Details
The implementation follows the same architectural patterns as other Azure health checks in the repository:
IotHubOptionsBase
- Abstract base class for configuration optionsIotHubAvailabilityOptions
- Specific options for availability checkIotHubClientFactory
- Manages IoT Hub client instances with cachingIotHubAvailabilityHealthCheck
- Main health check implementationDependencyInjectionExtensions
- Extension methods for service registrationThe health check uses the Azure IoT Hub SDK's
ServiceClient.GetServiceStatisticsAsync()
method as a lightweight operation to verify connectivity and service availability.Testing
IotHubAvailabilityHealthCheck
,IotHubClientFactory
, configuration options, and dependency injection extensionsMicrosoft.Azure.Devices
v1.40.0Integration Test Implementation
The integration tests use a
IoTHubMockContainer
that runs WireMock in a Docker container to simulate Azure IoT Hub REST API endpoints. This testcontainers approach allows testing of:Due to Azure IoT Hub SDK limitations (hostname validation and certificate requirements), one test is appropriately skipped with clear documentation explaining the technical constraints.
Fixes #38.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.