Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Skrip ini membuat topik kustom Event Grid.
Catatan
Sebaiknya Anda menggunakan modul Azure Az PowerShell untuk berinteraksi dengan Azure. Untuk memulai, lihat Menginstal Azure PowerShell. Untuk mempelajari cara bermigrasi ke modul Az PowerShell, lihat Memigrasikan Azure PowerShell dari AzureRM ke Az.
Jika Anda tidak memiliki akun Azure, buat akun gratis sebelum memulai.
Sampel skrip
# Give your custom topic a unique name
$myTopic = "<your-custom-topic-name>"
# Provide a name for resource group to create. It will contain the custom event.
$myResourceGroup = "<resource-group-name>"
# Create resource group
New-AzResourceGroup -Name $myResourceGroup -Location westus2
# Create custom topic
New-AzEventGridTopic -ResourceGroupName $myResourceGroup -Name $myTopic -Location westus2
# Retrieve endpoint and key to use when publishing to the topic
$endpoint = (Get-AzEventGridTopic -ResourceGroupName $myResourceGroup -Name $myTopic).Endpoint
$key = (Get-AzEventGridTopicKey -ResourceGroupName $myResourceGroup -Name $myTopic).Key1
$endpoint
$key
Penjelasan skrip
Skrip ini menggunakan perintah berikut untuk membuat topik kustom. Setiap perintah dalam tabel ditautkan ke dokumentasi spesifik-perintah.
| Perintah | Catatan |
|---|---|
| New-AzEventGridTopic | Buat topik kustom Event Grid. |
Langkah berikutnya
- Untuk pengenalan aplikasi terkelola, lihat Ringkasan Azure Managed Application.
- Untuk informasi selengkapnya tentang PowerShell, lihat Dokumentasi Azure PowerShell.