Skip to content

Pin EventGrid sample files URL to specific commit SHA#4770

Merged
nturinski merged 4 commits intomainfrom
copilot/update-eventgrid-sample-url
Mar 30, 2026
Merged

Pin EventGrid sample files URL to specific commit SHA#4770
nturinski merged 4 commits intomainfrom
copilot/update-eventgrid-sample-url

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 29, 2025

Azure/azure-rest-api-specs#38236 removed EventGrid sample files from main branch, breaking the extension's ability to fetch sample events for EventGrid function triggers.

Changes

  • Pin GitHub API URL to commit 752dade436619ed28bd03ca2e77cfa5acf6222dd where sample files still exist
  • Add documentation referencing upstream issues
// Before
const sampleFilesUrl =
    'https://api.github.com/repos/Azure/azure-rest-api-specs/contents/specification/eventgrid/data-plane/' +
    '{eventSource}' +
    '/stable/2018-01-01/examples/cloud-events-schema/';

// After
const sampleFilesUrl =
    'https://api.github.com/repos/Azure/azure-rest-api-specs/contents/specification/eventgrid/data-plane/' +
    '{eventSource}' +
    '/stable/2018-01-01/examples/cloud-events-schema?ref=752dade436619ed28bd03ca2e77cfa5acf6222dd';

Restores functionality for all supported EventGrid sources (Microsoft.Storage, Microsoft.EventHub, Microsoft.ServiceBus, etc.).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Azure/azure-rest-api-specs/contents/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/examples/cloud-events-schema
    • Triggering command: curl -s -I REDACTED (http block)
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Update EventGrid sample file URL to use specific commit SHA after Azure/azure-rest-api-specs#38235</issue_title>
<issue_description>## Background
Recent changes in the Azure/azure-rest-api-specs repository (see issue #38235 and PR #38236) removed almost all EventGrid sample directories and example files from main. As a result, the following URL used in EventGridTypeStep.ts now fails:

const sampleFilesUrl =
    'https://api.github.com/repos/Azure/azure-rest-api-specs/contents/specification/eventgrid/data-plane/' +
    '{eventSource}' +
    '/stable/2018-01-01/examples/cloud-events-schema/';

Proposal

Use a specific SHA reference when fetching EventGrid sample files from the GitHub API. This will ensure the extension continues to provide sample events for all supported sources, even though the files are no longer present in the main branch.

Suggested approach:

References

Impact

  • This workaround will allow the extension to continue functioning for EventGrid event sources despite the upstream file deletion.
  • Future changes in azure-rest-api-specs may require further updates.

Labels: bug, eventgrid
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Add ?ref=752dade436619ed28bd03ca2e77cfa5acf6222dd query parameter to EventGrid sample files URL to ensure the extension continues to work after upstream files were removed from main branch.

Fixes issue caused by Azure/azure-rest-api-specs#38235 and Azure/azure-rest-api-specs#38236

Co-authored-by: alexweininger <12476526+alexweininger@users.noreply.github.com>
Copilot AI changed the title [WIP] Update EventGrid sample file URL to specific commit SHA Pin EventGrid sample files URL to specific commit SHA Oct 29, 2025
Copilot AI requested a review from alexweininger October 29, 2025 18:25
@nturinski nturinski marked this pull request as ready for review November 12, 2025 19:25
@nturinski nturinski requested a review from a team as a code owner November 12, 2025 19:25
@bwateratmsft
Copy link
Copy Markdown
Contributor

Converting old PR to draft.

@bwateratmsft bwateratmsft marked this pull request as draft February 3, 2026 14:40
@nturinski nturinski marked this pull request as ready for review March 17, 2026 17:42
Copilot AI review requested due to automatic review settings March 17, 2026 17:42
@nturinski
Copy link
Copy Markdown
Member

I think this PR is fine and should resolve the issue which is the current GitHub repo removed all of the EventGrid sample files.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins the GitHub Contents API URL used to fetch EventGrid sample events to a known-good commit SHA so the extension can continue retrieving sample payloads after upstream files were removed from main.

Changes:

  • Update sampleFilesUrl to include ?ref=<commitSha> so samples resolve consistently.
  • Add inline documentation pointing to the upstream issue/PR that removed the files.

'https://api.github.com/repos/Azure/azure-rest-api-specs/contents/specification/eventgrid/data-plane/' +
'{eventSource}' +
'/stable/2018-01-01/examples/cloud-events-schema/';
'/stable/2018-01-01/examples/cloud-events-schema?ref=752dade436619ed28bd03ca2e77cfa5acf6222dd';
Comment thread src/commands/executeFunction/eventGrid/EventGridTypeStep.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@nturinski nturinski enabled auto-merge (squash) March 18, 2026 17:36
@nturinski nturinski merged commit 2fb26db into main Mar 30, 2026
2 of 3 checks passed
@nturinski nturinski deleted the copilot/update-eventgrid-sample-url branch March 30, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update EventGrid sample file URL to use specific commit SHA after Azure/azure-rest-api-specs#38235

5 participants