keboola / azure-event-grid-client
Client for Azure Event Grid
Installs: 10 927
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 19
Forks: 0
Open Issues: 1
Requires
- php: ^8
- ext-json: *
- guzzlehttp/guzzle: ^6|^7
- psr/log: ^1.1 || ^2.0 || ^3.0
- symfony/config: ^5|^6
- symfony/validator: ^5|^6
Requires (Dev)
- phpstan/phpstan: ^1
- phpunit/phpunit: ^9
- rector/rector: ^0.15.13
This package is auto-updated.
Last update: 2024-12-17 17:40:11 UTC
README
PHP client for Azure Event Grid.
Supports the following:
- Publish Events Endpoint spec
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