# fastapi_cloud_healthcheck_azure_vm
A FastAPI-based health check module for monitoring the health of Azure Virtual Machines (VMs) using the `fastapi_cloud_healthcheck` package.
## Features
* **VM Power State Check**: Verifies if the Azure VM is currently running.
* **Disk Health Check**: Checks the health status of attached disks to ensure they are provisioned successfully.
* **Network Interface Check**: Validates the health of network interfaces (NICs) associated with the Azure VM.
## Adding Health Checks
Here is a sample FastAPI application that integrates the Azure VM health check:
```python
from fastapi import FastAPI
from fastapi_cloud_healthcheck import HealthCheckFactory, create_health_check_route
from fastapi_cloud_healthcheck_azure_vm import HealthCheckAzureVM
app = FastAPI()
# Create Health Check Factory
health_check_factory = HealthCheckFactory()
# Add the Azure VM Health Check
health_check_factory.add(
HealthCheckAzureVM(
vm_name="my-azure-vm",
resource_group="my-resource-group",
subscription_id="my-subscription-id",
region="eastus"
)
)
# Add the health check route to FastAPI
app.add_api_route('/health', endpoint=create_health_check_route(factory=health_check_factory))
# Start the FastAPI server using Uvicorn
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", port=5000)
Raw data
{
"_id": null,
"home_page": "https://github.com/yogeshselvarajan/fastapi_cloud_healthcheck_azure_vm",
"name": "fastapi-cloud-healthcheck-azure-vm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "fastapi, healthcheck, cloud, azure, vm, compute",
"author": "Yogesh Selvarajan",
"author_email": "yogeshselvarajan@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1d/5e/0b0c4c6d478e1b83691a81fc0739af7e514dd23f4e053e6b6e56bbea744e/fastapi_cloud_healthcheck_azure_vm-1.0.1.tar.gz",
"platform": null,
"description": "# fastapi_cloud_healthcheck_azure_vm\n\nA FastAPI-based health check module for monitoring the health of Azure Virtual Machines (VMs) using the `fastapi_cloud_healthcheck` package.\n\n## Features\n\n* **VM Power State Check**: Verifies if the Azure VM is currently running.\n* **Disk Health Check**: Checks the health status of attached disks to ensure they are provisioned successfully.\n* **Network Interface Check**: Validates the health of network interfaces (NICs) associated with the Azure VM.\n\n## Adding Health Checks\n\nHere is a sample FastAPI application that integrates the Azure VM health check:\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_cloud_healthcheck import HealthCheckFactory, create_health_check_route\nfrom fastapi_cloud_healthcheck_azure_vm import HealthCheckAzureVM\n\napp = FastAPI()\n\n# Create Health Check Factory\nhealth_check_factory = HealthCheckFactory()\n\n# Add the Azure VM Health Check\nhealth_check_factory.add(\n HealthCheckAzureVM(\n vm_name=\"my-azure-vm\",\n resource_group=\"my-resource-group\",\n subscription_id=\"my-subscription-id\",\n region=\"eastus\"\n )\n)\n\n# Add the health check route to FastAPI\napp.add_api_route('/health', endpoint=create_health_check_route(factory=health_check_factory))\n\n# Start the FastAPI server using Uvicorn\nif __name__ == \"__main__\":\n import uvicorn\n uvicorn.run(\"main:app\", port=5000)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This package is designed to validate the operational status of Azure Virtual Machines (VMs). It provides comprehensive diagnostics on the health of an Azure VM by checking its power state, disk health, and network interface status.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/yogeshselvarajan/fastapi_cloud_healthcheck_azure_vm",
"Repository": "https://github.com/yogeshselvarajan/fastapi_cloud_healthcheck_azure_vm"
},
"split_keywords": [
"fastapi",
" healthcheck",
" cloud",
" azure",
" vm",
" compute"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8439e562c571953677681f333d29c5e2a3e8591a9e50bda1b706bb71e33cdef3",
"md5": "9a72cbe98f0b59c8990e674e9a35731e",
"sha256": "574c7f5c334ce18e87590745548855f45247c4a275b4ae405af34af1af611b41"
},
"downloads": -1,
"filename": "fastapi_cloud_healthcheck_azure_vm-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a72cbe98f0b59c8990e674e9a35731e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 4330,
"upload_time": "2024-10-03T07:07:11",
"upload_time_iso_8601": "2024-10-03T07:07:11.255737Z",
"url": "https://files.pythonhosted.org/packages/84/39/e562c571953677681f333d29c5e2a3e8591a9e50bda1b706bb71e33cdef3/fastapi_cloud_healthcheck_azure_vm-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d5e0b0c4c6d478e1b83691a81fc0739af7e514dd23f4e053e6b6e56bbea744e",
"md5": "bbcd9ef023dba33b66b6d9d28f7627ae",
"sha256": "eef6431f499ee8ce4ab0b07ff1c6fe80bfdf2ac7f801eae38a8be8b0678d3db5"
},
"downloads": -1,
"filename": "fastapi_cloud_healthcheck_azure_vm-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "bbcd9ef023dba33b66b6d9d28f7627ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 3410,
"upload_time": "2024-10-03T07:07:12",
"upload_time_iso_8601": "2024-10-03T07:07:12.167201Z",
"url": "https://files.pythonhosted.org/packages/1d/5e/0b0c4c6d478e1b83691a81fc0739af7e514dd23f4e053e6b6e56bbea744e/fastapi_cloud_healthcheck_azure_vm-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-03 07:07:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yogeshselvarajan",
"github_project": "fastapi_cloud_healthcheck_azure_vm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fastapi-cloud-healthcheck-azure-vm"
}