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

If you are a Developer/Architect using Visual Studio as IDE for your development activities, this blog post will be of your interest. During the Ignite 2021 conference, Microsoft released Visual Studio 2019 v16.9 and v16.10 Preview 1. As part of version 16.10 Preview 1, one of the cool features they introduced is to "Remove Unused References..." for any Projects and Nuget packages that are not in use. At the time of writing this blog post, we have Visual Studio Version 16.10.0 (official release) which includes this new feature.  As part of development, we generally get carried away and introduce new Nuget package references to your project and add new references to your Projects. By the end of development, you will not be 100% sure which are not being referenced and unused which means you will leave those unused project references in your application. Now you might be wondering what's the big deal in it since it doesn't harm. The advantage of removing unused project r

How to create Azure Function from OpenAPI/Swagger definition?

In my previous blog post, I have illustrated how to setup OpenAPI/Swagger UI for Azure Function. In this blog, post let's see how to create Azure Function from OpenAPI specification. As part of recent updates from the Azure Functions team, there was an announcement for creating Azure Function by importing OpenAPI/Swagger definition. 

Prerequisites

  • Azure Function VS Code extension or command line
  • autorest (Microsoft's OpenAPI specification generator) npm installed
    npm install -g autorest
    
  • Supported languages C#, Java, Python, TypeScript.

Steps to create function apps from Swagger definition

  • Install or update VS code with Azure Function extension
        
  • Navigate to Visual Studio Code à Azure Extension under which you should be able to see the option for creating Function App as shown in the below screenshot.
        
  • Once the folder is selected under which Function App to be placed, choose the language (c#), template, and namespace for the function app as shown below.
            
  • Using AutoRest tool based on the input file (OpenAPI) provided Function App will be created 
    • Input OpenAPI Definition as shown below
    •  Function App generated from the above OpenAPI definition shown below

References

More language support and details can be found here

Comments

Popular posts from this blog

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

Swagger UI for Azure Function v2 & v3 APIs

Authenticate Azure Functions - API Keys