获取事件订阅。
获取事件订阅的属性。
GET https://management.azure.com/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}?api-version=2022-06-15
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
eventSubscriptionName
|
path |
True
|
string
|
事件订阅的名称。
|
scope
|
path |
True
|
string
|
事件订阅的范围。 范围可以是订阅、资源组、属于资源提供程序命名空间的顶级资源或 EventGrid 主题。 例如,对订阅使用“/subscriptions/{subscriptionId}/”,对资源组使用“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}”, 和“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”,以及 EventGrid 主题的“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}”。
|
api-version
|
query |
True
|
string
|
要与客户端请求一起使用的 API 的版本。
|
响应
示例
EventSubscriptions_GetForCustomTopic
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopic(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic.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/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_GetForCustomTopic.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopic() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// Destination: &armeventgrid.WebHookEventSubscriptionDestination{
// EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
// Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
// EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"),
// },
// },
// Filter: &armeventgrid.EventSubscriptionFilter{
// IsSubjectCaseSensitive: to.Ptr(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic.json
*/
async function eventSubscriptionsGetForCustomTopic() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"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_GetForCustomTopic_AzureFunctionDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicAzureFunctionDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_AzureFunctionDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicAzureFunctionDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.json
*/
async function eventSubscriptionsGetForCustomTopicAzureFunctionDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_AzureFunctionDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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"
},
"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_GetForCustomTopic_EventHubDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_EventHubDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_EventHubDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicEventHubDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_EventHubDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicEventHubDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_EventHubDestination.json
*/
async function eventSubscriptionsGetForCustomTopicEventHubDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_EventHubDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"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_GetForCustomTopic_HybridConnectionDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicHybridConnectionDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_HybridConnectionDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicHybridConnectionDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.json
*/
async function eventSubscriptionsGetForCustomTopicHybridConnectionDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_HybridConnectionDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"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_GetForCustomTopic_ServiceBusQueueDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicServiceBusQueueDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_ServiceBusQueueDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicServiceBusQueueDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.json
*/
async function eventSubscriptionsGetForCustomTopicServiceBusQueueDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_ServiceBusQueueDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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"
},
"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_GetForCustomTopic_ServiceBusTopicDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicServiceBusTopicDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_ServiceBusTopicDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicServiceBusTopicDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.json
*/
async function eventSubscriptionsGetForCustomTopicServiceBusTopicDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_ServiceBusTopicDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"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_GetForCustomTopic_StorageQueueDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_StorageQueueDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_StorageQueueDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicStorageQueueDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_StorageQueueDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicStorageQueueDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_StorageQueueDestination.json
*/
async function eventSubscriptionsGetForCustomTopicStorageQueueDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_StorageQueueDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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"
},
"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_GetForCustomTopic_WebhookDestination
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_WebhookDestination.json
*/
/**
* Sample code: EventSubscriptions_GetForCustomTopic_WebhookDestination.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForCustomTopicWebhookDestination(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_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/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_GetForCustomTopic_WebhookDestination.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicWebhookDestination() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// Destination: &armeventgrid.WebHookEventSubscriptionDestination{
// EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
// Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
// EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"),
// },
// },
// Filter: &armeventgrid.EventSubscriptionFilter{
// IsSubjectCaseSensitive: to.Ptr(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForCustomTopic_WebhookDestination.json
*/
async function eventSubscriptionsGetForCustomTopicWebhookDestination() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForCustomTopic_WebhookDestination.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"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_GetForResource
示例请求
GET 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
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResource.json
*/
/**
* Sample code: EventSubscriptions_GetForResource.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1",
"examplesubscription1",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1",
event_subscription_name="examplesubscription1",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResource.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/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_GetForResource.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForResource() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription1"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// 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(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResource.json
*/
async function eventSubscriptionsGetForResource() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForResource.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"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_GetForResourceGroup
示例请求
GET https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2?api-version=2022-06-15
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResourceGroup.json
*/
/**
* Sample code: EventSubscriptions_GetForResourceGroup.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForResourceGroup(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg",
"examplesubscription2",
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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg",
event_subscription_name="examplesubscription2",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResourceGroup.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/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_GetForResourceGroup.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForResourceGroup() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription2"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// Destination: &armeventgrid.WebHookEventSubscriptionDestination{
// EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
// Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
// EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"),
// },
// },
// Filter: &armeventgrid.EventSubscriptionFilter{
// IsSubjectCaseSensitive: to.Ptr(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForResourceGroup.json
*/
async function eventSubscriptionsGetForResourceGroup() {
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 credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForResourceGroup.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"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_GetForSubscription
示例请求
GET https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3?api-version=2022-06-15
import com.azure.core.util.Context;
/** Samples for EventSubscriptions Get. */
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForSubscription.json
*/
/**
* Sample code: EventSubscriptions_GetForSubscription.
*
* @param manager Entry point to EventGridManager.
*/
public static void eventSubscriptionsGetForSubscription(
com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager
.eventSubscriptions()
.getWithResponse(
"subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", 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_get_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.get(
scope="subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
event_subscription_name="examplesubscription3",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForSubscription.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/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_GetForSubscription.json
func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForSubscription() {
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)
}
res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EventSubscription = armeventgrid.EventSubscription{
// Name: to.Ptr("examplesubscription3"),
// Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"),
// ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"),
// Properties: &armeventgrid.EventSubscriptionProperties{
// Destination: &armeventgrid.WebHookEventSubscriptionDestination{
// EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook),
// Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{
// EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"),
// },
// },
// Filter: &armeventgrid.EventSubscriptionFilter{
// IsSubjectCaseSensitive: to.Ptr(false),
// SubjectBeginsWith: to.Ptr("ExamplePrefix"),
// SubjectEndsWith: to.Ptr("ExampleSuffix"),
// },
// Labels: []*string{
// to.Ptr("label1"),
// to.Ptr("label2")},
// ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded),
// Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"),
// },
// }
}
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 Get properties of an event subscription.
*
* @summary Get properties of an event subscription.
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/EventSubscriptions_GetForSubscription.json
*/
async function eventSubscriptionsGetForSubscription() {
const subscriptionId =
process.env["EVENTGRID_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope = "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4";
const eventSubscriptionName = "examplesubscription3";
const credential = new DefaultAzureCredential();
const client = new EventGridManagementClient(credential, subscriptionId);
const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);
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_GetForSubscription.json
// this example is just showing the usage of "EventSubscriptions_Get" 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
EventSubscriptionResource result = await eventSubscription.GetAsync();
// 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": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3",
"name": "examplesubscription3",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
定义
AzureFunctionEventSubscriptionDestination
有关事件订阅的 Azure 函数目标的信息。
名称 |
类型 |
默认值 |
说明 |
endpointType
|
string:
AzureFunction
|
|
事件订阅目标的终结点的类型。
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
|
传递属性详细信息。
|
properties.maxEventsPerBatch
|
integer
|
1
|
每个批的最大事件数。
|
properties.preferredBatchSizeInKilobytes
|
integer
|
64
|
首选批大小(以千字节为单位)。
|
properties.resourceId
|
string
|
|
表示事件订阅的 Azure 函数目标的终结点的 Azure 资源 ID。
|
BoolEqualsAdvancedFilter
BoolEquals 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
BoolEquals
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
value
|
boolean
|
布尔筛选器值。
|
createdByType
创建资源的标识类型。
名称 |
类型 |
说明 |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
DeadLetterWithResourceIdentity
有关具有资源标识的死信目标的信息。
DeliveryWithResourceIdentity
有关具有资源标识的事件订阅的传递信息。
名称 |
类型 |
说明 |
destination
|
EventSubscriptionDestination:
|
有关必须为事件订阅传递事件的目标的信息。
使用Azure 事件网格的标识获取在传递/死信期间使用的身份验证令牌。
|
identity
|
EventSubscriptionIdentity
|
传递事件时要使用的标识。
|
DynamicDeliveryAttributeMapping
动态传递属性映射详细信息。
名称 |
类型 |
说明 |
name
|
string
|
传递属性或标头的名称。
|
properties.sourceField
|
string
|
包含属性值的事件中的 JSON 路径。
|
type
|
string:
Dynamic
|
传递属性或标头名称的类型。
|
EventDeliverySchema
事件订阅的事件传递架构。
名称 |
类型 |
说明 |
CloudEventSchemaV1_0
|
string
|
|
CustomInputSchema
|
string
|
|
EventGridSchema
|
string
|
|
EventHubEventSubscriptionDestination
有关事件订阅的事件中心目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
EventHub
|
事件订阅目标的终结点的类型。
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
传递属性详细信息。
|
properties.resourceId
|
string
|
表示事件订阅的事件中心目标的终结点的 Azure 资源 ID。
|
EventSubscription
事件订阅
名称 |
类型 |
默认值 |
说明 |
id
|
string
|
|
资源的完全限定标识符。
|
name
|
string
|
|
资源的名称。
|
properties.deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
|
事件订阅的死信目标。 无法传递到其目标的任何事件都将发送到死信目标。
使用Azure 事件网格的标识获取在传递/死信期间使用的身份验证令牌。
|
properties.deadLetterWithResourceIdentity
|
DeadLetterWithResourceIdentity
|
|
事件订阅的死信目标。 无法传递到其目标的任何事件都将发送到死信目标。
使用父资源 ((即主题或域) )上的托管标识设置来获取在传递/死信期间使用的身份验证令牌。
|
properties.deliveryWithResourceIdentity
|
DeliveryWithResourceIdentity
|
|
有关必须为事件订阅传递事件的目标的信息。
使用父资源 ((即主题或域) )上的托管标识设置来获取在传递/死信期间使用的身份验证令牌。
|
properties.destination
|
EventSubscriptionDestination:
|
|
有关必须为事件订阅传递事件的目标的信息。
使用Azure 事件网格的标识获取在传递/死信期间使用的身份验证令牌。
|
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
事件订阅的筛选器。
名称 |
类型 |
默认值 |
说明 |
advancedFilters
|
AdvancedFilter[]:
|
|
用于筛选事件订阅的高级筛选器数组。
|
enableAdvancedFilteringOnArrays
|
boolean
|
|
允许针对值数组计算高级筛选器,而不是预期为单数值。
|
includedEventTypes
|
string[]
|
|
需要作为事件订阅一部分的适用事件类型的列表。 如果需要订阅所有默认事件类型,请将 IncludedEventTypes 设置为 null。
|
isSubjectCaseSensitive
|
boolean
|
False
|
指定是否应以区分大小写的方式比较筛选器的 SubjectBeginsWith 和 SubjectEndsWith 属性。
|
subjectBeginsWith
|
string
|
|
一个可选字符串,用于根据资源路径前缀筛选事件订阅的事件。
其格式取决于事件的发布者。
此路径不支持通配符。
|
subjectEndsWith
|
string
|
|
一个可选字符串,用于根据资源路径后缀筛选事件订阅的事件。
此路径不支持通配符。
|
EventSubscriptionIdentity
事件订阅的标识信息。
名称 |
类型 |
说明 |
type
|
EventSubscriptionIdentityType
|
使用的托管标识的类型。 类型“SystemAssigned, UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将删除任何标识。
|
userAssignedIdentity
|
string
|
与资源关联的用户标识。
|
EventSubscriptionIdentityType
使用的托管标识的类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将删除任何标识。
名称 |
类型 |
说明 |
SystemAssigned
|
string
|
|
UserAssigned
|
string
|
|
EventSubscriptionProvisioningState
事件订阅的预配状态。
名称 |
类型 |
说明 |
AwaitingManualAction
|
string
|
|
Canceled
|
string
|
|
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
HybridConnectionEventSubscriptionDestination
有关事件订阅的 HybridConnection 目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
HybridConnection
|
事件订阅目标的终结点的类型。
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
传递属性详细信息。
|
properties.resourceId
|
string
|
作为事件订阅目标的混合连接的 Azure 资源 ID。
|
IsNotNullAdvancedFilter
IsNotNull 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
IsNotNull
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
IsNullOrUndefinedAdvancedFilter
IsNullOrUndefined 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
IsNullOrUndefined
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
NumberGreaterThanAdvancedFilter
NumberGreaterThan 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberGreaterThan
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
value
|
number
|
筛选器值。
|
NumberGreaterThanOrEqualsAdvancedFilter
NumberGreaterThanOrEquals 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberGreaterThanOrEquals
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
value
|
number
|
筛选器值。
|
NumberInAdvancedFilter
NumberIn 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberIn
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
number[]
|
筛选器值集。
|
NumberInRangeAdvancedFilter
NumberInRange 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberInRange
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
number[]
|
筛选器值集。
|
NumberLessThanAdvancedFilter
NumberLessThan 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberLessThan
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
value
|
number
|
筛选器值。
|
NumberLessThanOrEqualsAdvancedFilter
NumberLessThanOrEquals 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberLessThanOrEquals
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
value
|
number
|
筛选器值。
|
NumberNotInAdvancedFilter
NumberNotIn 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberNotIn
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
number[]
|
筛选器值集。
|
NumberNotInRangeAdvancedFilter
NumberNotInRange 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
NumberNotInRange
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
number[]
|
筛选器值集。
|
RetryPolicy
有关事件订阅的重试策略的信息。
名称 |
类型 |
默认值 |
说明 |
eventTimeToLiveInMinutes
|
integer
|
1440
|
活动) 生存时间 (以分钟为单位。
|
maxDeliveryAttempts
|
integer
|
30
|
事件的最大传递重试尝试次数。
|
ServiceBusQueueEventSubscriptionDestination
有关事件订阅的服务总线目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
ServiceBusQueue
|
事件订阅目标的终结点的类型。
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
传递属性详细信息。
|
properties.resourceId
|
string
|
表示事件订阅的服务总线目标的终结点的 Azure 资源 ID。
|
ServiceBusTopicEventSubscriptionDestination
有关事件订阅的服务总线主题目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
ServiceBusTopic
|
事件订阅目标的终结点的类型。
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
传递属性详细信息。
|
properties.resourceId
|
string
|
表示事件订阅的服务总线主题目标的终结点的 Azure 资源 ID。
|
StaticDeliveryAttributeMapping
静态传递属性映射详细信息。
名称 |
类型 |
默认值 |
说明 |
name
|
string
|
|
传递属性或标头的名称。
|
properties.isSecret
|
boolean
|
False
|
用于指示属性是否包含敏感信息 的布尔标志。
|
properties.value
|
string
|
|
传递属性的值。
|
type
|
string:
Static
|
|
传递属性或标头名称的类型。
|
StorageBlobDeadLetterDestination
有关基于存储 Blob 的死信目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
StorageBlob
|
死信目标的终结点的类型
|
properties.blobContainerName
|
string
|
存储 Blob 容器的名称,该容器是死信事件的目标
|
properties.resourceId
|
string
|
死信事件目标的存储帐户的 Azure 资源 ID
|
StorageQueueEventSubscriptionDestination
有关事件订阅的存储队列目标的信息。
名称 |
类型 |
说明 |
endpointType
|
string:
StorageQueue
|
事件订阅目标的终结点的类型。
|
properties.queueMessageTimeToLiveInSeconds
|
integer
|
存储队列消息生存时间(以秒为单位)。
|
properties.queueName
|
string
|
作为事件订阅目标的存储帐户下的存储队列的名称。
|
properties.resourceId
|
string
|
包含事件订阅目标的队列的存储帐户的 Azure 资源 ID。
|
StringBeginsWithAdvancedFilter
StringBeginsWith 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringBeginsWith
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringContainsAdvancedFilter
StringContains 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringContains
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringEndsWithAdvancedFilter
StringEndsWith 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringEndsWith
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringInAdvancedFilter
StringIn 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringIn
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringNotBeginsWithAdvancedFilter
StringNotBegins 使用高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringNotBeginsWith
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringNotContainsAdvancedFilter
StringNotContains 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringNotContains
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringNotEndsWithAdvancedFilter
StringNotEnds 使用高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringNotEndsWith
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
StringNotInAdvancedFilter
StringNotIn 高级筛选器。
名称 |
类型 |
说明 |
key
|
string
|
要基于其进行筛选的事件中的字段/属性。
|
operatorType
|
string:
StringNotIn
|
用于筛选的运算符类型,例如 NumberIn、StringContains、BoolEquals 等。
|
values
|
string[]
|
筛选器值集。
|
systemData
与资源的创建和上次修改相关的元数据。
名称 |
类型 |
说明 |
createdAt
|
string
|
资源创建时间戳 (UTC) 。
|
createdBy
|
string
|
创建资源的标识。
|
createdByType
|
createdByType
|
创建资源的标识类型。
|
lastModifiedAt
|
string
|
资源上次修改的时间戳 (UTC)
|
lastModifiedBy
|
string
|
上次修改资源的标识。
|
lastModifiedByType
|
createdByType
|
上次修改资源的标识类型。
|
WebHookEventSubscriptionDestination
有关事件订阅的 Webhook 目标的信息。
名称 |
类型 |
默认值 |
说明 |
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
|
首选批大小(以千字节为单位)。
|