> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pulseguard.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Integratie

> Monitor Azure resources automatisch met PulseGuard

## Overview

De Azure integratie van PulseGuard stelt je in staat om je Azure resources automatisch te ontdekken en monitoren. Koppel je Azure account en PulseGuard detecteert automatisch App Services, Functions, SQL Databases, Storage Accounts, Virtual Machines en meer. Alle monitoring wordt naadloos geïntegreerd in je PulseGuard dashboard.

<Note>
  Azure integratie is beschikbaar vanaf de Expert plannen. Je hebt een Azure account nodig met de juiste permissies.
</Note>

## Ondersteunde Azure Services

PulseGuard kan de volgende Azure services monitoren:

<CardGroup cols={3}>
  <Card title="App Services" icon="globe" color="#0078D4">
    Web Apps, API Apps, Function Apps
  </Card>

  <Card title="Azure Functions" icon="bolt" color="#72B0D1">
    Serverless functions en workflows
  </Card>

  <Card title="SQL Databases" icon="database" color="#005BA1">
    Azure SQL, SQL Managed Instance
  </Card>

  <Card title="Storage Accounts" icon="hdd" color="#005BA1">
    Blob storage, File storage, Queues
  </Card>

  <Card title="Virtual Machines" icon="server" color="#0078D4">
    Windows/Linux VMs en VM Scale Sets
  </Card>

  <Card title="Cosmos DB" icon="atom" color="#0078D4">
    NoSQL databases
  </Card>
</CardGroup>

## Account Koppelen

<Steps>
  <Step title="Navigeer naar Integraties">
    Ga naar **Settings** → **Integrations** → **Azure**
  </Step>

  <Step title="Start OAuth flow">
    Klik op "Connect Azure Account"
  </Step>

  <Step title="Azure login">
    Log in met je Microsoft account (persoonlijk of werk account)
  </Step>

  <Step title="Consent geven">
    Accepteer de gevraagde permissies voor resource toegang
  </Step>

  <Step title="Account selecteren">
    Kies de Azure subscription die je wilt monitoren
  </Step>

  <Step title="Automatische discovery">
    PulseGuard scant je subscription voor monitorbare resources
  </Step>
</Steps>

## Account Types

### Persoonlijke Microsoft Accounts

* **Ondersteuning**: ✅ Volledig ondersteund
* **Resources**: Beperkt tot resources waar je eigenaar van bent
* **Setup**: Eenvoudiger, minder configuratie nodig
* **Use Case**: Persoonlijke Azure subscriptions

### Werk/School Accounts (Azure AD)

* **Ondersteuning**: ✅ Volledig ondersteund
* **Resources**: Alle resources in je tenant (afhankelijk van permissies)
* **Setup**: Kan enterprise approval vereisen
* **Use Case**: Bedrijfs Azure environments

## Resource Discovery

Zodra je account gekoppeld is, scant PulseGuard automatisch je Azure subscription:

### Discovery Proces

1. **Subscription Scanning**: Alle resource groups worden geïdentificeerd
2. **Resource Enumeration**: Resources per type worden gevonden
3. **Capability Assessment**: Controleert welke resources gemonitord kunnen worden
4. **Service Creation**: Automatisch PulseGuard services aangemaakt
5. **Initial Checks**: Eerste health checks worden uitgevoerd

### Ondersteunde Resource Types

#### Compute Resources

* **Virtual Machines**: CPU, memory, disk, network monitoring
* **VM Scale Sets**: Auto-scaling group monitoring
* **Container Instances**: Container health monitoring

#### App Services

* **Web Apps**: HTTP response monitoring, custom domains
* **API Apps**: Endpoint availability en performance
* **Function Apps**: Function execution en failures

#### Databases

* **Azure SQL**: Connection health, query performance
* **Cosmos DB**: Request units, latency, errors
* **SQL Managed Instance**: Instance availability

#### Storage

* **Blob Storage**: Container access, data operations
* **File Storage**: Share availability, SMB access
* **Queue Storage**: Message queue health

#### Serverless

* **Azure Functions**: Function app status, cold starts
* **Logic Apps**: Workflow execution status
* **Event Grid**: Event delivery status

## Monitoring Configuratie

### Automatische Service Aanmaak

Voor elke ontdekte Azure resource creëert PulseGuard automatisch:

1. **Service Monitor**: Met Azure-specifieke protocol configuratie
2. **Alert Rules**: Standaard alerts gebaseerd op resource type
3. **Dashboard Widgets**: Live status in je dashboard

### Protocol Configuratie

#### App Services & Functions

```json theme={null}
{
  "protocol": "https",
  "protocolConfig": {
    "host": "myapp.azurewebsites.net",
    "port": 443,
    "path": "/",
    "expectedStatusCodes": [200, 301, 302]
  }
}
```

#### Azure SQL Databases

```json theme={null}
{
  "protocol": "tcp",
  "protocolConfig": {
    "host": "myserver.database.windows.net",
    "port": 1433
  }
}
```

#### Storage Accounts

```json theme={null}
{
  "protocol": "https",
  "protocolConfig": {
    "host": "mystorage.blob.core.windows.net",
    "port": 443,
    "path": "/?restype=service&comp=properties"
  }
}
```

### Custom Monitoring

Je kunt de automatisch aangemaakte services aanpassen:

* **Check Intervals**: Wijzig monitoring frequentie
* **Alert Thresholds**: Stel custom alert regels in
* **Maintenance Windows**: Plan onderhoud periods
* **Custom Endpoints**: Monitor specifieke API endpoints

