Obtenez un abonnement aux événements.
Obtenir les propriétés d’un abonnement aux événements.
GET https://management.azure.com/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}?api-version=2022-06-15
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
eventSubscriptionName
|
path |
True
|
string
|
Nom de l’abonnement aux événements.
|
scope
|
path |
True
|
string
|
Étendue de l’abonnement aux événements. L’étendue peut être un abonnement, un groupe de ressources, une ressource de niveau supérieur appartenant à un espace de noms de fournisseur de ressources ou une rubrique EventGrid. Par exemple, utilisez « /subscriptions/{subscriptionId}/ » pour un abonnement, « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName} » pour un groupe de ressources, et « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} » pour une ressource, et « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName} » pour une rubrique EventGrid.
|
api-version
|
query |
True
|
string
|
Version de l’API à utiliser avec la demande cliente.
|
Réponses
Nom |
Type |
Description |
200 OK
|
EventSubscription
|
Ok
|
Other Status Codes
|
|
Réponses d’erreur : ***
|
Exemples
EventSubscriptions_GetForCustomTopic
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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"
}
Définitions
AzureFunctionEventSubscriptionDestination
Informations sur la destination de la fonction Azure pour un abonnement aux événements.
Nom |
Type |
Valeur par défaut |
Description |
endpointType
|
string:
AzureFunction
|
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
|
Détails de l’attribut de remise.
|
properties.maxEventsPerBatch
|
integer
|
1
|
Nombre maximal d’événements par lot.
|
properties.preferredBatchSizeInKilobytes
|
integer
|
64
|
Taille de lot préférée en Kilo-octets.
|
properties.resourceId
|
string
|
|
ID de ressource Azure qui représente le point de terminaison de la destination de fonction Azure d’un abonnement à un événement.
|
BoolEqualsAdvancedFilter
Filtre avancé BoolEquals.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
BoolEquals
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
value
|
boolean
|
Valeur de filtre booléen.
|
createdByType
Type d’identité qui a créé la ressource.
Nom |
Type |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
DeadLetterWithResourceIdentity
Informations sur la destination deadletter avec l’identité de ressource.
Nom |
Type |
Description |
deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
Informations sur la destination où les événements doivent être remis pour l’abonnement aux événements.
Utilise la configuration de l’identité managée sur la ressource parente (à savoir, rubrique ou domaine) pour acquérir les jetons d’authentification utilisés lors de la remise/de lettres mortes.
|
identity
|
EventSubscriptionIdentity
|
Identité à utiliser lors des événements de lettres mortes.
|
DeliveryWithResourceIdentity
Informations sur la remise d’un abonnement aux événements avec une identité de ressource.
Nom |
Type |
Description |
destination
|
EventSubscriptionDestination:
|
Informations sur la destination où les événements doivent être remis pour l’abonnement aux événements.
Utilise l’identité de Azure Event Grid pour acquérir les jetons d’authentification utilisés lors de la remise ou de la mise en lettres mortes.
|
identity
|
EventSubscriptionIdentity
|
Identité à utiliser lors de la remise d’événements.
|
DynamicDeliveryAttributeMapping
Détails du mappage des attributs de remise dynamique.
Nom |
Type |
Description |
name
|
string
|
Nom de l’attribut de remise ou de l’en-tête.
|
properties.sourceField
|
string
|
Chemin JSON dans l’événement qui contient la valeur d’attribut.
|
type
|
string:
Dynamic
|
Type de l’attribut de remise ou du nom d’en-tête.
|
EventDeliverySchema
Schéma de remise d’événements pour l’abonnement aux événements.
Nom |
Type |
Description |
CloudEventSchemaV1_0
|
string
|
|
CustomInputSchema
|
string
|
|
EventGridSchema
|
string
|
|
EventHubEventSubscriptionDestination
Informations sur la destination du hub d’événements pour un abonnement aux événements.
Nom |
Type |
Description |
endpointType
|
string:
EventHub
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
Détails de l’attribut de remise.
|
properties.resourceId
|
string
|
ID de ressource Azure qui représente le point de terminaison d’une destination Event Hub d’un abonnement aux événements.
|
EventSubscription
Abonnement à un événement
Nom |
Type |
Valeur par défaut |
Description |
id
|
string
|
|
Identificateur complet de la ressource.
|
name
|
string
|
|
Nom de la ressource.
|
properties.deadLetterDestination
|
DeadLetterDestination:
StorageBlobDeadLetterDestination
|
|
Destination des lettres mortes de l’abonnement aux événements. Tout événement qui ne peut pas être remis à destination est envoyé à la destination des lettres mortes.
Utilise l’identité de Azure Event Grid pour acquérir les jetons d’authentification utilisés lors de la remise ou de la mise en lettres mortes.
|
properties.deadLetterWithResourceIdentity
|
DeadLetterWithResourceIdentity
|
|
Destination des lettres mortes de l’abonnement aux événements. Tout événement qui ne peut pas être remis à destination est envoyé à la destination des lettres mortes.
Utilise la configuration de l’identité managée sur la ressource parente (à savoir, rubrique ou domaine) pour acquérir les jetons d’authentification utilisés lors de la remise/de lettres mortes.
|
properties.deliveryWithResourceIdentity
|
DeliveryWithResourceIdentity
|
|
Informations sur la destination où les événements doivent être remis pour l’abonnement aux événements.
Utilise la configuration de l’identité managée sur la ressource parente (à savoir, rubrique ou domaine) pour acquérir les jetons d’authentification utilisés lors de la remise/de lettres mortes.
|
properties.destination
|
EventSubscriptionDestination:
|
|
Informations sur la destination où les événements doivent être remis pour l’abonnement aux événements.
Utilise l’identité de Azure Event Grid pour acquérir les jetons d’authentification utilisés lors de la remise ou de la mise en lettres mortes.
|
properties.eventDeliverySchema
|
EventDeliverySchema
|
EventGridSchema
|
Schéma de remise d’événements pour l’abonnement aux événements.
|
properties.expirationTimeUtc
|
string
|
|
Heure d’expiration de l’abonnement aux événements.
|
properties.filter
|
EventSubscriptionFilter
|
|
Informations sur le filtre de l’abonnement aux événements.
|
properties.labels
|
string[]
|
|
Liste des étiquettes définies par l’utilisateur.
|
properties.provisioningState
|
EventSubscriptionProvisioningState
|
|
État d’approvisionnement de l’abonnement aux événements.
|
properties.retryPolicy
|
RetryPolicy
|
|
Stratégie de nouvelle tentative pour les événements. Cela peut être utilisé pour configurer le nombre maximal de tentatives de remise et la durée de vie des événements.
|
properties.topic
|
string
|
|
Nom de la rubrique de l’abonnement aux événements.
|
systemData
|
systemData
|
|
Métadonnées système relatives à la ressource d’abonnement aux événements.
|
type
|
string
|
|
Type de la ressource.
|
EventSubscriptionFilter
Filtre pour l’abonnement aux événements.
Nom |
Type |
Valeur par défaut |
Description |
advancedFilters
|
AdvancedFilter[]:
|
|
Tableau de filtres avancés utilisés pour filtrer les abonnements aux événements.
|
enableAdvancedFilteringOnArrays
|
boolean
|
|
Permet aux filtres avancés d’être évalués par rapport à un tableau de valeurs au lieu d’attendre une valeur unique.
|
includedEventTypes
|
string[]
|
|
Liste des types d’événements applicables qui doivent faire partie de l’abonnement aux événements. Si vous souhaitez vous abonner à tous les types d’événements par défaut, définissez IncludedEventTypes sur null.
|
isSubjectCaseSensitive
|
boolean
|
False
|
Spécifie si les propriétés SubjectBeginsWith et SubjectEndsWith du filtre doivent être comparées de manière sensible à la casse.
|
subjectBeginsWith
|
string
|
|
Chaîne facultative permettant de filtrer les événements d’un abonnement aux événements en fonction d’un préfixe de chemin de ressource.
Le format de cela dépend de l’éditeur des événements.
Les caractères génériques ne sont pas pris en charge dans ce chemin.
|
subjectEndsWith
|
string
|
|
Chaîne facultative permettant de filtrer les événements d’un abonnement aux événements en fonction d’un suffixe de chemin de ressource.
Les caractères génériques ne sont pas pris en charge dans ce chemin.
|
EventSubscriptionIdentity
Informations d’identité avec l’abonnement aux événements.
Nom |
Type |
Description |
type
|
EventSubscriptionIdentityType
|
Type d’identité managée utilisée. Le type « SystemAssigned, UserAssigned » inclut à la fois une identité créée implicitement et un ensemble d’identités affectées par l’utilisateur. Le type « None » supprime toute identité.
|
userAssignedIdentity
|
string
|
Identité de l’utilisateur associée à la ressource.
|
EventSubscriptionIdentityType
Type d’identité managée utilisée. Le type « SystemAssigned, UserAssigned » inclut à la fois une identité implicitement créée et un ensemble d’identités affectées par l’utilisateur. Le type « None » supprime toute identité.
Nom |
Type |
Description |
SystemAssigned
|
string
|
|
UserAssigned
|
string
|
|
EventSubscriptionProvisioningState
État d’approvisionnement de l’abonnement aux événements.
Nom |
Type |
Description |
AwaitingManualAction
|
string
|
|
Canceled
|
string
|
|
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
HybridConnectionEventSubscriptionDestination
Informations sur la destination HybridConnection pour un abonnement aux événements.
Nom |
Type |
Description |
endpointType
|
string:
HybridConnection
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
Détails de l’attribut de remise.
|
properties.resourceId
|
string
|
ID de ressource Azure d’une connexion hybride qui est la destination d’un abonnement aux événements.
|
IsNotNullAdvancedFilter
IsNotNull Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
IsNotNull
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
IsNullOrUndefinedAdvancedFilter
IsNullOrUndefined Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
IsNullOrUndefined
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
NumberGreaterThanAdvancedFilter
Filtre avancé NumberGreaterThan.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberGreaterThan
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
value
|
number
|
Valeur de filtre.
|
NumberGreaterThanOrEqualsAdvancedFilter
Filtre avancé NumberGreaterThanOrEquals.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberGreaterThanOrEquals
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
value
|
number
|
Valeur de filtre.
|
NumberInAdvancedFilter
NumberIn Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberIn
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
number[]
|
Ensemble de valeurs de filtre.
|
NumberInRangeAdvancedFilter
Filtre avancé NumberInRange.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberInRange
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
number[]
|
Ensemble de valeurs de filtre.
|
NumberLessThanAdvancedFilter
Filtre avancé NumberLessThan.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberLessThan
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
value
|
number
|
Valeur de filtre.
|
NumberLessThanOrEqualsAdvancedFilter
Filtre avancé NumberLessThanOrEquals.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberLessThanOrEquals
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
value
|
number
|
Valeur de filtre.
|
NumberNotInAdvancedFilter
Filtre avancé NumberNotIn.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberNotIn
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
number[]
|
Ensemble de valeurs de filtre.
|
NumberNotInRangeAdvancedFilter
Filtre avancé NumberNotInRange.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
NumberNotInRange
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
number[]
|
Ensemble de valeurs de filtre.
|
RetryPolicy
Informations sur la stratégie de nouvelle tentative pour un abonnement aux événements.
Nom |
Type |
Valeur par défaut |
Description |
eventTimeToLiveInMinutes
|
integer
|
1440
|
Durée de vie (en minutes) des événements.
|
maxDeliveryAttempts
|
integer
|
30
|
Nombre maximal de tentatives de remise pour les événements.
|
ServiceBusQueueEventSubscriptionDestination
Informations sur la destination Service Bus d’un abonnement aux événements.
Nom |
Type |
Description |
endpointType
|
string:
ServiceBusQueue
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
Détails de l’attribut de remise.
|
properties.resourceId
|
string
|
ID de ressource Azure qui représente le point de terminaison de la destination Service Bus d’un abonnement à un événement.
|
ServiceBusTopicEventSubscriptionDestination
Informations sur la destination de la rubrique Service Bus pour un abonnement à un événement.
Nom |
Type |
Description |
endpointType
|
string:
ServiceBusTopic
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
Détails de l’attribut de remise.
|
properties.resourceId
|
string
|
ID de ressource Azure qui représente le point de terminaison de la destination de rubrique Service Bus d’un abonnement à un événement.
|
StaticDeliveryAttributeMapping
Détails du mappage des attributs de remise statique.
Nom |
Type |
Valeur par défaut |
Description |
name
|
string
|
|
Nom de l’attribut de remise ou de l’en-tête.
|
properties.isSecret
|
boolean
|
False
|
Indicateur booléen pour indiquer si l’attribut contient des informations sensibles.
|
properties.value
|
string
|
|
Valeur de l’attribut de remise.
|
type
|
string:
Static
|
|
Type de l’attribut de remise ou du nom d’en-tête.
|
StorageBlobDeadLetterDestination
Informations sur la destination des lettres mortes basées sur l’objet blob de stockage.
Nom |
Type |
Description |
endpointType
|
string:
StorageBlob
|
Type du point de terminaison pour la destination des lettres mortes
|
properties.blobContainerName
|
string
|
Nom du conteneur d’objets blob de stockage qui est la destination des événements deadletter
|
properties.resourceId
|
string
|
ID de ressource Azure du compte de stockage qui est la destination des événements deadletter
|
StorageQueueEventSubscriptionDestination
Informations sur la destination de la file d’attente de stockage pour un abonnement aux événements.
Nom |
Type |
Description |
endpointType
|
string:
StorageQueue
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.queueMessageTimeToLiveInSeconds
|
integer
|
Durée de vie des messages de la file d’attente de stockage en secondes.
|
properties.queueName
|
string
|
Nom de la file d’attente de stockage sous un compte de stockage qui est la destination d’un abonnement aux événements.
|
properties.resourceId
|
string
|
ID de ressource Azure du compte de stockage qui contient la file d’attente qui est la destination d’un abonnement aux événements.
|
StringBeginsWithAdvancedFilter
StringBeginsWith Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringBeginsWith
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringContainsAdvancedFilter
Filtre avancé StringContains.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringContains
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringEndsWithAdvancedFilter
StringEndsWith Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringEndsWith
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringInAdvancedFilter
StringIn Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringIn
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringNotBeginsWithAdvancedFilter
StringNotBeginsWith Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringNotBeginsWith
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringNotContainsAdvancedFilter
Filtre avancé StringNotContains.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringNotContains
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringNotEndsWithAdvancedFilter
StringNotEndsWith Advanced Filter.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringNotEndsWith
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
StringNotInAdvancedFilter
Filtre avancé StringNotIn.
Nom |
Type |
Description |
key
|
string
|
Champ/propriété dans l’événement en fonction duquel vous souhaitez filtrer.
|
operatorType
|
string:
StringNotIn
|
Type d’opérateur utilisé pour le filtrage, par exemple, NumberIn, StringContains, BoolEquals et autres.
|
values
|
string[]
|
Ensemble de valeurs de filtre.
|
systemData
Métadonnées relatives à la création et à la dernière modification de la ressource.
Nom |
Type |
Description |
createdAt
|
string
|
Horodatage de la création de ressources (UTC).
|
createdBy
|
string
|
Identité qui a créé la ressource.
|
createdByType
|
createdByType
|
Type d’identité qui a créé la ressource.
|
lastModifiedAt
|
string
|
Horodatage de la dernière modification de la ressource (UTC)
|
lastModifiedBy
|
string
|
Identité qui a modifié la ressource pour la dernière fois.
|
lastModifiedByType
|
createdByType
|
Type d’identité qui a modifié la ressource pour la dernière fois.
|
WebHookEventSubscriptionDestination
Informations sur la destination du webhook pour un abonnement aux événements.
Nom |
Type |
Valeur par défaut |
Description |
endpointType
|
string:
WebHook
|
|
Type du point de terminaison pour la destination de l’abonnement aux événements.
|
properties.azureActiveDirectoryApplicationIdOrUri
|
string
|
|
L’ID ou l’URI d’application Azure Active Directory pour obtenir le jeton d’accès qui sera inclus en tant que jeton du porteur dans les demandes de remise.
|
properties.azureActiveDirectoryTenantId
|
string
|
|
ID de locataire Azure Active Directory pour obtenir le jeton d’accès qui sera inclus comme jeton du porteur dans les demandes de remise.
|
properties.deliveryAttributeMappings
|
DeliveryAttributeMapping[]:
|
|
Détails de l’attribut de remise.
|
properties.endpointBaseUrl
|
string
|
|
URL de base qui représente le point de terminaison de la destination d’un abonnement aux événements.
|
properties.endpointUrl
|
string
|
|
URL qui représente le point de terminaison de la destination d’un abonnement aux événements.
|
properties.maxEventsPerBatch
|
integer
|
1
|
Nombre maximal d’événements par lot.
|
properties.preferredBatchSizeInKilobytes
|
integer
|
64
|
Taille de lot préférée en Kilo-octets.
|