Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 34b513e

Browse files
authored
Rename EventGrid subscription (#2960)
1 parent 706c9fc commit 34b513e

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/deployment/bicep-templates/event-grid.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resource eventGridSystemTopics 'Microsoft.EventGrid/systemTopics@2021-12-01' = {
1616
}
1717

1818
resource eventSubscriptions 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2021-12-01' = {
19-
name: 'onefuzz1_subscription'
19+
name: 'onefuzz1-subscription'
2020
parent: eventGridSystemTopics
2121
properties: {
2222
destination: {

src/deployment/deploy.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -877,16 +877,18 @@ def remove_eventgrid(self) -> None:
877877
)
878878

879879
# Event subscription for version up to 5.1.0
880-
old_subscription_name = "onefuzz1"
881-
old_subscription_exists = Client.event_subscription_exists(
882-
event_grid_client, src_resource_id, old_subscription_name
883-
)
880+
# or 7.1.0
881+
old_subscription_names = ["onefuzz1", "onefuzz1_subscription"]
882+
for old_subscription_name in old_subscription_names:
883+
old_subscription_exists = Client.event_subscription_exists(
884+
event_grid_client, src_resource_id, old_subscription_name
885+
)
884886

885-
if old_subscription_exists:
886-
logger.info("removing deprecated event subscription")
887-
event_grid_client.event_subscriptions.begin_delete(
888-
src_resource_id, old_subscription_name
889-
).wait()
887+
if old_subscription_exists:
888+
logger.info("removing deprecated event subscription")
889+
event_grid_client.event_subscriptions.begin_delete(
890+
src_resource_id, old_subscription_name
891+
).wait()
890892

891893
def add_instance_id(self) -> None:
892894
logger.info("setting instance_id log export")

src/utils/add-corpus-storage-accounts/add-corpus-storage-account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_base_event(
3131
resource_group, location
3232
):
3333
if (
34-
entry.name == "onefuzz1_subscription"
34+
entry.name == "onefuzz1-subscription"
3535
and entry.type == "Microsoft.EventGrid/eventSubscriptions"
3636
and entry.event_delivery_schema == "EventGridSchema"
3737
and entry.destination.endpoint_type == "StorageQueue"

0 commit comments

Comments
 (0)