GitHub Copilot Customization Explained for Beginners: Instructions, Prompt Files, Skills, Agents, and Hooks  Introduction If you've recently started using GitHub Copilot, you've probably come across terms like Instructions , Prompt Files , Skills , Agents , and Hooks . At first glance, they all seem to do the same thing—they tell Copilot what to do. So why does GitHub have five different customization features? The answer is simple: each feature solves a different problem. Think of GitHub Copilot as a new developer joining your team. On their first day, you don't just hand them code. You explain your coding standards, give them reusable templates, teach them specialized knowledge, assign them a role, and automate repetitive tasks. That's exactly how GitHub Copilot customization works. In this article, you'll learn what each feature does, when to use it, and how they all work together. By the end, you'll know which feature to start with and which ones can wait un...

Swagger UI for Azure Function v2 & v3 APIs

In this blog post, we will see how to setup Swagger UI for Azure Function APIs in v2 and v3. Now you might be wondering why Swagger? Swagger is a language-agnostic specification for describing REST APIs, it also referred to as OpenAPI. Swagger UI offers a web-based UI that provides information about your REST APIs service.

Prerequisites

  1. HTTP trigger Azure function provisioned or created in C#
  2. Azure DI enabled on Azure Function, for more details refer here with relevant package version installed based on Azure Function version.

Integrating Swagger UI into our Applications

1. Install the appropriate package based on the Azure Function version which you are dealing with from the below table. Unfortunately, it's not a single package for both versions due to Azure function v3 because v3 makes use of ASP.NET Core 3.1 which introduces a new serializer System.Text.Json (STJ) out-of-the-box.

 Azure Function Version Nuget package
 v2          AzureFunctions.Extensions.Swashbuckle
 v3 AzureExtensions.Swashbuckle

2. Update startup code as shown below by adding Swashbuckle.

3. Add Open API and Swagger UI function
 
4. Sample HTTP trigger code as shown below

5. Run Azure function locally and you should be able to see swagger ui as shown below

Swagger UI

6. Use "SwaggerIgnoreAttribute", If you have Http Trigger Functions that you do not want to add to Open API.
7. Finally if you want to import XMLCommentDocument you can add it to Open API by navigating to host.json and placing the below code snippet with XML file in your project.

{
  "version": "2.0",
  "extensions": {
    "Swashbuckle": {
      "XmlPath": "SwaggerCommentDocument.xml"
    }
  }
}


Related Articles

Comments

Popular posts from this blog

Tidy up - Unused Project and Nuget package reference using Visual Studio 2019

Azure Front Door vs Azure Traffic Manager?

Authenticate Azure Functions - API Keys