mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-15 11:28:09 +00:00
Rename EventGrid subscription (#2960)
This commit is contained in:
@ -16,7 +16,7 @@ resource eventGridSystemTopics 'Microsoft.EventGrid/systemTopics@2021-12-01' = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource eventSubscriptions 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2021-12-01' = {
|
resource eventSubscriptions 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2021-12-01' = {
|
||||||
name: 'onefuzz1_subscription'
|
name: 'onefuzz1-subscription'
|
||||||
parent: eventGridSystemTopics
|
parent: eventGridSystemTopics
|
||||||
properties: {
|
properties: {
|
||||||
destination: {
|
destination: {
|
||||||
|
@ -877,16 +877,18 @@ class Client:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Event subscription for version up to 5.1.0
|
# Event subscription for version up to 5.1.0
|
||||||
old_subscription_name = "onefuzz1"
|
# or 7.1.0
|
||||||
old_subscription_exists = Client.event_subscription_exists(
|
old_subscription_names = ["onefuzz1", "onefuzz1_subscription"]
|
||||||
event_grid_client, src_resource_id, old_subscription_name
|
for old_subscription_name in old_subscription_names:
|
||||||
)
|
old_subscription_exists = Client.event_subscription_exists(
|
||||||
|
event_grid_client, src_resource_id, old_subscription_name
|
||||||
|
)
|
||||||
|
|
||||||
if old_subscription_exists:
|
if old_subscription_exists:
|
||||||
logger.info("removing deprecated event subscription")
|
logger.info("removing deprecated event subscription")
|
||||||
event_grid_client.event_subscriptions.begin_delete(
|
event_grid_client.event_subscriptions.begin_delete(
|
||||||
src_resource_id, old_subscription_name
|
src_resource_id, old_subscription_name
|
||||||
).wait()
|
).wait()
|
||||||
|
|
||||||
def add_instance_id(self) -> None:
|
def add_instance_id(self) -> None:
|
||||||
logger.info("setting instance_id log export")
|
logger.info("setting instance_id log export")
|
||||||
|
@ -31,7 +31,7 @@ def get_base_event(
|
|||||||
resource_group, location
|
resource_group, location
|
||||||
):
|
):
|
||||||
if (
|
if (
|
||||||
entry.name == "onefuzz1_subscription"
|
entry.name == "onefuzz1-subscription"
|
||||||
and entry.type == "Microsoft.EventGrid/eventSubscriptions"
|
and entry.type == "Microsoft.EventGrid/eventSubscriptions"
|
||||||
and entry.event_delivery_schema == "EventGridSchema"
|
and entry.event_delivery_schema == "EventGridSchema"
|
||||||
and entry.destination.endpoint_type == "StorageQueue"
|
and entry.destination.endpoint_type == "StorageQueue"
|
||||||
|
Reference in New Issue
Block a user