Sunday 27 October 2019

Google Tag Manger

 "Tag Manager gives you the ability to add and update your own tags for conversion tracking, site analytics, remarketing, and more. There are nearly endless ways to track activity across your sites and apps, and the intuitive design lets you change tags whenever you want." https://marketingplatform.google.com/about/tag-manager/benefits/

Tag manager is useful for adding 3rd party tags/scripts.


Saturday 19 October 2019

Evidence Based Management for Scrum

Evidence Base Management (EBM) is an management framework that uses evidence and metrics.  Execs & Middle mgmt don't get insight and normal forecasts.  EBM framework to help management move the company.  The mgmt can use evidence to drive the business forward.  Inspect and adapt using evidence.  I like to keep everything simple and move towards a more complex mature set of measurements as the easiest metrics to implement provide early value to the project.

"Evidence-Based Management is a framework organizations can use to help them measure, manage, and increase the value they derive from their product delivery."  Scrum.org

Examples Types of metrics you may want to measure:
  1. Velocity
  2. Sprint Burn downs
  3. Versioning - versions of product or bugs requiring multiple fixes
  4. Code Coverage & Code Analysis
  5. Missed bugs/escaped bugs - bugs missed in a release
  6. Issues/Failed Deployments
  7. Team happiness - capture metrics in Sprint Retrospective from the team
  8. Financial measure - cost to delivery
  9. Average User Story completion time per team (identify outliers and average for each team.  Do from started status to completed status).
  10. Average story points per team, factoring in the number of team members over multiple sprints (don't compare teams as their unit size is not consistent across teams; if you do try standardize, the teams will give more points to fake outperforming other teams).
Help management nudge the teams and company in the right directions.  To get these metrics, need to explicitly determine what the goals are, so can figure out KPI and we are measuring this right things.  Ensure the management goals are SMART (Specific: Well defined, clear, and unambiguous) or use OKR framework to define goals to figure out the metrics to collect.  Ensure the metrics are important to the goals of the company or team.   Consider using
"Objectives and key results (OKR) is a goal-setting framework that helps organizations define goals — or objectives — and then track the outcome."  cio.com

Common KPI's:  
  1. Escaped Defects
  2. Defects in the last 14 days
  3. In Progress Features and User Stories per team
  4. Team velocity
  5. Stories completed vs stories committed
  6. Tech debt (know issue, items skipped)
  7. Team burndown charts
A couple of columns and dashboard widgets for summarizing progress in DevOps:
  1. Progress by User Story Total minus remaining rolling up to features.
  2. Progress by Work Items in a feature - get user stories, tasks, spikes that make up the feature and shows % of artefacts completed within the feature.
  3. Epic Progress - each epic show the number of features and number of feature completed e.g. 3 of 11 feature completed.
  4. Number of "In Progress" feature or User stories per scrum team - very useful to check a team is using and updating artefacts proactively.
  5. Priority committed and done using priority or WSJF.
Three goals of KPI's in Scrum:
  1. Measure deliverables
  2. Measure team ability to deliver business value
  3. Measure the scrum team itself

Wednesday 16 October 2019

Troubleshooting Box.com programmatic access

This post is loosely connected to:
Using Box.com Programatically (JWT)
Using Box.com Programatically (Part2)

Troubleshooting:
Box has a brilliant Connectivity Test Tool

ErrorSystem Error: System.AggregateException
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) as System.Threading.Tasks.Task'1.GetResultCore(Boolean waitCompletionNotification)
Initial Hypothesis:  As my Box programmatic access was working on 1 machine but not on a VM at my client i suspected it was a difference in the environment or network connectivity.
Resolution:  I added System.Threading dlls, it did not fix the issue as i assumed it was GAC on my machine but on on the server.  No effect.
Resolution:  Check traffic using Fiddler and could see URL were not reachable/returning data.  Use the Box.com Connectivity Test tool and I could see multiple outbound https/443 URL were being blocked by the corporate firewalls.

Error:  Error Message: System.AggregateException
 Stact Trace:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
Initial HypothesisThis happened after the networking was corrected and from a machine on the Internet, so the issue is not networking.  I was not pushing the config.json file out to my bin directory, so the upload of a file was using an expired JWT.
Resolution:  The message did not give me a good inclining into the issue.  My output directory e.g. /bin folder was not getting updated with the config.json file.  I copied the correct JWT/config.json file and the error is resolved.

ErrorError Message : System.IO.IOException : based64 data appears to be truncated
Resolution:  Check the config.json file, my file got corrupted.

Error: Error Message : invalid_client
The client credentials are invalid.
Resolution:  The config.json was to a trial tenant that I previously has setup, get the correct config.json file.

Error: Error Message: invalid_grant
 Stact Trace: Signature verification error. The public key identified by "kid" must correspond to the private key used for signing.
Resolution: The Box admin team had revoked the JWT, a new config.json file was generated and fixed the issue.

Sunday 6 October 2019

Common Azure Services

Azure Key Vault - Secure config storage and retrieval
There are SDK's for working with Azure Key Vault such as the "Azure Key Vault secret client library for .NET (SDK v4)".  Extremely easy to get secrets from the secure vault using C#.

Azure Storage
Microsoft Azure Storage Explorer is a great tool for reviewing your Azure Storage and in the case below I used it to add some Azure table storage for a demo customer list.
There is also a web edition of Storage explorer that is in preview as of 18 Nov 2020.

App Service - Host Web sites or WebAPI

Azure Artifacts - Code and share your packages via NuGet, and npm packages with Azure Artifacts for more reliable and scalable builds

