Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/deployment/bicep-templates/event-grid.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resource eventGridSystemTopics 'Microsoft.EventGrid/systemTopics@2021-12-01' = {
}

resource eventSubscriptions 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2021-12-01' = {
name: 'onefuzz1_subscription'
name: 'onefuzz1-subscription'
parent: eventGridSystemTopics
properties: {
destination: {
Expand Down
20 changes: 11 additions & 9 deletions src/deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,16 +877,18 @@ def remove_eventgrid(self) -> None:
)

# Event subscription for version up to 5.1.0
old_subscription_name = "onefuzz1"
old_subscription_exists = Client.event_subscription_exists(
event_grid_client, src_resource_id, old_subscription_name
)
# or 7.1.0
old_subscription_names = ["onefuzz1", "onefuzz1_subscription"]
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:
logger.info("removing deprecated event subscription")
event_grid_client.event_subscriptions.begin_delete(
src_resource_id, old_subscription_name
).wait()
if old_subscription_exists:
logger.info("removing deprecated event subscription")
event_grid_client.event_subscriptions.begin_delete(
src_resource_id, old_subscription_name
).wait()

def add_instance_id(self) -> None:
logger.info("setting instance_id log export")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_base_event(
resource_group, location
):
if (
entry.name == "onefuzz1_subscription"
entry.name == "onefuzz1-subscription"
and entry.type == "Microsoft.EventGrid/eventSubscriptions"
and entry.event_delivery_schema == "EventGridSchema"
and entry.destination.endpoint_type == "StorageQueue"
Expand Down