azuredev

A 11-post collection

Use a container to show your function swagger

One option for enabling the Swagger-UI capabilities is to direct the consumers of the api to http://petstore.swagger.io and have them put the url in the box at the top of the page. That's professional right? :-/ Alternatively, you can add the url of the service to the end with ?url= such as http://petstore.swagger.io?url=https://yoursite.azurewebsites.net/docs/swagger.json, but again probably not the best option. Here we can take advantage of Docker here and use the swaggerapi/swagger-ui Docker image and set some ENV variables within an Azure AppService Web Application and accomplish our own SwaggerUI. Creating a new AppService (Linux) Here we will use the Azure CLI to create our...


Unmasking your swagger with proxies in Azure Functions

In my post Testing Azure Functions with Postman and Swagger I showed how to use the API Specification capabilities in Azure Functions and then take the endpoint url and test the API using Postman. Notice the url that is provided for the API. It isn't human readable, nor something I could rattle off to another developer over the phone or easy re-type. Creating a proxy A feature in Azure Function is proxies. Using this feature we can establish a new proxy for our function to point a "nice" url to the "no-so-friendly" API Definition. Now you can share the shorter more reasonable url, even use the test Swagger UI at http://petstore.swagger.io. Be sure to add http://petstore....


Do more or less with default values in the Azure CLI

I've been spending quite a lot of time using Azure over the last many years. In fact, the portal was written in Silverlight. Now the the portal has a great modern UI and complimenting that is a CLI (command line interface) allowing for great automation, grep, awk, jamespath and much more. Checkout Getting Started with Azure CLI 2.0 When using the CLI to create resources there are occasions, usually when putting together a project or demo, when there are parameters that should be assumed or defaulted. In this scenario, the following resources must be created for the application architecture. Resource Group AppService Plan AppService Web Application DocumentDB Creating a Resource Group using the CLI is simple using the following...


Testing Azure Functions with Postman and Swagger

A new feature (preview) in Azure Functions is API Definition. This feature allows you to use the OpenAPI specification (aka Swagger) to document the functionality of your functions and/or endpoints. Checkout John Papa & I talk about using Swagger for ASP.NET Core on Pluralsight in Play by Play - Understanding API Functionality Through Swagger The documentation and a walkthrough of Creating OpenAPI 2.0 (Swagger) Metadata for a Function App (Preview) are available on docs.microsoft.com. Testing your function After you have your api defined, copy the endpoint in the API Definition URL box to use to import into Postman. Open Postman, click the Import button. Select Import from Link and paste your definition endpoint. Postman reads...


Azure functions - Just the CLI, hold the GUI, add some git

When sitting down to get started on a project, the start and stops of setting this and that up can be a non-starter. Sometimes, ok almost always, I just want check in code and have the build and deploy just happen. I'm a very big fan of CLI tooling. If I can fire up a bash prompt and get started, you've won me over. The .NET Core team continues to improve the command line tooling experience for all platforms with dotnet new and if you're pushing your apps to the cloud; the Azure 2.0 CLI is on point for getting stuff done. Azure CLI - The Azure CLI 2.0 is Azure's new command line experience for managing Azure...