Azure Data Factory (ADF) - Basically PaaS fully managed Azure ETL/SSIS.  Many connectors to ingest data.  Send to Azure Synapse Analytics.

Azure Big Data


Azure Synapse Analytics  - is a managed PaaS solution that brings together ADF, Data Lakes (both Storage and Analyse) and Azure Data Warehouse under single managed solution.  Easier than the individual pieces and scales as you need with almost unlimited capability.  Azure Purview - discover and analyses all your data, integrates with AIP.  Azure Synapses simplified analytics, sold as a PaaS (Serverless) or dedicated.  Easiest way to draw data out of Azure Synapse is Power BI.  Easy to bring data into Azure Synapse from CosmosDB and SQL databases (no affect on performance) can automatically push the data into Synapse, no need for ADF. And the data is in live time.



Azure Application Configuration - Feature Toggles/Feature flags are extremely useful in code.  This service is great for turning on experimental features, operation feature, environment/release features, and security features.  Feature Toggles (aka Feature Flags) (martinfowler.com)  Use for feature flags whereas KeyVault is for secrets.



Azure Resource Explorer - Documentation on Azure API's and ability to call the APIs.

Azure Policy - Azure Policy Templates can be custom created that apply rules to your subscription.  There are a lot out of pre-canned policies.  You can enforce naming conventions, tagging standards, enforce deployment of resources into specific regions, ....

Sunday 29 September 2019

OAuth for Custom Connectors

Problem:  I have an APIM end point that has both the subscription key and OAuth2 setup for security and I need to connect Power Apps.

There are basically two parts to this problem, setting up your Power App to use OAuth and then also passing in the subscription key on every APIM end point request.
  • This post assumes that both the APIM App registration and the Client App have been registered on Azure AD.
  • Check with postman can access the end point as shown below.  Postman will authenicate and use the bearer token (OAuth) and the subscription as shown below to test
Client ID: 5559555-555a-5558-5554-555d4
Auth URL: https://login.microsoftonline.com/555fd555-555f-5554-5551-555b444c3555/oauth2/v2.0/authorize
Token URL: https://login.microsoftonline.com/555fd555-555f-5554-5551-555b444c3555/oauth2/v2.0/token
Refresh URL: https://login.microsoftonline.com/555fd555-555f-5554-5551-555b444c3555/oauth2/v2.0/authorize


We now know the APIM is working with OAuth and the subscription key.
Configure OAuth from Power Apps:
  • Once Postman can get valid 200 responses using OAuth2 and the subscription key, setup the custom connector.  I could not get the Azure AD connector to work so i used the OAuth connector as shown below: 

Add a policy that will add the subscription key to every https request to the APIM/resources as shown below.

Updated 2 Feb 2020 - Example of custom OAuth code flow authentication for a custom API's using AAD security.

Note: Deploying Custom Connectors in solutions always seems to be an issue.  It is a good idea to keep all connection references in a separate Power Apps Solution.

Saturday 28 September 2019

Flutter vs Xamarin vs React Native vs PhoneGap

Overview:  As a solution architect and CTO I need to choose the right approach to help our clients select the correct technology and approach to delivering solutions.
Flutter vs React Native vs Xamarin
My History of Building Mobile Applications:
  • Originally, building mobile apps required building two code bases generally for Android and iOS in their own language.  Xamarin also allows you to write in C# for a specific platform.
  • Next came a single code base that compiled down into each native platform (Droid and iOS), then we would customize for each platform.
    • I like Xamarin Forms as I want native apps with a single code base (C#).  One can also write separate code bases for each of the 2 main mobile platforms. 
    • React Native is built using Facebook's ReactJS library.  React Native like Xamarin Forms uses a single code base that compiles a iOS and a Android app.
  • Note: An alternative around this time was to use HTML5 with PhoneGap and deploy to both mobile platforms, native controls could be used but this was once again a split in the code base.
  • Flutter is the newest of the options.  Flutter is from Google and uses it's own DART language, it then can be compiled into various formats including iOS and Android.  Flutter goes back to the single code base that pushes native apps to multiple platforms.  Including the Web.  It is fast, looks good, great native interaction.

More Info
Flutter vs React Native - 

Alex Zubkov - 6Aug 2020

Friday 27 September 2019

Basics of Flutter

Overview:  Flutter is a UI toolkit built by Google used to create native mobile applications (and web sites (Hummingbird)) using a single code base.  Historically, I have tried to keep a single code base in the front end using Angular, KO or ReactJS for my websites and used PhoneGap to build pseudo native apps on Android and iOS.  This allows me to have a single code base and also deploy to Droid and iOS with minor tweaks on PhoneGap.  
Tips:
  • There is a Flutter add-in for Visual Studio Code.
  • Flutter uses "Dart" as it's programming language.
  • Dart is a strongly types object orientated language that compiles into JavaScript for websites, and "natively" for iOS and Droid.
  • Also can compile code for native Windows, Mac, Chromebook.
  • Everything is a Widget (layout widget, elements e.g. image, text, or a gesture widget (listens for actions like a tap)),
  • Add widget together to make a custom widget,
  • Widgets are either stateless e.g. picture or stateful e.g. textbox
  • import the material.dart to provide basic building blocks
The more I see of Flutter, the more I like it.  It is quick to build mobile apps and looks fantastic.

Cons:
  • Pretty new & hard to find skills
  • Slightly bloated on a native app - not noticeable to end users
Basic Environment setup:
  1. Surface Windows 10 Pro
  2. Visual Studio Code
  3. Flutter SDK
  4. Android emulator (I didn't setup iOS)
  5. Android device to load the package to try it out on a phone

Emulator Running using Flutter