Download the PHP package anastosios/mi without Composer

On this page you can find all versions of the php package anastosios/mi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mi

MI Azure Managed Identity for Laravel

This package enables Azure Managed Identity (MI) authentication for:

1) Azure Blob Storage (Laravel Storage disk: azure) 2) Azure Cache for Redis (Laravel Redis client: azure-mi) 3) Azure Database for PostgreSQL (Laravel DB connector: pgsql)

It fetches short-lived access tokens from the Azure Instance Metadata Service (IMDS), caches them (recommended: file cache), then injects them into each client connection so the application can authenticate without long-lived secrets.


Table of Contents


High-Level Overview

All services follow the same MI pattern:

1) Determine if MI is enabled for that service/connection. 2) Fetch a token from IMDS:


Token Service

Class

MI\AzureManagedIdentity\Services\AzureManagedIdentityTokenService

Responsibilities

Token caching key pattern

Why file cache is recommended


Configuration

Config File

config/azure-managed-identity.php

.env Variables

Minimum recommended variables (based on the provided classes):


Azure Blob Storage

How Blob Works

Classes involved

What happens when you call Storage::disk('azure')?

1) AzureServiceProvider::boot() registers a custom driver:

Why a custom HTTP client is injected

The microsoft/azure-storage-blob SDK is primarily designed for Shared Key / SAS.
Your implementation injects a Bearer-token aware HTTP client so requests are authenticated using MI.


Blob Mermaid Flow Chart


Blob Test Command

Command: azure:test

What it does:


Azure Redis

How Redis Works

Classes involved

What happens when you call Redis::connection('default')?

1) You set:

Required Redis config fields

When MI is enabled, the Redis connection config must provide:


Redis Mermaid Flow Chart


Redis Test Command

Command: azure:redis-test

What it does:


Azure PostgreSQL (pgsql)

How DB Works

Classes involved

What happens when Laravel connects to pgsql?

1) In AzureServiceProvider::register(), the package binds:

What the DB token represents

For Azure Database for PostgreSQL with Entra/AAD auth, the access token acts like a short-lived password for the configured DB user. Your DevOps verification command mirrors that behavior:


DB Mermaid Flow Chart


Notes About Read/Write Hosts

Your database.php supports read replicas:

Laravel may connect to:

Managed Identity still works because:

If you experience authentication issues only on read replicas, that usually means the replica side is not configured to accept the same Entra/AAD principal or security rules differ.


Logging

The package logs:

Recommended:


Security Notes


Troubleshooting

Storage fails (403/401)

Redis fails

Common causes:

DB fails (password authentication failed)

Common causes:



All versions of mi with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support Version ^8.0|^10.0|^11.0
illuminate/filesystem Version ^8.0|^10.0|^11.0
illuminate/redis Version ^8.0|^10.0|^11.0
illuminate/database Version ^8.0|^10.0|^11.0
illuminate/console Version ^8.0|^10.0|^11.0
guzzlehttp/guzzle Version ^7.0
microsoft/azure-storage-blob Version ^1.0|^1.5
league/flysystem-azure-blob-storage Version ^1.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anastosios/mi contains the following files

Loading the files please wait ...