Partilhar via


Endpoints - DigitalTwinsEndpoint CreateOrUpdate

Create or update DigitalTwinsInstance endpoint.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}?api-version=2023-01-31

URI Parameters

Name In Required Type Description
endpointName
path True

string

Name of Endpoint Resource.

Regex pattern: ^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$

resourceGroupName
path True

string

The name of the resource group that contains the DigitalTwinsInstance.

resourceName
path True

string

The name of the DigitalTwinsInstance.

Regex pattern: ^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$

subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

Version of the DigitalTwinsInstance Management API.

Request Body

Name Required Type Description
properties True DigitalTwinsEndpointResourceProperties:

DigitalTwinsInstance endpoint resource properties.

Responses

Name Type Description
200 OK

DigitalTwinsEndpointResource

This is returned as a response to the status polling request for the create or update operation. The body contains the resource representation that indicates a transitional provisioning state.

201 Created

DigitalTwinsEndpointResource

Created - Put request accepted; the operation will complete asynchronously.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

Put a DigitalTwinsEndpoint resource
Put a DigitalTwinsEndpoint resource with identity
Put a DigitalTwinsEndpoint resource with user assigned identity

Put a DigitalTwinsEndpoint resource

Sample request

PUT https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus?api-version=2023-01-31

{
  "properties": {
    "endpointType": "ServiceBus",
    "authenticationType": "KeyBased",
    "primaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc",
    "secondaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc"
  }
}

Sample response

{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "authenticationType": "KeyBased",
    "provisioningState": "Succeeded",
    "primaryConnectionString": "Endpoint=sb://***/;SharedAccessKeyName=***;SharedAccessKey=***;EntityPath=***",
    "secondaryConnectionString": "Endpoint=sb://***/;SharedAccessKeyName=***;SharedAccessKey=***;EntityPath=***",
    "createdTime": "2019-11-19T01:10:34.350Z"
  }
}
azure-asyncoperation: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationStatuses/12345678-1234-1234-123456789012
location: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationResults/12345678-1234-1234-123456789012
retry-after: 10
{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "authenticationType": "KeyBased",
    "provisioningState": "Provisioning",
    "primaryConnectionString": "",
    "secondaryConnectionString": "",
    "createdTime": "2019-11-19T01:10:34.350Z"
  }
}

Put a DigitalTwinsEndpoint resource with identity

Sample request

PUT https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus?api-version=2023-01-31

{
  "properties": {
    "endpointType": "ServiceBus",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic"
  }
}

Sample response

{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "provisioningState": "Provisioning",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic",
    "createdTime": "2019-11-19T01:10:34.350Z"
  }
}
azure-asyncoperation: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationStatuses/12345678-1234-1234-123456789012
location: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationResults/12345678-1234-1234-123456789012
retry-after: 10
{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "provisioningState": "Provisioning",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic",
    "createdTime": "2019-11-19T01:10:34.350Z"
  }
}

Put a DigitalTwinsEndpoint resource with user assigned identity

Sample request

PUT https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus?api-version=2023-01-31

{
  "properties": {
    "endpointType": "ServiceBus",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic",
    "identity": {
      "type": "UserAssigned",
      "userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity"
    }
  }
}

Sample response

{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "provisioningState": "Provisioning",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic",
    "createdTime": "2019-11-19T01:10:34.350Z",
    "identity": {
      "type": "UserAssigned",
      "userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity"
    }
  }
}
azure-asyncoperation: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationStatuses/12345678-1234-1234-123456789012
location: https://management.azure.com/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/providers/Microsoft.DigitalTwins/locations/westus2/operationResults/12345678-1234-1234-123456789012
retry-after: 10
{
  "id": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/endpoints/myServiceBus",
  "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints",
  "name": "myServiceBus",
  "systemData": {
    "createdBy": "user@example.com",
    "createdByType": "User",
    "createdAt": "2021-03-11T17:13:59.4037715Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-03-11T17:14:02.5281409Z"
  },
  "properties": {
    "endpointType": "ServiceBus",
    "provisioningState": "Provisioning",
    "authenticationType": "IdentityBased",
    "endpointUri": "sb://mysb.servicebus.windows.net/",
    "entityPath": "mysbtopic",
    "createdTime": "2019-11-19T01:10:34.350Z",
    "identity": {
      "type": "UserAssigned",
      "userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity"
    }
  }
}

Definitions

