PHPackages                             minkbear/azure-key-vault - 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. [Security](/categories/security)
4. /
5. minkbear/azure-key-vault

ActiveLibrary[Security](/categories/security)

minkbear/azure-key-vault
========================

Allow secrets to be easily fetched from an Azure Key Vault from within a Laravel application

v0.1.2(1y ago)0389proprietaryPHPPHP ^7.4

Since Jan 25Pushed 1y agoCompare

[ Source](https://github.com/minkbear/azure-key-vault)[ Packagist](https://packagist.org/packages/minkbear/azure-key-vault)[ RSS](/packages/minkbear-azure-key-vault/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (5)Used By (0)

Azure Key Vault wrapper for Laravel 8
=====================================

[](#azure-key-vault-wrapper-for-laravel-8)

Overview
--------

[](#overview)

This package allows secrets to be fetched from an [Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/), with an interface similar to `env()` and `config()`.

Installation
------------

[](#installation)

Require this package with composer:

```
composer require insites-consulting/azure-key-vault

```

The package should be discovered by Laravel on installation.

The following environment variables must be set, if the package's default configuration is used:

- `AZURE_AD_CLIENT_ID` the UUID of the service principal which will be used to access the vault. This service principal needs "Get Secret" permission on that vault.
- `AZURE_AD_CLIENT_SECRET` the shared secret for that service principal.
- `AZURE_AD_TENANT_ID` the UUID for the tenant under which that service principal exists.
- `AZURE_KEY_VAULT_NAME` the name of the key vault (used as a subdomain in its hostname; e.g. `fred` in `fred.vault.azure.net`).

This package publishes its configuration to `vault.php`. This can be done with:

```
php artisan vendor:publish --provider=InsitesConsulting\AzureKeyVault\ServiceProvider

```

The configuration entries are as follows:

- `tenant_id` the tenant UUID
- `client_id` the service principal UUID
- `client_secret` the service principal shared secret
- `vault` the vault name

Usage
-----

[](#usage)

This package provides a facade called `Vault`, with two methods `Vault::secret()` and `Vault::setVault()`, as well as a global helper function `secret()`.

To fetch a secret called 'apikey':

```
$secret = Vault::secret('apikey');
```

If the secret does not exist, `null` will be returned, unless a different default value is specified, as here:

```
$other_secret = Vault::secret('otherkey', 'default-value');
```

If there is an error, an `InsitesConsulting\AzureKeyVault\AzureKeyVaultException` will be thrown. Its message will be set to the body of the error response from Azure, and its code will be set to the HTTP status of that response.

The global helper function behaves identically to the facade method:

```
$secret = secret('apikey');
$other_secret = secret('otherkey', 'default-key');
```

In order to work with multiple vaults, use `Vault::setVault()` to change the vault name used:

```
$secret = secret('apikey');
Vault::setVault('other-vault');
$other_secret = secret('apikey');
```

This is persistent: the newly set vault will remain until `Vault::setVault()`is called again.

Calling `Vault::setVault()` with no argument will reset the vault name to that set in the config file:

```
$other_secret = secret('apikey');
Vault::setVault();
$secret = secret('apikey');
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~676 days

Total

3

Last Release

579d ago

### Community

Maintainers

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

---

Top Contributors

[![minkbear](https://avatars.githubusercontent.com/u/233714?v=4)](https://github.com/minkbear "minkbear (7 commits)")[![stephen-isc](https://avatars.githubusercontent.com/u/74552516?v=4)](https://github.com/stephen-isc "stephen-isc (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/minkbear-azure-key-vault/health.svg)

```
[![Health](https://phpackages.com/badges/minkbear-azure-key-vault/health.svg)](https://phpackages.com/packages/minkbear-azure-key-vault)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[torchlight/torchlight-laravel

A Laravel Client for Torchlight, the syntax highlighting API.

120452.8k11](/packages/torchlight-torchlight-laravel)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)

PHPackages © 2026

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