-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update EventGrid SDK to T2 #18
base: main
Are you sure you want to change the base?
Conversation
@scottaddie, @ellismg and @ahamad-MS Could you help review this PR? Thanks a lot. |
@scottaddie, @ellismg and @ahamad-MS Could you help review this PR? Thanks a lot. |
1 similar comment
@scottaddie, @ellismg and @ahamad-MS Could you help review this PR? Thanks a lot. |
@@ -72,7 +72,7 @@ private List<EventGridEventModel> AdaptCloudEvent(string t) | |||
private List<EventGridEventModel> AdaptEventGridEvent(string t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need EventGridEventModel - can we just use EventGridEvent?
@@ -21,7 +22,7 @@ public class CloudEvent | |||
public string Id { get; set; } | |||
|
|||
[JsonProperty("time")] | |||
public string Time { get; set; } | |||
public DateTimeOffset Time { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just use the CloudEvent type from Azure.Core - https://docs.microsoft.com/en-us/dotnet/api/azure.messaging.cloudevent?view=azure-dotnet
// EventGrid validation message | ||
if (model.EventType == EventTypes.EventGridSubscriptionValidationEvent) | ||
if (eventGrid.TryGetSystemEventData(out object systemEvent)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The systemEvent we get back would still need to be checked to make sure it is the correct type, i.e. SubscriptionValidationEventData. Or we can continue checking the event type, and then do eventGrid.Data.ToObjectFromJson().
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
<PackageReference Include="System.Memory.Data" Version="6.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package will get pulled in by Azure.Messaging.EventGrid. Unless we need 6.0.0, I'd just remove this.
@@ -84,7 +84,7 @@ private List<EventGridEventModel> AdaptEventGridEvent(string t) | |||
Subject = string.IsNullOrEmpty(eventGridEvent.Subject) ? eventGridEvent.EventType : eventGridEvent.Subject, | |||
Data = json, | |||
EventData = eventGridEvent.Data, | |||
EventTime = eventGridEvent.EventTime.ToString("o") // https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=netcore-3.1 | |||
EventTime = eventGridEvent.EventTime // https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=netcore-3.1 | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we remove this?
@@ -9,7 +9,7 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.0" /> | |||
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.10.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.10.0" /> | |
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.11.0" /> |
@JoshLove-msft - Updated according to your comments, could you please re-review it? Thanks! |
@JoshLove-msft - We have updated according to your comments, please help re-review it. Thanks a lot. |
1 similar comment
@JoshLove-msft - We have updated according to your comments, please help re-review it. Thanks a lot. |
Update EventGrid SDK to T2
Update files:
@scottaddie, @ellismg and @ahamad-MS for notification.