Thursday 23 July 2020

Shopify thoughts

Overview:  Recently, I had two requests for some work around shopping carts/auctions.  I dismissed the first request as it is not what I specialize in.  On the second request, I decided to take the project on at a hugely discounted rate as I felt I did not have expertise in the field.

Shopify: Shopify is an amazing product and eco system, and I have build a great shop on the SaaS Shopify platform in record time.  There are great plug-ins to add functionality such as gift registry's, and Mobile add integration.  I have now been playing with the product, deliver solutions, worked with app vendors, reviewed competitor's, had help from Shopify support and I can honestly say that it is awesome.


Program-ability:

  • There are simple API's that are well documents.  
  • The internal language is Liquid which is basically a UI scripting language.
  • Shopify SaaS has add ins and templates, so look before developing
Liquid:


In the code snippet above I am building custom functionality int he cart checkout to add specific products to allow more sales on the store depending on custom rules provided by the customer.

Mobile:
The templates OOTB or that shop admins can purchase follow responsive design as one would expect.  There are add-ons for iOS and Droid to make native apps, very well priced with good functionality changed on a monthly reoccurring basis (circ $40-100/month).  I need a custom mobile app for both platforms so I'm between choosing to build with Flutter or Blazor.


Friday 10 July 2020

Power Apps Tracing to App Insights Not Working in edit mode

Overview: Power Apps integrates to directly log to App insights.  This post looks at the issues around Tracing in App insights.

Setup & Verify:
App Insights instance Instrument Key Required, Config you Power App to Trace to App Insights, and create a button to test.
The Monitor Tool is fantastic for tracing all outbound traffic, you no longer need to go to the service and check if Power Apps is reaching.  For example I use to have to look at the APIM Azure App logs for custom Connectors.
I can see all my interactions in Power Apps and travelling out.  This is a massive win for Power Apps so giving Tracing from the front end.

Greg Lindhorst, wrote a post on using the Power Apps Monitor Tool for debugging and performance improvement.
Note: Traces written to App Insights don't work in preview.  Verify, see below.

Problem: It normally takes a few minutes (like 2 minutes) to show up in App Insights, it is not showing up after 15 minutes.  Let's see, I've drop the Power Apps team a message and i think it's a bug that has crept in recently.  Today is 10 July 2020.  I've also notice that none of my Session page tracing is showing up in App Insights.

Update: 11 July 2020, the Power Apps behaviour has been on my mind.  I'm in edit mode, and when I publish the app and use it, App Insights logs perfectly.  When in edit mode running the app, even direct traces, no logging into Power Apps.  I did not realise this, but it kind of makes sense.

Resolution: Publish & Run the app, and the Tracing and Power App session tracing shows up in App Insights.

Only when I Run the Published App to my Page Views and Custom Traces get logged in App Insights.

Tuesday 30 June 2020

Multi-Geo for MS Teams

O365 offers multi-geo tenants to meet data residency rules for 13 countries and regions (as of 30 June 2020):
  1. Australia
  2. Asia Pacific 
  3. Canada
  4. European Union
  5. France
  6. India
  7. Japan
  8. Korea
  9. United Kingdom
  10. United States
  11. United Arab Emirates
  12. South Africa
  13. Switzerland.
Teams data resides in SharePoint Online, OneDrive for Business and Exchange Online.  With Multi-Geo enabled, a company can specify where data will reside.  There are 2 parts to multi-geo:
  • User specific data.  This data is stored in various satellite Geo for each user e.g. email, OneDrive
  • Company/Project/division specific data e.g. file shares, Document libraries
For more info on Multi-Geo on O365

Microsoft "Multi-Geo is currently available to Enterprise Agreement customers with a minimum of 250 Microsoft 365 Services subscriptions."

The UK South Azure Region has 3 data centres/zones, and it's geo-paired paired with UK West there is over 150 mile between the regions. 

MS Teams Background Info:
https://www.pbeck.co.uk/2019/12/microsoft-teams-governance.html
https://www.pbeck.co.uk/2020/05/microsoft-teams-overview.html

Note: Microsoft since 2022 I think have Microsoft Priva to help manage country privacy & compliance laws 

Wednesday 24 June 2020

Postman API Builder Intro

Overview: Tools for building and mocking API's.  Swagger has good tooling and my original preferred choice.  APIM - Great tooling, part of Azure and easy to replace mocks as you go along with the live implementation.  Postman is offering a great set of functionality to rival Swagger and APIM.  This post looks at Postman's new functionality around building API's.

