I’ve been moving content from my old KB in Github to its new (and hopefully permanent) home at
https://codemastershawn.com/kb
and I took the opportunity to update the Set up a new Windows PC entry. It documents how I configure a new PC with my chosen productivity tools.
]]>To create, deploy and use a custom Connector that can be used in Azure Logic Apps. We also want to be able to publish this connector in the gallery (so that it shows up in the list with other connectors). For now the latter appears to be primarily available as invite-only for Microsoft partners.
During my research it became clear that Azure and the Microsoft Flow services are constantly changing, both in terms of functionality and user interface. What follows are based on my experience at the time of this writing. By the time you read this there have likely been additional changes.
Logic Apps are an outgrowth of BizTalk and various workflow platforms from Microsoft. They are a way to build workflows that can integrate with a variety of external services. Think IFTTT with the ability to provide more logic, or Yahoo! Pipes.
Flow is kind of a “lite” version of Logic Apps. Flows use the same connectors as Logic Apps, but expose less of their functionality and have fewer options for linking connectors. Microsoft Flow is a direct competitor to IFTTT.
Workflows in both consist of actions. These actions come in two flavors:
There are already several good tutorials on-line that cover the basics of creating Flows and Logic Apps, so I’m not going to go into that here. These are a few that I recommend:
Because Microsoft Flow and Logic Apps both allow the user to select the same connector/actions from the gallery, we will start by adding our Custom API to Flow. Once there it can be rolled out for Logic Apps.
If you don’t need your custom API to be in the gallery where other users can select it to include in their own Flows the easiest way to access it is with one of the built-in connectors:
What we’re looking to do, however, is provide our own branded connector that customers can choose from the gallery instead of one of the built-in HTTP connectors. In Microsoft Flow, this is referred to as a Custom API. In Logic Apps this is referred to as a connector.
To register a Custom API for use in your flows click the gear icon in the top right and select Custom APIs.
On the next page click the Create custom API button:
When done click Create API in the top right. If successful, your API should be listed on the Custom API page. From here you can create Connections, edit or remove the API.
You may have noticed near the end of the steps in the previous section that a lot of cleanup was needed on the Definition screen. Maybe you needed to provide friendlier names, descriptions or set visibility.
Microsoft has provided the following extensions to the Swagger specification which covers some of these situations:
For more details see Customize your Swagger definition for Microsoft Flow.
Maintaining these extensions in your API’s Swagger by hand could become a real headache, so a Microsoft MVP by the name of Nick Hauenstein has created a library for that. T-Rex extends the Swashbuckle library, which generates Swagger for ASP.NET WebAPI applications, with additional attributes to generate the Microsoft extensions listed above.
Here is an example from the T-Rex documentation:
[Trigger(TriggerType.Poll, typeof(SamplePollingResult))] [Metadata("Roll the Dice", "Roll the dice to see if we should trigger this time")] [SwaggerResponse(HttpStatusCode.BadRequest, "Bad configuration. Dice require 1 or more sides")] [HttpGet, Route("diceRoll")] public HttpResponseMessage DiceRoll(string triggerState, [Metadata("Number of Sides", "Number of sides that should be on the die that is rolled")] int numberOfSides, [Metadata("Target Number", "Trigger will fire if dice roll is above this number")] int targetNumber)
NOTE: At the time of this writing the stable release of T-Rex only includes support for the summary, visibility and trigger extensions.
After the Custom API has been registered you will need to create a connection to it before it can be used in a Flow.
From the Custom API page, click the plus (+) icon for the API you want to connect to. Enter the connection information when prompted then click the Create Connection button.
That’s it! You can now select your Custom API from the list of actions in a Flow.
Following the previous steps, your Custom API will only be available to you, your team and others you share it with – using the same connection (including credentials) you created. It will not be available to all Flow users. Nor will it be available to Logic Apps.
To get your Custom API into the public gallery, where it can be used by anybody, you will need to contact Microsoft. They will review and test the Custom API and, if approved, make the necessary changes to require each user to set up their own connection. Only then will they make it available to all users.
Once your Custom API is in the Flow gallery Microsoft will incrementally roll it out across data centers for use in Azure Logic Apps.
There’s some really good information and suggestions in this Emotional At Work? Science Says You’ll Be More Productive blog post.
]]>As the professional ecosystem becomes increasingly connected, however, and complex systems require a group effort instead of individual support, group dynamics of culture, emotion and behavior are proving to be the key to engagement, longevity, and success.
If you have experience dynamically generating entity models for OData I could use a bit of help with getting the finer bits of manually defining Navigation Properties. If not, do you know somebody who’s an Edm Goddess?
For more details see my forum post in the ADO.NET, Entity Framework, LINQ to SQL, NHibernate forum:
https://forums.asp.net/p/2085521/6022522.aspx?p=True&t=635912368648167847
I’m really close – just need some others who are also familiar with these libraries to brainstorm with.
Thanks
So, I’ve been working for K2 for about a year-and-a-half now and am still enjoying being part of an actual software company again. Today I found out they’ve produced a new How To video for the product I’ve been the primary developer on for the last year or so.
This component is a broker that connects to a RESTful web service and exposes its entities and methods as K2 SmartObjects – which can be used in workflows, reports and other K2 blackpearl or Appit processes.
The area outlined by the blue box below is the functionality I am responsible for:
Last month the Hanselminutes podcast had a great interview titled You don’t know JS with Getify (Kyle Simpson) about his book of the same name. While the book series sounds like a great resource, I really enjoyed hearing a constructive discussion of many of the concerns I’ve had about the rapidly growing popularity of Javascript. Like any language, it has strength and weaknesses. As always, I’m a firm believer in using the right tool for the job.
]]>Beth’s thoughtful Confidence Through Feedback, or Why Imposter Syndrome is the Wrong Metaphor is an important essay that digs deep into some of the most pervasive issues that plague not just tech jobs, but all employment in the U.S.
I highly encourage everyone to read it – from the rank-and-file to the highest of upper management.
]]>Topics: Free MS ebooks, Xamarin podcast, cloud server in 55 sec., squash your PNGs, Heartbleed fallout, RDP from Android.
A short roundup this week; been busy with the funding campaign for the FoodStats mobile app.
Topics: VMWare re-certification, “you want to be a programmer?”, symlinks for WordPress plugins, open source HTML5 widgets, 1-click VM deployment.