keboola/azure-event-grid-client

Client for Azure Event Grid

v0.9.0 2023-02-17 13:42 UTC

This package is auto-updated.

Last update: 2024-12-17 17:40:11 UTC


README

PHP client for Azure Event Grid.

Supports the following:

Installation

composer require keboola/azure-event-grid-php-client

Usage

Create client instance and encrypt data:

$client = new Client(
    new GuzzleClientFactory($logger),
    'connection-events.northeurope-1.eventgrid.azure.net'
);

Development

Run tests with:

docker-compose run --rm testsXX

where XX is PHP version (56 - 74), e.g.:

docker-compose run --rm tests70

Resources Setup

export EVENT_GRID_RG=testing-azure-event-grid-php-client
export EVENT_GRID_TOPIC_NAME=testing-event-grid-php-client-topic

Create a resource group:

az group create --name $EVENT_GRID_RG --location "northeurope"

Deploy the event grid:

az group deployment create --resource-group $EVENT_GRID_RG --template-file arm-template.json --parameters topicName=$EVENT_GRID_TOPIC_NAME

optionally parameter topicName can be set to override default topic name

Get endpoint url:

az resource show -g $EVENT_GRID_RG --resource-type "Microsoft.EventGrid/topics" -n $EVENT_GRID_TOPIC_NAME

returns properties.endpoint set it as TEST_TOPIC_ENDPOINT

Get endpoint accessKey:

az eventgrid topic key list -g $EVENT_GRID_RG -n $EVENT_GRID_TOPIC_NAME

returns key1 and key2 set one of them as TEST_TOPIC_KEY