Postman API Builder:
Not only a test rig, it now offers the ability to build API's and mock:
  • Mock - so you can test supports key and OAuth authentication
  • Assert Tests - You can specify asserts in postman
  • Test suite - generate collections/Collection Runner - Allows a set of related tests to run sequentially.
]
  • Document the API
  • Monitor
  • Version control for changes e.g. GITHub
  • API Versions supported
  • Note: Free plan has all of this, limited on the number of API's but all the features are on the free plan.  The main notation formats are support including:  Open API specification (OAS) & GraphQL
Summary:
I like Swagger tooling, I have done a few projects find APIM fantastic for building API's quickly.  Postman historically was merely my test rig but looking at the functionality, Postman API Builder is a great option for designing and building API's.  Postman is a good tool for building into CI/CD pipelines to validate API's.

Few more assert examples:

Postman offers a service to monitor API's using your postman collections, these can be triggered using Curl so can build into DevOps, Power Automated scheduled flows,....
sentry.io looks good as an alternative option

Thursday 28 May 2020

Microsoft Teams Power Apps Integration

Overview: Teams are amazing, I was a complete Slack fan, but I'm 100% now a teams supporter.  It's part of O365, replaces Skype (which was great but only a chat app like zoom), you get your email, and can add all your apps and websites to your Team.

Adding your custom Power Apps to Teams:

Adding A Power App to MS Teams:




Notes:
  1. MS Teams uses the Chrome engine (Chromium) as it's browser.
  2. A feature I don't like about Teams is that when i switch focus to say a chat window and come back to my Power app within MS Teams, I loose my place in my power app and the app is loaded from scratch.
  3. I believe the problem of apps maintaining session state will be solved shortly with pop out Windows in Teams around July/Aug 2020.
High-Level Flow to Build a native MS Team application:

Some Teams Dev Options: Power Apps, Blazor SPFx, React, Flutter

Friday 22 May 2020

Micrososervice and SOA introduction

What are Microservices: A type of SOA, basically distributed computing.  Microservices are a subset of SOA but with loosely couple architecture.  Independent deploy-able services, tries to reduce/remove other services dependency on a specific service.  I can change a service and it does not affect other service/break existing services.  Allows us to have a small scope of release, therefore easy to test and increase release frequency.  Services will depend on other services.  SOA is older but both are well tried and tested.  Microservices is generally preferred but it's much easier to move to SOA for a monolith.  

Monolith Systems:  Monolith are the way most systems were built, large full deployments.  All code is packaged into a large module of code.  They are simple and often are sometimes fairly appropriate such as on-prem. software.  Beware the Distributed Monolith:  Separate services but high dependent, end up having to co-ordinate deployment between code bases.

More on SOA: Independently deploy able,  DDD for scoping works well for defining Microservices.  Need to get the boundaries right is key.  Using Bounded Context is a good way to have multiple related models and show their overlapping points.

Each service operates in isolation which are processes.  Allow us to scale independently.  Containers are good for hosting these services.  Communication generally done over request/Response (most commonly HTTPS) e.g. REST API or Event-Driven e.g. Azure Service Bus.  Event is broadcast from the service, listening services is responsible for listening to the event.

Encapsulation of data, the data is hidden inside the Microservice boundary. Allows for independent deployment.

Main Benefits of SOA:

  • "Microservice buy you options";
  • As smaller independent units are deployed, which leads itself to faster deployments to production using CI and CD.  More teams/devs  can work independently;
  • Defense in Depth Security;
  • Scalability from performance - Scale up, identify bottlenecks (change tech or scale service hosting bottleneck);
  • Failure Independence - tolerate partial failures, service redundancy;
  • Cost - focus cost as needed, scale up and down.  Deliver service quickly, can replace with better technology e.g. service use an expensive workflow software to do some logic, as business grows, build a C# service that does the work faster, better, and lower cost and no need to BPM.

Note: SOA does not guarantee these benefits, you need to adjust to get them

Tip:  Still use similar technology stacks and patterns, don't allow each service to be built without considering the consumers.  Try keep on a similar stack e.g. don't use C#, NodeJS, Python, Go for different web services.


Friday 8 May 2020

cURL for Windows 10 & Azure Cognitive Service Primer

In this example I am using Azure Cognitive service to provide a jpeg using curl on my Windows 10 Surface laptop.

Updated: 2021-10-28: The latest on Cognitive search, Semantic Search looks interesting