## Azure Monitor Integratie

Voor geavanceerde monitoring integreert PulseGuard met Azure Monitor:

### Metrics Collection

* **CPU Usage**: Voor VMs en App Services
* **Memory Usage**: RAM utilization trends
* **Network I/O**: Inbound/outbound traffic
* **Disk I/O**: Storage performance metrics
* **Response Times**: Application performance

### Log Analytics

* **Application Logs**: App Service logging
* **Audit Logs**: Security en access events
* **Performance Logs**: Detailed performance metrics
* **Error Logs**: Exception tracking

### Alert Integration

* **Azure Alerts**: Import bestaande Azure alerts
* **Metric Alerts**: CPU, memory, disk thresholds
* **Log Alerts**: Custom log-based alerting
* **Activity Log Alerts**: Subscription-level events

## Security & Access Control

### Azure Permissions

PulseGuard vereist minimaal de volgende Azure permissies:

#### Voor Resource Access

```
Microsoft.Resources/subscriptions/read
Microsoft.Resources/subscriptions/resourceGroups/read
```

#### Voor App Services

```
Microsoft.Web/sites/read
Microsoft.Web/sites/config/list
Microsoft.Web/serverfarms/read
```

#### Voor Virtual Machines

```
Microsoft.Compute/virtualMachines/read
Microsoft.Compute/virtualMachineScaleSets/read
```

#### Voor Storage Accounts

```
Microsoft.Storage/storageAccounts/read
Microsoft.Storage/storageAccounts/listKeys/action
```

### PulseGuard Security

* **Encrypted Tokens**: Azure credentials worden versleuteld opgeslagen
* **Minimal Access**: Alleen read-only toegang tot resources
* **Audit Logging**: Alle Azure API calls worden gelogd
* **Token Rotation**: Automatische refresh van access tokens

## Troubleshooting

### Veelvoorkomende Problemen

#### "No Azure subscription found"

**Oorzaak**: Persoonlijke Microsoft accounts hebben vaak geen Azure subscription
**Oplossing**: Gebruik een werk account of creëer een Azure subscription

#### "Access denied to resource"

**Oorzaak**: Onvoldoende Azure permissies
**Oplossing**:

1. Controleer Azure role assignments
2. Gebruik Owner of Contributor role
3. Of creëer custom role met minimaal vereiste permissies

#### "Resource not found"

**Oorzaak**: Resource verwijderd terwijl monitoring actief was
**Oplossing**:

1. Verwijder de PulseGuard service
2. Re-run resource discovery
3. Of manual update resource ID

#### Connection Timeouts

**Oorzaak**: Azure resource niet bereikbaar of firewall blokkeert
**Oplossing**:

1. Controleer Azure resource status
2. Verificeer networking configuration
3. Check firewall rules

### Debug Mode

Schakel debug logging in voor gedetailleerde Azure API calls:

```bash theme={null}
# Environment variable
DEBUG_AZURE=true

# Of in PulseGuard logs
tail -f /var/log/pulseguard/azure.log
```

## Cost Considerations

### Azure Costs

* **API Calls**: Azure Monitor API usage charges
* **Log Analytics**: Data ingestion costs voor logs
* **Network**: Data transfer costs voor monitoring

### PulseGuard Costs

* **Expert Plan**: Vereist voor Azure integratie
* **API Limits**: Azure discovery kan API limits raken
* **Storage**: Metrics data retention costs

## Best Practices

### Resource Organization

1. **Resource Groups**: Gebruik duidelijke naming conventions
2. **Tags**: Tag resources voor betere filtering
3. **Subscriptions**: Scheid development en production

### Monitoring Strategy

1. **Critical Resources**: Focus op business-critical services eerst
2. **Alert Tuning**: Stel alerts af op je specifieke environment
3. **Maintenance Windows**: Plan voor regulier onderhoud

### Security

1. **Principle of Least Privilege**: Geef minimaal vereiste permissies
2. **Regular Audits**: Controleer access logs regelmatig
3. **Token Rotation**: Vernieuw credentials periodiek

### Performance

1. **Check Intervals**: Gebruik redelijke monitoring frequenties
2. **Bulk Operations**: Batch Azure API calls waar mogelijk
3. **Caching**: Cache resource metadata

## API Integration

Gebruik de REST API voor Azure account beheer:

```bash theme={null}
# Azure accounts ophalen
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.ipulse.one/azure/accounts

# Azure account koppelen
curl -X POST https://api.ipulse.one/azure/accounts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "azure-tenant-id",
    "clientId": "azure-client-id",
    "clientSecret": "azure-client-secret"
  }'

# Azure services ontdekken
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.ipulse.one/azure/accounts/ACCOUNT_ID/services
```

## Support & Resources

### Azure Documentation

* [Azure Resource Manager REST API](https://docs.microsoft.com/en-us/rest/api/azure/)
* [Azure Monitor REST API](https://docs.microsoft.com/en-us/rest/api/monitor/)
* [Azure Authentication](https://docs.microsoft.com/en-us/azure/active-directory/develop/)

### PulseGuard Support

* **Setup Guide**: Azure OAuth configuratie stappen
* **Troubleshooting**: Veelvoorkomende problemen en oplossingen
* **Best Practices**: Aanbevolen configuraties

***

*Azure integratie vereist een actief Azure account en Expert abonnement. Contact support voor hulp bij de setup.*
