이벤트 구독을 업데이트합니다.
기존 이벤트 구독을 비동기적으로 업데이트합니다.
PATCH https://management.azure.com/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}?api-version=2022-06-15
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
eventSubscriptionName
|
path |
True
|
string
|
업데이트할 이벤트 구독의 이름입니다.
|
scope
|
path |
True
|
string
|
기존 이벤트 구독의 scope. scope 구독, 리소스 그룹 또는 리소스 공급자 네임스페이스 또는 EventGrid 항목에 속하는 최상위 리소스일 수 있습니다. 예를 들어 구독에 '/subscriptions/{subscriptionId}/'를 사용하고 리소스 그룹에는 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'을 사용합니다. 및 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' 및 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicNameEventGrid 토픽의 경우 }'입니다.
|
api-version
|
query |
True
|
string
|
클라이언트 요청과 함께 사용할 API의 버전입니다.
|
요청 본문
Name |
형식 |
Description |
deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
deadLetterWithResourceIdentity
|
DeadLetterWithResourceIdentity
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
부모 리소스(토픽/도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
deliveryWithResourceIdentity
|
DeliveryWithResourceIdentity
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
부모 리소스(토픽/도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
destination
|
EventSubscriptionDestination:
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
eventDeliverySchema
|
EventDeliverySchema
|
이벤트 구독에 대한 이벤트 배달 스키마입니다.
|
expirationTimeUtc
|
string
|
이벤트 구독의 만료 시간에 대한 정보입니다.
|
filter
|
EventSubscriptionFilter
|
이벤트 구독에 대한 필터에 대한 정보입니다.
|
labels
|
string[]
|
사용자 정의 레이블 목록입니다.
|
retryPolicy
|
RetryPolicy
|
이벤트에 대한 재시도 정책입니다. 이를 사용하여 최대 배달 시도 횟수 및 이벤트에 대한 라이브 시간을 구성할 수 있습니다.
|
응답
Name |
형식 |
Description |
201 Created
|
EventSubscription
|
EventSubscription 업데이트 요청이 수락되었습니다.
|
Other Status Codes
|
|
오류 응답: ***
400 잘못된 요청.
500 내부 서버 오류.
|
예제
EventSubscriptions_UpdateForCustomTopic
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "https://requestb.in/15ksip71"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopic(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": "https://requestb.in/15ksip71"}},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopic() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.WebHookEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
EndpointURL: to.Ptr("https://requestb.in/15ksip71"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic.json
*/
async function eventSubscriptionsUpdateForCustomTopic() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "WebHook",
endpointUrl: "https://requestb.in/15ksip71",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new WebHookEventSubscriptionDestination()
{
Endpoint = new Uri("https://requestb.in/15ksip71"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "AzureFunction",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"
}
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new AzureFunctionEventSubscriptionDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("ExamplePrefix")
.withSubjectEndsWith("ExampleSuffix")
.withIsSubjectCaseSensitive(false))
.withDeadLetterDestination(
new StorageBlobDeadLetterDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg")
.withBlobContainerName("contosocontainer")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_azure_function_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"blobContainerName": "contosocontainer",
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
},
"destination": {
"endpointType": "AzureFunction",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"
},
},
"filter": {
"isSubjectCaseSensitive": False,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix",
},
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{
EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob),
Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{
BlobContainerName: to.Ptr("contosocontainer"),
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
},
},
Destination: &armeventgrid.AzureFunctionEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeAzureFunction),
Properties: &armeventgrid.AzureFunctionEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(false),
SubjectBeginsWith: to.Ptr("ExamplePrefix"),
SubjectEndsWith: to.Ptr("ExampleSuffix"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
deadLetterDestination: {
blobContainerName: "contosocontainer",
endpointType: "StorageBlob",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
destination: {
endpointType: "AzureFunction",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc",
},
filter: {
isSubjectCaseSensitive: false,
subjectBeginsWith: "ExamplePrefix",
subjectEndsWith: "ExampleSuffix",
},
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new AzureFunctionEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "ExamplePrefix",
SubjectEndsWith = "ExampleSuffix",
IsSubjectCaseSensitive = false,
},
DeadLetterDestination = new StorageBlobDeadLetterDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
BlobContainerName = "contosocontainer",
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"
},
"endpointType": "AzureFunction"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"provisioningState": "Creating",
"labels": null,
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_EventHubDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_EventHubDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicEventHubDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new EventHubEventSubscriptionDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_event_hub_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"
},
},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicEventHubDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.EventHubEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub),
Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicEventHubDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "EventHub",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new EventHubEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"
},
"endpointType": "EventHub"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "HybridConnection",
"properties": {
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new HybridConnectionEventSubscriptionDestination()
.withResourceId(
"/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_hybrid_connection_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {
"endpointType": "HybridConnection",
"properties": {
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"
},
},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.HybridConnectionEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeHybridConnection),
Properties: &armeventgrid.HybridConnectionEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "HybridConnection",
resourceId:
"/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new HybridConnectionEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"
},
"endpointType": "HybridConnection"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "ServiceBusQueue",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"
}
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination;
import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new ServiceBusQueueEventSubscriptionDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("ExamplePrefix")
.withSubjectEndsWith("ExampleSuffix")
.withIsSubjectCaseSensitive(false))
.withDeadLetterDestination(
new StorageBlobDeadLetterDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg")
.withBlobContainerName("contosocontainer")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_service_bus_queue_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"blobContainerName": "contosocontainer",
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
},
"destination": {
"endpointType": "ServiceBusQueue",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"
},
},
"filter": {
"isSubjectCaseSensitive": False,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix",
},
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{
EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob),
Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{
BlobContainerName: to.Ptr("contosocontainer"),
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
},
},
Destination: &armeventgrid.ServiceBusQueueEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusQueue),
Properties: &armeventgrid.ServiceBusQueueEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(false),
SubjectBeginsWith: to.Ptr("ExamplePrefix"),
SubjectEndsWith: to.Ptr("ExampleSuffix"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
deadLetterDestination: {
blobContainerName: "contosocontainer",
endpointType: "StorageBlob",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
destination: {
endpointType: "ServiceBusQueue",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ",
},
filter: {
isSubjectCaseSensitive: false,
subjectBeginsWith: "ExamplePrefix",
subjectEndsWith: "ExampleSuffix",
},
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new ServiceBusQueueEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "ExamplePrefix",
SubjectEndsWith = "ExampleSuffix",
IsSubjectCaseSensitive = false,
},
DeadLetterDestination = new StorageBlobDeadLetterDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
BlobContainerName = "contosocontainer",
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"
},
"endpointType": "ServiceBusQueue"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"provisioningState": "Creating",
"labels": null,
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "ServiceBusTopic",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new ServiceBusTopicEventSubscriptionDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_service_bus_topic_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {
"endpointType": "ServiceBusTopic",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"
},
},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.ServiceBusTopicEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusTopic),
Properties: &armeventgrid.ServiceBusTopicEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "ServiceBusTopic",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new ServiceBusTopicEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"
},
"endpointType": "ServiceBusTopic"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "StorageQueue",
"properties": {
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"queueName": "queue1",
"queueMessageTimeToLiveInSeconds": 300
}
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination;
import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicStorageQueueDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new StorageQueueEventSubscriptionDestination()
.withResourceId(
"/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg")
.withQueueName("queue1")
.withQueueMessageTimeToLiveInSeconds(300L))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("ExamplePrefix")
.withSubjectEndsWith("ExampleSuffix")
.withIsSubjectCaseSensitive(false))
.withDeadLetterDestination(
new StorageBlobDeadLetterDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg")
.withBlobContainerName("contosocontainer")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_storage_queue_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"blobContainerName": "contosocontainer",
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
},
"destination": {
"endpointType": "StorageQueue",
"properties": {
"queueMessageTimeToLiveInSeconds": 300,
"queueName": "queue1",
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
},
"filter": {
"isSubjectCaseSensitive": False,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix",
},
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicStorageQueueDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{
EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob),
Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{
BlobContainerName: to.Ptr("contosocontainer"),
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
},
},
Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue),
Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{
QueueMessageTimeToLiveInSeconds: to.Ptr[int64](300),
QueueName: to.Ptr("queue1"),
ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(false),
SubjectBeginsWith: to.Ptr("ExamplePrefix"),
SubjectEndsWith: to.Ptr("ExampleSuffix"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicStorageQueueDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
deadLetterDestination: {
blobContainerName: "contosocontainer",
endpointType: "StorageBlob",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
destination: {
endpointType: "StorageQueue",
queueMessageTimeToLiveInSeconds: 300,
queueName: "queue1",
resourceId:
"/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
},
filter: {
isSubjectCaseSensitive: false,
subjectBeginsWith: "ExamplePrefix",
subjectEndsWith: "ExampleSuffix",
},
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new StorageQueueEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
QueueName = "queue1",
QueueMessageTimeToLiveInSeconds = 300,
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "ExamplePrefix",
SubjectEndsWith = "ExampleSuffix",
IsSubjectCaseSensitive = false,
},
DeadLetterDestination = new StorageBlobDeadLetterDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"),
BlobContainerName = "contosocontainer",
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"resourceId": "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"queueName": "queue1",
"queueMessageTimeToLiveInSeconds": 300
},
"endpointType": "StorageQueue"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1",
"provisioningState": "Creating",
"labels": null,
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg",
"blobContainerName": "contosocontainer"
}
}
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForCustomTopic_WebhookDestination
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "https://requestb.in/15ksip71"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json
*/
/**
* Sample code: EventSubscriptions_UpdateForCustomTopic_WebhookDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForCustomTopicWebhookDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_custom_topic_webhook_destination.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": "https://requestb.in/15ksip71"}},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicWebhookDestination() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.WebHookEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
EndpointURL: to.Ptr("https://requestb.in/15ksip71"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json
*/
async function eventSubscriptionsUpdateForCustomTopicWebhookDestination() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "WebHook",
endpointUrl: "https://requestb.in/15ksip71",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new WebHookEventSubscriptionDestination()
{
Endpoint = new Uri("https://requestb.in/15ksip71"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForResource
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1?api-version=2022-06-15
{
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "https://requestb.in/15ksip71"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResource.json
*/
/**
* Sample code: EventSubscriptions_UpdateForResource.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForResource(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1",
"examplesubscription1",
new EventSubscriptionUpdateParameters()
.withDestination(
new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_resource.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1",
event_subscription_name="examplesubscription1",
event_subscription_update_parameters={
"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": "https://requestb.in/15ksip71"}},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResource.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResource.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.WebHookEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
EndpointURL: to.Ptr("https://requestb.in/15ksip71"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResource.json
*/
async function eventSubscriptionsUpdateForResource() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1";
const eventSubscriptionName = "examplesubscription1";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "WebHook",
endpointUrl: "https://requestb.in/15ksip71",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResource.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1";
string eventSubscriptionName = "examplesubscription1";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new WebHookEventSubscriptionDestination()
{
Endpoint = new Uri("https://requestb.in/15ksip71"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForResourceGroup
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2?api-version=2022-06-15
{
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResourceGroup.json
*/
/**
* Sample code: EventSubscriptions_UpdateForResourceGroup.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForResourceGroup(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg",
"examplesubscription2",
new EventSubscriptionUpdateParameters()
.withDestination(
new EventHubEventSubscriptionDestination()
.withResourceId(
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_resource_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg",
event_subscription_name="examplesubscription2",
event_subscription_update_parameters={
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"
},
},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResourceGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResourceGroup.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForResourceGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.EventHubEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub),
Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{
ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResourceGroup.json
*/
async function eventSubscriptionsUpdateForResourceGroup() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg";
const eventSubscriptionName = "examplesubscription2";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "EventHub",
resourceId:
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForResourceGroup.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg";
string eventSubscriptionName = "examplesubscription2";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new EventHubEventSubscriptionDestination()
{
ResourceId = new ResourceIdentifier("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2",
"name": "examplesubscription2",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
EventSubscriptions_UpdateForSubscription
샘플 요청
PATCH https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3?api-version=2022-06-15
{
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "https://requestb.in/15ksip71"
}
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [
"label1",
"label2"
]
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters;
import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination;
import java.util.Arrays;
/** Samples for EventSubscriptions Update. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForSubscription.json
*/
/**
* Sample code: EventSubscriptions_UpdateForSubscription.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsUpdateForSubscription(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.update(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"examplesubscription3",
new EventSubscriptionUpdateParameters()
.withDestination(
new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71"))
.withFilter(
new EventSubscriptionFilter()
.withSubjectBeginsWith("existingPrefix")
.withSubjectEndsWith("newSuffix")
.withIsSubjectCaseSensitive(true))
.withLabels(Arrays.asList("label1", "label2")),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventgrid import EventGridManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventgrid
# USAGE
python event_subscriptions_update_for_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventGridManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.event_subscriptions.begin_update(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
event_subscription_name="examplesubscription3",
event_subscription_update_parameters={
"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": "https://requestb.in/15ksip71"}},
"filter": {
"isSubjectCaseSensitive": True,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix",
},
"labels": ["label1", "label2"],
},
).result()
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForSubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventgrid_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForSubscription.json
func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForSubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", armeventgrid.EventSubscriptionUpdateParameters{
Destination: &armeventgrid.WebHookEventSubscriptionDestination{
EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
EndpointURL: to.Ptr("https://requestb.in/15ksip71"),
},
},
Filter: &armeventgrid.EventSubscriptionFilter{
IsSubjectCaseSensitive: to.Ptr(true),
SubjectBeginsWith: to.Ptr("existingPrefix"),
SubjectEndsWith: to.Ptr("newSuffix"),
},
Labels: []*string{
to.Ptr("label1"),
to.Ptr("label2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventGridManagementClient } = require("@azure/arm-eventgrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Asynchronously updates an existing event subscription.
*
* @summary Asynchronously updates an existing event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForSubscription.json
*/
async function eventSubscriptionsUpdateForSubscription() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4";
const eventSubscriptionName = "examplesubscription3";
const eventSubscriptionUpdateParameters = {
destination: {
endpointType: "WebHook",
endpointUrl: "https://requestb.in/15ksip71",
},
filter: {
isSubjectCaseSensitive: true,
subjectBeginsWith: "existingPrefix",
subjectEndsWith: "newSuffix",
},
labels: ["label1", "label2"],
};
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.beginUpdateAndWait(
scope,
eventSubscriptionName,
eventSubscriptionUpdateParameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EventGrid;
using Azure.ResourceManager.EventGrid.Models;
// Generated from example definition: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_UpdateForSubscription.json
// this example is just showing the usage of "EventSubscriptions_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this EventSubscriptionResource created on azure
// for more information of creating EventSubscriptionResource, please refer to the document of EventSubscriptionResource
string scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4";
string eventSubscriptionName = "examplesubscription3";
ResourceIdentifier eventSubscriptionResourceId = EventSubscriptionResource.CreateResourceIdentifier(scope, eventSubscriptionName);
EventSubscriptionResource eventSubscription = client.GetEventSubscriptionResource(eventSubscriptionResourceId);
// invoke the operation
EventGridSubscriptionPatch patch = new EventGridSubscriptionPatch()
{
Destination = new WebHookEventSubscriptionDestination()
{
Endpoint = new Uri("https://requestb.in/15ksip71"),
},
Filter = new EventSubscriptionFilter()
{
SubjectBeginsWith = "existingPrefix",
SubjectEndsWith = "newSuffix",
IsSubjectCaseSensitive = true,
},
Labels =
{
"label1","label2"
},
};
ArmOperation<EventSubscriptionResource> lro = await eventSubscription.UpdateAsync(WaitUntil.Completed, patch);
EventSubscriptionResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventGridSubscriptionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": true,
"subjectBeginsWith": "existingPrefix",
"subjectEndsWith": "newSuffix"
},
"labels": [],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3",
"name": "examplesubscription3",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
정의
AzureFunctionEventSubscriptionDestination
이벤트 구독에 대한 azure 함수 대상에 대한 정보입니다.
Name |
형식 |
Default value |
Description |
endpointType
|
string:
AzureFunction
|
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
|
배달 특성 세부 정보입니다.
|
properties.maxEventsPerBatch
|
integer
|
1
|
일괄 처리당 최대 이벤트 수입니다.
|
properties.preferredBatchSizeInKilobytes
|
integer
|
64
|
기본 일괄 처리 크기(킬로바이트)입니다.
|
properties.resourceId
|
string
|
|
이벤트 구독의 Azure Function 대상 엔드포인트를 나타내는 Azure 리소스 ID입니다.
|
BoolEqualsAdvancedFilter
BoolEquals 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
BoolEquals
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
value
|
boolean
|
부울 필터 값입니다.
|
createdByType
리소스를 만든 ID의 형식입니다.
Name |
형식 |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
DeadLetterWithResourceIdentity
리소스 ID를 사용하여 배달 못한 대상에 대한 정보입니다.
DeliveryWithResourceIdentity
리소스 ID가 있는 이벤트 구독의 배달에 대한 정보입니다.
Name |
형식 |
Description |
destination
|
EventSubscriptionDestination:
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
identity
|
EventSubscriptionIdentity
|
이벤트를 배달할 때 사용할 ID입니다.
|
DynamicDeliveryAttributeMapping
동적 배달 특성 매핑 세부 정보입니다.
Name |
형식 |
Description |
name
|
string
|
배달 특성 또는 헤더의 이름입니다.
|
properties.sourceField
|
string
|
특성 값이 포함된 이벤트의 JSON 경로입니다.
|
type
|
string:
Dynamic
|
배달 특성 또는 헤더 이름의 형식입니다.
|
EventDeliverySchema
이벤트 구독에 대한 이벤트 배달 스키마입니다.
Name |
형식 |
Description |
CloudEventSchemaV1_0
|
string
|
|
CustomInputSchema
|
string
|
|
EventGridSchema
|
string
|
|
EventHubEventSubscriptionDestination
이벤트 구독의 이벤트 허브 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
EventHub
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
배달 특성 세부 정보입니다.
|
properties.resourceId
|
string
|
이벤트 구독의 Event Hub 대상 엔드포인트를 나타내는 Azure 리소스 ID입니다.
|
EventSubscription
이벤트 구독
Name |
형식 |
Default value |
Description |
id
|
string
|
|
리소스의 정규화된 식별자입니다.
|
name
|
string
|
|
리소스의 이름입니다.
|
properties.deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
properties.deadLetterWithResourceIdentity
|
DeadLetterWithResourceIdentity
|
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
부모 리소스(즉, 토픽 또는 도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
properties.deliveryWithResourceIdentity
|
DeliveryWithResourceIdentity
|
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
부모 리소스(즉, 토픽 또는 도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
properties.destination
|
EventSubscriptionDestination:
|
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
properties.eventDeliverySchema
|
EventDeliverySchema
|
EventGridSchema
|
이벤트 구독에 대한 이벤트 배달 스키마입니다.
|
properties.expirationTimeUtc
|
string
|
|
이벤트 구독의 만료 시간입니다.
|
properties.filter
|
EventSubscriptionFilter
|
|
이벤트 구독에 대한 필터에 대한 정보입니다.
|
properties.labels
|
string[]
|
|
사용자 정의 레이블 목록입니다.
|
properties.provisioningState
|
EventSubscriptionProvisioningState
|
|
이벤트 구독의 프로비전 상태입니다.
|
properties.retryPolicy
|
RetryPolicy
|
|
이벤트에 대한 재시도 정책입니다. 이를 사용하여 최대 배달 시도 횟수 및 이벤트에 대한 라이브 시간을 구성할 수 있습니다.
|
properties.topic
|
string
|
|
이벤트 구독 토픽의 이름입니다.
|
systemData
|
systemData
|
|
이벤트 구독 리소스와 관련된 시스템 메타데이터입니다.
|
type
|
string
|
|
리소스 유형입니다.
|
EventSubscriptionFilter
이벤트 구독을 필터링합니다.
Name |
형식 |
Default value |
Description |
advancedFilters
|
AdvancedFilter[]:
|
|
이벤트 구독을 필터링하는 데 사용되는 고급 필터의 배열입니다.
|
enableAdvancedFilteringOnArrays
|
boolean
|
|
단수 값을 예상하는 대신 값 배열에 대해 고급 필터를 평가할 수 있습니다.
|
includedEventTypes
|
string[]
|
|
이벤트 구독의 일부가 되어야 하는 적용 가능한 이벤트 유형 목록입니다. 모든 기본 이벤트 형식을 구독하려는 경우 IncludedEventTypes를 null로 설정합니다.
|
isSubjectCaseSensitive
|
boolean
|
False
|
필터의 SubjectBeginsWith 및 SubjectEndsWith 속성을 대/소문자를 구분하여 비교할지 지정합니다.
|
subjectBeginsWith
|
string
|
|
리소스 경로 접두사를 기반으로 이벤트 구독에 대한 이벤트를 필터링하는 선택적 문자열입니다.
이 형식은 이벤트의 게시자에 따라 달라집니다.
와일드카드 문자는 이 경로에서 지원되지 않습니다.
|
subjectEndsWith
|
string
|
|
리소스 경로 접미사를 기반으로 이벤트 구독에 대한 이벤트를 필터링하는 선택적 문자열입니다.
와일드카드 문자는 이 경로에서 지원되지 않습니다.
|
EventSubscriptionIdentity
이벤트 구독이 있는 ID 정보입니다.
Name |
형식 |
Description |
type
|
EventSubscriptionIdentityType
|
사용되는 관리 ID의 유형입니다. 'SystemAssigned, UserAssigned' 형식에는 암시적으로 생성된 ID와 사용자 할당 ID 집합이 모두 포함됩니다. 'None' 형식은 모든 ID를 제거합니다.
|
userAssignedIdentity
|
string
|
리소스와 연결된 사용자 ID입니다.
|
EventSubscriptionIdentityType
사용되는 관리 ID의 유형입니다. 'SystemAssigned, UserAssigned' 형식에는 암시적으로 생성된 ID와 사용자 할당 ID 집합이 모두 포함됩니다. 'None' 형식은 모든 ID를 제거합니다.
Name |
형식 |
Description |
SystemAssigned
|
string
|
|
UserAssigned
|
string
|
|
EventSubscriptionProvisioningState
이벤트 구독의 프로비전 상태입니다.
Name |
형식 |
Description |
AwaitingManualAction
|
string
|
|
Canceled
|
string
|
|
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
EventSubscriptionUpdateParameters
이벤트 구독 업데이트의 속성입니다.
Name |
형식 |
Description |
deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
deadLetterWithResourceIdentity
|
DeadLetterWithResourceIdentity
|
이벤트 구독의 배달 못한 편지 대상입니다. 대상에 배달할 수 없는 모든 이벤트는 배달 못한 편지 대상으로 전송됩니다.
부모 리소스(토픽/도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
deliveryWithResourceIdentity
|
DeliveryWithResourceIdentity
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
부모 리소스(토픽/도메인)에서 관리 ID 설정을 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 가져옵니다.
|
destination
|
EventSubscriptionDestination:
|
이벤트 구독에 대해 이벤트를 배달해야 하는 대상에 대한 정보입니다.
Azure Event Grid ID를 사용하여 배달/배달 못 한 편지 중에 사용되는 인증 토큰을 획득합니다.
|
eventDeliverySchema
|
EventDeliverySchema
|
이벤트 구독에 대한 이벤트 배달 스키마입니다.
|
expirationTimeUtc
|
string
|
이벤트 구독의 만료 시간에 대한 정보입니다.
|
filter
|
EventSubscriptionFilter
|
이벤트 구독에 대한 필터에 대한 정보입니다.
|
labels
|
string[]
|
사용자 정의 레이블 목록입니다.
|
retryPolicy
|
RetryPolicy
|
이벤트에 대한 재시도 정책입니다. 이를 사용하여 최대 배달 시도 횟수 및 이벤트에 대한 라이브 시간을 구성할 수 있습니다.
|
HybridConnectionEventSubscriptionDestination
이벤트 구독의 HybridConnection 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
HybridConnection
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
배달 특성 세부 정보입니다.
|
properties.resourceId
|
string
|
이벤트 구독의 대상인 하이브리드 연결의 Azure 리소스 ID입니다.
|
IsNotNullAdvancedFilter
IsNotNull 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
IsNotNull
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
IsNullOrUndefinedAdvancedFilter
IsNullOrUndefined 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
IsNullOrUndefined
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
NumberGreaterThanAdvancedFilter
NumberGreaterThan 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberGreaterThan
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
value
|
number
|
필터 값입니다.
|
NumberGreaterThanOrEqualsAdvancedFilter
NumberGreaterThanOrEquals 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberGreaterThanOrEquals
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
value
|
number
|
필터 값입니다.
|
NumberInAdvancedFilter
NumberIn 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberIn
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
number[]
|
필터 값 집합입니다.
|
NumberInRangeAdvancedFilter
NumberInRange 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberInRange
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
number[]
|
필터 값 집합입니다.
|
NumberLessThanAdvancedFilter
NumberLessThan 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberLessThan
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
value
|
number
|
필터 값입니다.
|
NumberLessThanOrEqualsAdvancedFilter
NumberLessThanOrEquals 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberLessThanOrEquals
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
value
|
number
|
필터 값입니다.
|
NumberNotInAdvancedFilter
NumberNotIn 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberNotIn
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
number[]
|
필터 값 집합입니다.
|
NumberNotInRangeAdvancedFilter
NumberNotInRange 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
NumberNotInRange
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
number[]
|
필터 값 집합입니다.
|
RetryPolicy
이벤트 구독에 대한 재시도 정책에 대한 정보입니다.
Name |
형식 |
Default value |
Description |
eventTimeToLiveInMinutes
|
integer
|
1440
|
이벤트에 대한 Time To Live(분)입니다.
|
maxDeliveryAttempts
|
integer
|
30
|
이벤트에 대한 최대 배달 다시 시도 횟수입니다.
|
ServiceBusQueueEventSubscriptionDestination
이벤트 구독에 대한 서비스 버스 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
ServiceBusQueue
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
배달 특성 세부 정보입니다.
|
properties.resourceId
|
string
|
이벤트 구독의 Service Bus 대상 엔드포인트를 나타내는 Azure 리소스 ID입니다.
|
ServiceBusTopicEventSubscriptionDestination
이벤트 구독의 Service Bus 토픽 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
ServiceBusTopic
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
배달 특성 세부 정보입니다.
|
properties.resourceId
|
string
|
이벤트 구독의 Service Bus 토픽 대상의 엔드포인트를 나타내는 Azure 리소스 ID입니다.
|
StaticDeliveryAttributeMapping
정적 배달 특성 매핑 세부 정보입니다.
Name |
형식 |
Default value |
Description |
name
|
string
|
|
배달 특성 또는 헤더의 이름입니다.
|
properties.isSecret
|
boolean
|
False
|
특성에 중요한 정보가 포함되어 있는지 여부를 나타내는 부울 플래그입니다.
|
properties.value
|
string
|
|
배달 특성의 값입니다.
|
type
|
string:
Static
|
|
배달 특성 또는 헤더 이름의 형식입니다.
|
StorageBlobDeadLetterDestination
스토리지 Blob 기반 배달 못한 편지 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
StorageBlob
|
배달 못한 편지 대상에 대한 엔드포인트 유형
|
properties.blobContainerName
|
string
|
배달 못 한 이벤트 대상인 Storage Blob 컨테이너의 이름입니다.
|
properties.resourceId
|
string
|
배달 못 한 이벤트 대상인 스토리지 계정의 Azure 리소스 ID
|
StorageQueueEventSubscriptionDestination
이벤트 구독의 스토리지 큐 대상에 대한 정보입니다.
Name |
형식 |
Description |
endpointType
|
string:
StorageQueue
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.queueMessageTimeToLiveInSeconds
|
integer
|
스토리지 큐 메시지 시간(초)입니다.
|
properties.queueName
|
string
|
이벤트 구독의 대상인 스토리지 계정 아래의 Storage 큐 이름입니다.
|
properties.resourceId
|
string
|
이벤트 구독의 대상인 큐를 포함하는 스토리지 계정의 Azure 리소스 ID입니다.
|
StringBeginsWithAdvancedFilter
StringBeginsWith 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringBeginsWith
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringContainsAdvancedFilter
StringContains 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringContains
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringEndsWithAdvancedFilter
StringEndsWith 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringEndsWith
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringInAdvancedFilter
StringIn 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringIn
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringNotBeginsWithAdvancedFilter
StringNotBeginsWith 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringNotBeginsWith
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringNotContainsAdvancedFilter
StringNotContains 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringNotContains
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringNotEndsWithAdvancedFilter
StringNotEndsWith 고급 필터입니다.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringNotEndsWith
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
StringNotInAdvancedFilter
StringNotIn 고급 필터.
Name |
형식 |
Description |
key
|
string
|
필터링할 이벤트에 있는 필드/속성입니다.
|
operatorType
|
string:
StringNotIn
|
필터링에 사용되는 연산자 형식(예: NumberIn, StringContains, BoolEquals 등).
|
values
|
string[]
|
필터 값 집합입니다.
|
systemData
리소스 만들기 및 마지막 수정과 관련된 메타데이터입니다.
Name |
형식 |
Description |
createdAt
|
string
|
UTC(리소스 만들기)의 타임스탬프입니다.
|
createdBy
|
string
|
리소스를 만든 ID입니다.
|
createdByType
|
createdByType
|
리소스를 만든 ID의 형식입니다.
|
lastModifiedAt
|
string
|
리소스 마지막 수정의 타임스탬프(UTC)
|
lastModifiedBy
|
string
|
리소스를 마지막으로 수정한 ID입니다.
|
lastModifiedByType
|
createdByType
|
리소스를 마지막으로 수정한 ID 유형입니다.
|
WebHookEventSubscriptionDestination
이벤트 구독의 웹후크 대상에 대한 정보입니다.
Name |
형식 |
Default value |
Description |
endpointType
|
string:
WebHook
|
|
이벤트 구독 대상에 대한 엔드포인트의 유형입니다.
|
properties.azureActiveDirectoryApplicationIdOrUri
|
string
|
|
배달 요청에 전달자 토큰으로 포함될 액세스 토큰을 가져오는 Azure Active Directory 애플리케이션 ID 또는 URI입니다.
|
properties.azureActiveDirectoryTenantId
|
string
|
|
배달 요청에 전달자 토큰으로 포함될 액세스 토큰을 가져오는 Azure Active Directory 테넌트 ID입니다.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
|
배달 특성 세부 정보입니다.
|
properties.endpointBaseUrl
|
string
|
|
이벤트 구독 대상의 엔드포인트를 나타내는 기본 URL입니다.
|
properties.endpointUrl
|
string
|
|
이벤트 구독 대상의 엔드포인트를 나타내는 URL입니다.
|
properties.maxEventsPerBatch
|
integer
|
1
|
일괄 처리당 최대 이벤트 수입니다.
|
properties.preferredBatchSizeInKilobytes
|
integer
|
64
|
기본 일괄 처리 크기(킬로바이트)입니다.
|