Edit

Update-AzDigitalTwinsEndpoint

This cmdlet is part of a Preview module. Preview versions aren't recommended for use in production environments. For more information, see https://aka.ms/azps-refstatus.

Update DigitalTwinsInstance endpoint.

Syntax

EventHub (Default)

Update-AzDigitalTwinsEndpoint
    -EndpointName <String>
    -ResourceGroupName <String>
    -ResourceName <String>
    -EndpointType <String>
    -ConnectionStringPrimaryKey <String>
    [-SubscriptionId <String>]
    [-EndpointDescription <IDigitalTwinsEndpointResource>]
    [-AuthenticationType <String>]
    [-ConnectionStringSecondaryKey <String>]
    [-DeadLetterSecret <String>]
    [-DeadLetterUri <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ServiceBus

Update-AzDigitalTwinsEndpoint
    -EndpointName <String>
    -ResourceGroupName <String>
    -ResourceName <String>
    -EndpointType <String>
    -PrimaryConnectionString <String>
    [-SubscriptionId <String>]
    [-EndpointDescription <IDigitalTwinsEndpointResource>]
    [-AuthenticationType <String>]
    [-DeadLetterUri <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

EventGrid

Update-AzDigitalTwinsEndpoint
    -EndpointName <String>
    -ResourceGroupName <String>
    -ResourceName <String>
    -EndpointType <String>
    -TopicEndpoint <String>
    -AccessKey1 <String>
    [-SubscriptionId <String>]
    [-EndpointDescription <IDigitalTwinsEndpointResource>]
    [-AuthenticationType <String>]
    [-DeadLetterUri <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update DigitalTwinsInstance endpoint.

Examples

Example 1: Update an AzDigitalTwinsEndpoint for Eventhub

Update-AzDigitalTwinsEndpoint -EndpointName azps-dt-eh -EndpointType EventHub -ResourceGroupName azps_test_group -ResourceName azps-digitaltwins-instance -ConnectionStringPrimaryKey 'Endpoint=sb://azps-eventhubs.servicebus.windows.net/;SharedAccessKeyName=abc123;SharedAccessKey=******;EntityPath=azps-eh' -AuthenticationType 'KeyBased'
AuthenticationType           : KeyBased
CreatedTime                  : 2025-06-06 11:16:50 AM
DeadLetterSecret             :
DeadLetterUri                :
EndpointType                 : EventHub
Id                           : /subscriptions/{subId}/resourceGroups/azps_test_group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/azps-digitaltwins-instance/endpoints/az
                               ps-dt-eh
Name                         : azps-dt-eh
Property                     : {
                                 "endpointType": "EventHub",
                                 "provisioningState": "Succeeded",
                                 "createdTime": "2025-06-06T11:16:50.9480318Z",
                                 "authenticationType": "KeyBased",
                                 "connectionStringPrimaryKey": "Endpoint=sb://(PLACEHOLDER)/;SharedAccessKeyName=(PLACEHOLDER);SharedAccessKey=(PLACEHOLDER);EntityPath=(PLACEHOLDER)"
                               }
ProvisioningState            : Succeeded
ResourceGroupName            : azps_test_group
SystemDataCreatedAt          : 2025-06-06 11:16:50 AM
SystemDataCreatedBy          : xxxxx.xxxxx@microsoft.com
SystemDataCreatedByType      : User
SystemDataLastModifiedAt     : 2025-06-06 11:18:27 AM
SystemDataLastModifiedBy     : xxxxx.xxxxx@microsoft.com
SystemDataLastModifiedByType : User
Type                         : Microsoft.DigitalTwins/digitalTwinsInstances/endpoints

Update an AzDigitalTwinsEndpoint for Eventhub by connectionStringPrimaryKey

Example 2: Update an AzDigitalTwinsEndpoint for EventGrid

Update-AzDigitalTwinsEndpoint -EndpointName azps-dt-eg -EndpointType EventGrid -ResourceGroupName azps_test_group -ResourceName azps-digitaltwins-instance -TopicEndpoint 'https://azps-eventgrid.eastus-1.eventgrid.azure.net/api/events' -AccessKey1 '******=' -AuthenticationType 'KeyBased'
AuthenticationType           : KeyBased
CreatedTime                  : 2025-06-06 11:22:11 AM
DeadLetterSecret             :
DeadLetterUri                :
EndpointType                 : EventGrid
Id                           : /subscriptions/{subId}/resourceGroups/azps_test_group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/azps-digitaltwins-instance/endpoints/az
                               ps-dt-eg
Name                         : azps-dt-eg
Property                     : {
                                 "endpointType": "EventGrid",
                                 "provisioningState": "Succeeded",
                                 "createdTime": "2025-06-06T11:22:11.8112861Z",
                                 "authenticationType": "KeyBased",
                                 "TopicEndpoint": "https://azps-eventgrid.eastus-1.eventgrid.azure.net/api/events",
                                 "accessKey1": "(PLACEHOLDER)"
                               }
ProvisioningState            : Succeeded
ResourceGroupName            : azps_test_group
SystemDataCreatedAt          : 2025-06-06 11:22:11 AM
SystemDataCreatedBy          : xxxxx.xxxxx@microsoft.com
SystemDataCreatedByType      : User
SystemDataLastModifiedAt     : 2025-06-06 11:22:48 AM
SystemDataLastModifiedBy     : xxxxx.xxxxx@microsoft.com
SystemDataLastModifiedByType : User
Type                         : Microsoft.DigitalTwins/digitalTwinsInstances/endpoints

Update an AzDigitalTwinsEndpoint for Eventhub by TopicEndpoint and accessKey1

Example 3: Update an AzDigitalTwinsEndpoint for ServiceBus

Update-AzDigitalTwinsEndpoint -EndpointName azps-dt-sb -EndpointType ServiceBus -ResourceGroupName azps_test_group -ResourceName azps-digitaltwins-instance -PrimaryConnectionString "Endpoint=sb://azps-servicebus.servicebus.windows.net/;SharedAccessKeyName=abc123;SharedAccessKey=******;EntityPath=azps-sb" -AuthenticationType 'KeyBased'
AuthenticationType           : KeyBased
CreatedTime                  : 2025-06-06 09:52:54 AM
DeadLetterSecret             :
DeadLetterUri                :
EndpointType                 : ServiceBus
Id                           : /subscriptions/{subId}/resourceGroups/azps_test_group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/azps-digitaltwins-instance/endpoints/az
                               ps-dt-sb
Name                         : azps-dt-sb
Property                     : {
                                 "endpointType": "ServiceBus",
                                 "provisioningState": "Succeeded",
                                 "createdTime": "2025-06-06T09:52:54.5788470Z",
                                 "authenticationType": "KeyBased",
                                 "primaryConnectionString": "Endpoint=sb://(PLACEHOLDER)/;SharedAccessKeyName=(PLACEHOLDER);SharedAccessKey=(PLACEHOLDER);EntityPath=(PLACEHOLDER)"
                               }
ProvisioningState            : Succeeded
ResourceGroupName            : azps_test_group
SystemDataCreatedAt          : 2025-06-06 09:52:53 AM
SystemDataCreatedBy          : xxxxx.xxxxx@microsoft.com
SystemDataCreatedByType      : User
SystemDataLastModifiedAt     : 2025-06-06 09:52:53 AM
SystemDataLastModifiedBy     : xxxxx.xxxxx@microsoft.com
SystemDataLastModifiedByType : User
Type                         : Microsoft.DigitalTwins/digitalTwinsInstances/endpoints

Update an AzDigitalTwinsEndpoint for ServicBus by PrimaryConnectionString

Parameters

-AccessKey1

The subscription identifier.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EventGrid
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AsJob

Run the command as a job

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ConnectionStringPrimaryKey

The subscription identifier.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EventHub
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ConnectionStringSecondaryKey

The subscription identifier.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EventHub
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeadLetterSecret

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EventHub
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeadLetterUri

Dead letter storage URL for identity-based authentication.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndpointDescription

DigitalTwinsInstance endpoint resource. To construct, see NOTES section for ENDPOINTDESCRIPTION properties and create a hash table.

Parameter properties

Type:IDigitalTwinsEndpointResource
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-EndpointName

Name of Endpoint Resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndpointType

The type of Digital Twins endpoint

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NoWait

Run the command asynchronously

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrimaryConnectionString

The subscription identifier.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ServiceBus
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group that contains the DigitalTwinsInstance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceName

The name of the DigitalTwinsInstance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionId

The subscription identifier.

Parameter properties

Type:String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TopicEndpoint

The subscription identifier.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EventGrid
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

IDigitalTwinsEndpointResource

Outputs

IDigitalTwinsEndpointResource