Data does not match any schemas from 'oneOf' error

Problem statement

I’m trying to create a new Eventgrid Log Stream using the Management API endpoint
POST/api/v2/log-streams, with the payload:

{
    "name": "UAT Azure log stream",
    "type": "eventgrid",
    "sink": {
        "azureSubscriptionId": "<my subscription id>",
        "azureResourceGroup": "uat-myaccount",
        "azureRegion": "uswest2"
    }
}

I received the following error:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Payload validation error: 'Data does not match any schemas from 'oneOf''.",
    "errorCode": "invalid_body"
}

Cause

This generic error might be confusing. The reason for the ‘Data does not match any schemas from ‘oneOf’’ error in most cases is having the wrong format in the “azureRegion” setting.

Solution

You can check the available Azure Region Names with Azure CLI command:
az account list-locations -o table

1 Like