Clients - Create Or Update

Create or update a client with the specified parameters.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clients/{clientName}?api-version=2024-06-01-preview

URI Parameters

Name In Required Type Description
clientName
path True

string

The client name.

Regex pattern: ^[-a-zA-Z0-9:\._]*$

namespaceName
path True

string

Name of the namespace.

Regex pattern: ^[a-zA-Z0-9-]*$

resourceGroupName
path True

string

The name of the resource group within the user's subscription.

subscriptionId
path True

string

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

Request Body

Name Type Description
properties.attributes

Attributes for the client. Supported values are int, bool, string, string[]. Example: "attributes": { "room": "345", "floor": 12, "deviceTypes": ["Fan", "Light"] }

properties.authenticationName

string

The name presented by the client for authentication. The default value is the name of the resource.

properties.clientCertificateAuthentication

ClientCertificateAuthentication

The client certificate authentication information.

properties.description

string

Description for the Client resource.

properties.state

ClientState

Indicates if the client is enabled or not. Default value is Enabled.

Responses

Name Type Description
200 OK

Client

Create or update request is successful.

201 Created

Client

Created

Other Status Codes

ErrorResponse

Error response returned if request was unsuccessful.

Examples

Clients_CreateOrUpdate

Sample Request

PUT https://management.azure.com/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1?api-version=2024-06-01-preview

{
  "properties": {
    "state": "Enabled",
    "clientCertificateAuthentication": {
      "validationScheme": "SubjectMatchesAuthenticationName"
    },
    "attributes": {
      "room": "345",
      "floor": 3,
      "deviceTypes": [
        "Fan",
        "Light",
        "AC"
      ]
    },
    "description": "This is a test client"
  }
}

Sample Response

{
  "properties": {
    "clientCertificateAuthentication": {
      "validationScheme": "SubjectMatchesAuthenticationName"
    },
    "state": "Enabled",
    "attributes": {
      "room": "345a",
      "floor": 3,
      "deviceTypes": [
        "Light",
        "1"
      ]
    },
    "provisioningState": "Succeeded",
    "description": "This is a test client"
  },
  "id": "/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1",
  "name": "exampleClientName1",
  "type": "Microsoft.EventGrid/namespaces/clients"
}
{
  "properties": {
    "clientCertificateAuthentication": {
      "validationScheme": "SubjectMatchesAuthenticationName"
    },
    "state": "Enabled",
    "attributes": {
      "room": "345a",
      "floor": 3,
      "deviceTypes": [
        "Light",
        "1"
      ]
    },
    "provisioningState": "Succeeded",
    "description": "This is a test client"
  },
  "id": "/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1",
  "name": "exampleClientName1",
  "type": "Microsoft.EventGrid/namespaces/clients"
}

Definitions

Name Description
Client

The Client resource.

ClientCertificateAuthentication

The certificate authentication properties for the client.

ClientCertificateValidationScheme

The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName.

ClientProvisioningState

Provisioning state of the Client resource.

ClientState

Indicates if the client is enabled or not. Default value is Enabled.

createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

systemData

Metadata pertaining to creation and last modification of the resource.

Client

The Client resource.

Name Type Default Value Description
id

string

Fully qualified identifier of the resource.

name

string

Name of the resource.

properties.attributes

Attributes for the client. Supported values are int, bool, string, string[]. Example: "attributes": { "room": "345", "floor": 12, "deviceTypes": ["Fan", "Light"] }

properties.authenticationName

string

The name presented by the client for authentication. The default value is the name of the resource.

properties.clientCertificateAuthentication

ClientCertificateAuthentication

The client certificate authentication information.

properties.description

string

Description for the Client resource.

properties.provisioningState

ClientProvisioningState

Provisioning state of the Client resource.

properties.state

ClientState

Enabled

Indicates if the client is enabled or not. Default value is Enabled.

systemData

systemData

The system metadata relating to the Client resource.

type

string

Type of the resource.

ClientCertificateAuthentication

The certificate authentication properties for the client.

Name Type Description
allowedThumbprints

string[]

The list of thumbprints that are allowed during client authentication. This property is required only if the validationScheme is 'ThumbprintMatch'.

validationScheme

ClientCertificateValidationScheme

The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName.

ClientCertificateValidationScheme

The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName.

Name Type Description
DnsMatchesAuthenticationName

string

EmailMatchesAuthenticationName

string

IpMatchesAuthenticationName

string

SubjectMatchesAuthenticationName

string

ThumbprintMatch

string

UriMatchesAuthenticationName

string

ClientProvisioningState

Provisioning state of the Client resource.

Name Type Description
Canceled

string

Creating

string

Deleted

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

ClientState

Indicates if the client is enabled or not. Default value is Enabled.

Name Type Description
Disabled

string

Enabled

string

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.