Name Description
AuthenticationType

Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified.

createdByType

The type of identity that created the resource.

DigitalTwinsEndpointResource

DigitalTwinsInstance endpoint resource.

EndpointProvisioningState

The provisioning state.

ErrorDefinition

Error definition.

ErrorResponse

Error response.

EventGrid

Properties related to EventGrid.

EventHub

Properties related to EventHub.

IdentityType

The type of managed identity used.

ManagedIdentityReference

The properties of the Managed Identity.

ServiceBus

Properties related to ServiceBus.

SystemData

Metadata pertaining to creation and last modification of the resource.

AuthenticationType

Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified.

Name Type Description
IdentityBased

string

KeyBased

string

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DigitalTwinsEndpointResource

DigitalTwinsInstance endpoint resource.

Name Type Description
id

string

The resource identifier.

name

string

Extension resource name.

properties DigitalTwinsEndpointResourceProperties:

DigitalTwinsInstance endpoint resource properties.

systemData

SystemData

Metadata pertaining to creation and last modification of the resource.

type

string

The resource type.

EndpointProvisioningState

The provisioning state.

Name Type Description
Canceled

string

Deleted

string

Deleting

string

Disabled

string

Failed

string

Moving

string

Provisioning

string

Restoring

string

Succeeded

string

Suspending

string

Updating

string

Warning

string

ErrorDefinition

Error definition.

Name Type Description
code

string

Service specific error code which serves as the substatus for the HTTP error code.

details

ErrorDefinition[]

Internal error details.

message

string

Description of the error.

ErrorResponse

Error response.

Name Type Description
error

ErrorDefinition

Error description

EventGrid

Properties related to EventGrid.

Name Type Description
TopicEndpoint

string

EventGrid Topic Endpoint.

accessKey1

string

EventGrid secondary accesskey. Will be obfuscated during read.

accessKey2

string

EventGrid secondary accesskey. Will be obfuscated during read.

authenticationType

AuthenticationType

Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified.

createdTime

string

Time when the Endpoint was added to DigitalTwinsInstance.

deadLetterSecret

string

Dead letter storage secret for key-based authentication. Will be obfuscated during read.

deadLetterUri

string

Dead letter storage URL for identity-based authentication.

endpointType string:

EventGrid

The type of Digital Twins endpoint

identity

ManagedIdentityReference

Managed identity properties for the endpoint.

provisioningState

EndpointProvisioningState

The provisioning state.

EventHub

Properties related to EventHub.

Name Type Description
authenticationType

AuthenticationType

Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified.

connectionStringPrimaryKey

string

PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.

connectionStringSecondaryKey

string

SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.

createdTime

string

Time when the Endpoint was added to DigitalTwinsInstance.

deadLetterSecret

string

Dead letter storage secret for key-based authentication. Will be obfuscated during read.

deadLetterUri

string

Dead letter storage URL for identity-based authentication.

endpointType string:

EventHub

The type of Digital Twins endpoint

endpointUri

string

The URL of the EventHub namespace for identity-based authentication. It must include the protocol 'sb://'.

entityPath

string

The EventHub name in the EventHub namespace for identity-based authentication.

identity

ManagedIdentityReference

Managed identity properties for the endpoint.

provisioningState

EndpointProvisioningState

The provisioning state.

IdentityType

The type of managed identity used.

Name Type Description
SystemAssigned

string

UserAssigned

string

ManagedIdentityReference

The properties of the Managed Identity.

Name Type Description
type

IdentityType

The type of managed identity used.

userAssignedIdentity

string

The user identity ARM resource id if the managed identity type is 'UserAssigned'.

ServiceBus

Properties related to ServiceBus.

Name Type Description
authenticationType

AuthenticationType

Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified.

createdTime

string

Time when the Endpoint was added to DigitalTwinsInstance.

deadLetterSecret

string

Dead letter storage secret for key-based authentication. Will be obfuscated during read.

deadLetterUri

string

Dead letter storage URL for identity-based authentication.

endpointType string:

ServiceBus

The type of Digital Twins endpoint

endpointUri

string

The URL of the ServiceBus namespace for identity-based authentication. It must include the protocol 'sb://'.

entityPath

string

The ServiceBus Topic name for identity-based authentication.

identity

ManagedIdentityReference

Managed identity properties for the endpoint.

primaryConnectionString

string

PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.

provisioningState

EndpointProvisioningState

The provisioning state.

secondaryConnectionString

string

SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.

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.