Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Uncategorized

VIDEO – Protect WebAPI data endpoint with ADAL (Azure AD)

Wanted to record brief demo of how to protect WebAPI data endpoint with ADAL (Azure Active Directory) Authentication Library.   Azure Portal enables us to register custom SPA (Single Page Application) for secure API calls to backend REST data sources.   OAuth Bearer HTTP headers are applied to provide security with JWT tokens (JSON Web Token).   Video shows all steps from Azure Portal registration to F12 validation of REST data calls.

Cheers 

shades_smile

Video

Screenshots

image
image
image
image
image
image
image
image

Code


References

VIDEO – Deploy Azure VM using ARM template and Bash Cloud Shell

Wanted to record a live demo of how to use the Azure portal Cloud Shell to create Virtual Machines with Azure Resource Manager (ARM) templates.   JSON format stores the various resources we want and can be difficult to read in raw format.   Fortunately Microsoft offers ARMVIZ online utility to graphically display the contents of ARM JSON files, including dependency arrows, familiar colorized resource icons,  and feature to double click any item and view matching JSON line.

Cheers

shades_smile

Video

Screenshots

https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.json

image

https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-cosmosdb-sql/azuredeploy.json

image

https://github.com/Azure/azure-quickstart-templates/blob/master/oms-scomacs-solution/azuredeploy.json

image

https://github.com/Azure/azure-quickstart-templates/blob/master/oms-active-directory-security-audit-solution/azuredeploy.json

image

image

image

References

VIDEO – SPFx Application Customizer for Google Analytics tracking Modern SPO

Demo how to inject Google Analytics traffic tracking JavaScript to any Modern SharePoint Online site with SPFX .   Full coding demo shows steps for coding, configuration, deployment, and testing.   Modern page UI is tightly controlled by Microsoft to keep customers on the product roadmap.   Using SPFX to inject Application Customizer is the recommended and supported method to Also feel free to download the complete SPPKG package, upload to App Catalog, and deploy to any SPO site collection on your tenant.   Simply change the final PowerShell cmdlet (Add-PnPCustomAction) to have the correct Google Analytics Tracking ID for your GA Property. Cheers. 

shades_smile

Video

SPPKG Code

PNP Install

Connect-PnPOnline -UseWebLogin -Url https://spjeff.sharepoint.com
Get-PnPWeb
# Use GUID from SPFX MANIFEST.JSON
Add-PnPCustomAction -ClientSideComponentId "c430bd95-a1ac-4edd-9e25-7dbf3358062b" -Name "Google Analytics for SharePoint" -Title "GA for SharePoint" -Location ClientSideExtension.ApplicationCustomizer -ClientSideComponentProperties: '{"trackingID":"UA-5417707-7"}' -Scope Site
Get-PnPCustomAction -Scope Site

Screenshots

image
image
image
image
image
image
image

References

    Practical PowerShell Logs

    All scheduled PowerShell files should generate LOGs.  “Start-Transcript” is a great cmdlet for this.  Adding a few more features can boost operations support.   LOGs answer essentials support questions like:

    • Which parent PS1 generated this LOG?
    • Did script perform needed functions?
    • Any errors?
    • How long did it take?
    • Which user and computer ran the script?

    Below is code template I recommend to for scheduled PowerShell jobs to generate a LOG. Key features include:

    • Auto detect current folder and script PS1
    • Create  \LOG\ subfolder
    • Prefix to match parent PS1
    • Suffix with unique date time stamp
    • Elapsed run duration (Days, Hours, Minutes)

    Thank you to @ToddKlindt for improvements to formula and elapsed time.  Cheers. 

    shades_smile

    Video

    Code

    function Main() {
        ### YOUR CODE HERE
    }
    
    # Open Log
    $prefix = $MyInvocation.MyCommand.Name
    $host.UI.RawUI.WindowTitle = $prefix
    $stamp = Get-Date -UFormat "%Y-%m-%d-%H-%M-%S"
    Start-Transcript "$PSScriptRoot\log\$prefix-$stamp.log"
    $start = Get-Date
    
    Main
    
    # Close Log
    $end = Get-Date
    $totaltime = $end - $start
    Write-Host "`nTime Elapsed: $($totaltime.tostring("hh\:mm\:ss"))"
    Stop-Transcript

    Download

    https://github.com/spjeff/spadmin/blob/master/Practical-PowerShell-LOGs.ps1

    © Copyright 2016
    @ SPJeff

    Return to Top ▲Return to Top ▲