Wyświetlanie listy kluczy dla tematu.
Wyświetl listę dwóch kluczy używanych do publikowania w temacie.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys?api-version=2025-02-15
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów w ramach subskrypcji użytkownika.
|
subscriptionId
|
path |
True
|
string
|
Poświadczenia subskrypcji, które jednoznacznie identyfikują subskrypcję platformy Microsoft Azure. Identyfikator subskrypcji stanowi część identyfikatora URI dla każdego wywołania usługi.
|
topicName
|
path |
True
|
string
|
Nazwa tematu.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia z żądaniem klienta.
|
Odpowiedzi
Przykłady
Topics_ListSharedAccessKeys
Przykładowe żądanie
POST https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/listKeys?api-version=2025-02-15
/**
* Samples for Topics ListSharedAccessKeys.
*/
public final class Main {
/*
* x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/
* Topics_ListSharedAccessKeys.json
*/
/**
* Sample code: Topics_ListSharedAccessKeys.
*
* @param manager Entry point to EventGridManager.
*/
public static void topicsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) {
manager.topics().listSharedAccessKeysWithResponse("examplerg", "exampletopic2",
com.azure.core.util.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 topics_list_shared_access_keys.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="5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
)
response = client.topics.list_shared_access_keys(
resource_group_name="examplerg",
topic_name="exampletopic2",
)
print(response)
# x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListSharedAccessKeys.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
Przykładowa odpowiedź
{
"key1": "<key1>",
"key2": "<key2>"
}
Definicje
TopicSharedAccessKeys
Objekt
Klucze dostępu współdzielonego tematu
Nazwa |
Typ |
Opis |
key1
|
string
|
Klucz dostępu współdzielonego1 dla tematu.
|
key2
|
string
|
Klucz dostępu współdzielonego2 dla tematu.
|