PHPackages                             codebar-ag/laravel-microsoft-azure - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. codebar-ag/laravel-microsoft-azure

ActiveLibrary[API Development](/categories/api)

codebar-ag/laravel-microsoft-azure
==================================

Thin Azure and Microsoft 365 REST connector for Laravel (ARM, Key Vault, Graph, Kudu)

v0.2.0(today)024↑2650%MITPHPPHP 8.4.\*|8.5.\*CI failing

Since Jul 1Pushed todayCompare

[ Source](https://github.com/codebar-ag/laravel-microsoft-azure)[ Packagist](https://packagist.org/packages/codebar-ag/laravel-microsoft-azure)[ Docs](https://github.com/codebar-ag/laravel-microsoft-azure)[ RSS](/packages/codebar-ag-laravel-microsoft-azure/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (21)Versions (4)Used By (0)

laravel-microsoft-azure
=======================

[](#laravel-microsoft-azure)

[![Tests](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/run-tests.yml/badge.svg)](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/run-tests.yml)[![PHPStan](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/phpstan.yml)[![Code Style](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/fix-php-code-style-issues.yml)[![Composer Audit](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/composer-audit.yml/badge.svg)](https://github.com/codebar-ag/laravel-microsoft-azure/actions/workflows/composer-audit.yml)

Thin Azure and Microsoft 365 REST connector for Laravel — Saloon transport only, no business logic.

Covers **ARM**, **Azure AI Foundry** (control + data plane), **Azure Functions** (ARM + runtime), **Key Vault**, **Microsoft Graph**, and **Kudu**. Orchestration (provisioning sequences, LRO polling, idempotency) belongs in the consuming app.

Install
-------

[](#install)

```
composer require codebar-ag/laravel-microsoft-azure
```

Publish config:

```
php artisan vendor:publish --tag=laravel-microsoft-azure-config
```

Configuration
-------------

[](#configuration)

```
MICROSOFT_AZURE_TENANT_ID=
MICROSOFT_AZURE_CLIENT_ID=
MICROSOFT_AZURE_CLIENT_SECRET=
MICROSOFT_AZURE_SUBSCRIPTION_ID=
```

Usage
-----

[](#usage)

```
use CodebarAg\MicrosoftAzure\Facades\Azure;

$client = Azure::instance(); // AzureClient with ->config (ConnectionConfig)

// ARM
// ARM — subscriptions (read + cancel)
Azure::instance()->subscriptions()->list();
Azure::instance()->subscriptions()->get($subscriptionId);
Azure::instance()->subscriptions()->cancel($subscriptionId);

// ARM — create new subscriptions via billing-scope aliases (MCA / EA)
$alias = Azure::instance()->subscriptionAliases()->createOrUpdate(
    aliasName: 'tenant-acme',
    billingScope: '/providers/Microsoft.Billing/billingAccounts/{id}/enrollmentAccounts/{id}',
    displayName: 'Acme Tenant',
);
// Poll until $alias->provisioningState->isTerminal(), then use $alias->subscriptionId

Azure::instance()->resourceGroups($subscriptionId)->get('my-rg');
Azure::instance()->deployments($subscriptionId, 'my-rg')->createOrUpdate('tenantflow', $template, $params);

// Key Vault
Azure::instance()->vault('my-kv')->secrets()->set('webhook-token', $token);

// Graph
Azure::instance()->graph()->groups()->addMember($groupId, $userId);

// Kudu zip deploy (artifact built in CI)
Azure::instance()->appService('my-func')->zipDeploy('/path/to/intake.zip');

// Foundry control plane — deploy gpt-5-mini, rotate keys
$cs = Azure::instance()->cognitiveServices($subscriptionId, 'my-rg');
$cs->account('my-aif')->deployments()->createOrUpdate(
    'gpt-5-mini', 'OpenAI', 'gpt-5-mini', '2025-08-07', 'GlobalStandard', 10,
);
$cs->account('my-aif')->regenerateKey('Key1');

// Azure OpenAI inference (Entra or pass API key as 2nd argument)
Azure::instance()->openAi('my-aif')->chat()->create('gpt-5-mini', [
    'messages' => [['role' => 'user', 'content' => 'Hello']],
]);

// Foundry Agent Service
Azure::instance()->foundry('my-aif', 'my-prj')->responses()->create([
    'model' => 'gpt-5-mini',
    'input' => 'Summarize this document',
]);

// Function App ARM — restart, sync triggers, read host keys
$func = Azure::instance()->functionApps($subscriptionId, 'my-rg')->app('my-func');
$func->restart();
$func->syncTriggers();
```

Polling example (app-side — not in the package):

```
$dep = Azure::instance()->deployments($sub, $rg)->get('tenantflow');
while ($dep->provisioningState && ! $dep->provisioningState->isTerminal()) {
    sleep(5);
    $dep = Azure::instance()->deployments($sub, $rg)->get('tenantflow');
}
```

API reference
-------------

[](#api-reference)

- [Endpoint catalog](ENDPOINTS.md) — human-readable index grouped by Azure service
- [API reference](docs/api-reference.md) — requests, response DTOs, write payloads, and resource gateways
- [Inventory parity](docs/inventory-parity.md) — endpoint coverage vs. Saloon request classes

Regenerate after changing Requests, DTOs, or Resources:

```
composer docs:api
composer inventory:parity
```

Testing
-------

[](#testing)

```
composer test              # offline unit + core tests (CI)
composer test:coverage     # 100% line coverage on src/ (CI, requires pcov)
composer test:live         # live Azure integration (requires credentials)
composer test:record       # live run with fixture recording enabled
composer inventory:parity  # endpoint coverage report
composer docs:api          # regenerate API reference
composer analyse           # PHPStan level 10
composer format            # Pint
```

CI runs **PHPStan level 10**, **100% unit test coverage** (offline Saloon fixtures), and **live integration tests** when `MICROSOFT_AZURE_*` GitHub secrets are configured.

Set `MICROSOFT_AZURE_TENANT_ID`, `MICROSOFT_AZURE_CLIENT_ID`, `MICROSOFT_AZURE_CLIENT_SECRET`, and `MICROSOFT_AZURE_SUBSCRIPTION_ID` in gitignored `phpunit.xml` (copy from `phpunit.xml.dist` and fill the empty placeholders — never commit real secrets). CI passes the same vars via GitHub Actions secrets.

Integration tests provision their own resource groups via the API and tear them down after each test. Optionally override the Azure region with `MICROSOFT_AZURE_TESTS_LOCATION` (default: `westeurope`).

The service principal needs **Contributor** (or equivalent write/read roles) on `MICROSOFT_AZURE_SUBSCRIPTION_ID` for standard-tier integration tests. Tests skip gracefully with a clear message when OAuth succeeds but RBAC is insufficient.

### Saloon fixtures

[](#saloon-fixtures)

Offline tests replay redacted HTTP fixtures from `tests/Fixtures/saloon/`. After a green live run with Contributor access, record or refresh fixtures:

```
composer test:record
./vendor/bin/pint
composer test   # verify offline replay still passes
```

Set `MICROSOFT_AZURE_RECORD_FIXTURES=true` (as `test:record` does) to write fixtures during integration tests. Secrets in responses are redacted automatically.

### Live integration tiers

[](#live-integration-tiers)

TierRequired envTestsStandardOAuth + subscription IDResource group create/get/list/delete; subscription list/getBillingabove + `MICROSOFT_AZURE_TESTS_BILLING_SCOPE`Subscription alias create/update/list/get; cancel on newly created subscription### Billing scope setup

[](#billing-scope-setup)

Billing scope is the ARM resource ID of your enrollment account. Alias lifecycle tests skip when `MICROSOFT_AZURE_TESTS_BILLING_SCOPE` is unset.

1. Azure Portal → **Cost Management + Billing** → **Billing accounts**
2. Open your account → **Enrollment accounts** (MCA) or the invoice section path for your agreement type
3. Copy the **Resource ID** — format like `/providers/Microsoft.Billing/billingAccounts/{id}/enrollmentAccounts/{id}`
4. Grant the service principal **Enrollment account subscription creator** (or equivalent billing write role)

```
MICROSOFT_AZURE_TESTS_BILLING_SCOPE=/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}
```

Teardown cancels the newly created subscription and deletes the alias (best-effort).

Repository
----------

[](#repository)

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd1bbe54b79d041b513a286058b6fa0c479343f82147da3e63eefdf29c2fa6cb?d=identicon)[codebar](/maintainers/codebar)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelazuresaloongraphcodebar-agkey vaultmicrosoft-365

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codebar-ag-laravel-microsoft-azure/health.svg)

```
[![Health](https://phpackages.com/badges/codebar-ag-laravel-microsoft-azure/health.svg)](https://phpackages.com/packages/codebar-ag-laravel-microsoft-azure)
```

###  Alternatives

[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1223.7k](/packages/codebar-ag-laravel-docuware)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M293](/packages/laravel-horizon)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M158](/packages/spatie-laravel-health)[codebar-ag/laravel-zammad

Zammad integration with Laravel

107.1k](/packages/codebar-ag-laravel-zammad)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k90](/packages/nativephp-mobile)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
