How To Upgrade SPFx Version Using O365 CLI

Ahamed Fazil Buhari
 
Senior Developer
May 26, 2020
 
Rate this article
 
Views
858

Keeping our solution up-to-date is one of the key thing to get all the new features, improvements and bug fixes that were happened for that release. SPFx is evolving in each release and we can see that the solutions that’s developed few months back has already outdated with new release. By the time I write this article, the SPFx has latest version of 1.10,

spfxv

Still we can manually upgrade SPFx to any version we need by updating few package versions in package.json file and update runtime compiler and so on, well for that we should keep your eyes wide opened so that we won’t mess up with other packages and versions.

Well, this article is all about how easily and quickly we can upgrade SPFx solution. For that I used Office 365 CLI which is great tool for managing your Microsoft Office 365 tenant and SPFx solutions (and it works on any platform). In the below example I am gonna upgrade my SPFx from 1.8 to 1.10. The below solutions is an Application Customizer, so you may notice some package different compare to SPFx WebPart but that doesn’t matter for this article. All it matters is how to upgrade from 1.8 to 1.10

This is what I have in my package.json before upgrade. With the help of spfx project upgrade command we can easily upgrade the version,

ver

We can see list of things that needs to be updated after we ran the command spfx project upgrade –toVersion 1.10.0 now we clearly know what file and what package should get updated. After making changes by following the output that we received from spfx project upgrade command. My application customizer has been successfully upgraded to version 1.10.

ver10

Happy Coding

Fazil

Category : Node, Office 365, SPFx

Author Info

Ahamed Fazil Buhari
 
Senior Developer
 
Rate this article
 
Ahamed is a Senior Developer and he has very good experience in the field of Microsoft Technologies, especially SharePoint, Azure, M365, SPFx, .NET and client side scripting - JavaScript, TypeScript, ...read more
 

How to change Azure Function App version using Azure CLI

Ahamed Fazil Buhari
 
Senior Developer
November 8, 2018
 
Rate this article
 
Views
2454

Hi,

In this article we will look into, how to change version of Function App using Azure CLI, to setup Azure CLI please refer my previous article How to access Azure Function App settings from Azure CLI. Once Azure CLI is setup, please follow below steps to change the version.

In my azure portal, I have function app called my-azure-fn which has version 2.0 and I need to degrade the version to v1.0.11959.0

clip_image002

Sometimes, it’s not possible to degrade version from the portal. The alternative way is, we can update the version from Azure CLI command prompt.

Run the below command and mention you function app name, resource name and version that needs to be updated.

az functionapp config appsettings set –name <fun-app-name> –resource-group <resource-name> –settings FUNCTIONS_EXTENSION_VERSION=<version-num>

clip_image004

After successful execution of above command, my-azure-fn app version has been changed to 1.0.11959.0

clip_image006

Happy Coding

Ahamed

Category : Azure, Function APP

Author Info

Ahamed Fazil Buhari
 
Senior Developer
 
Rate this article
 
Ahamed is a Senior Developer and he has very good experience in the field of Microsoft Technologies, especially SharePoint, Azure, M365, SPFx, .NET and client side scripting - JavaScript, TypeScript, ...read more
 

Get the Files with Version Greater than the Given Version Number – SharePoint PowerShell

Sathish Nadarajan
 
Solution Architect
June 2, 2016
 
Rate this article
 
Views
5330

In this article, let us see, how to retrieve the list of Files with Version Greater than the Given Version Number. i.e., on the Config file, I will have some version number and within the WebApplication, the files with greater than the given version needs to be listed on the XML File.

 ######################### this method will return the Files with Greater Version than the Given Input
 
 function GetFilesWithVersionGreaterThanGiven()
 {
     Write-Host "Entered GetFilesWithVersionGreaterThanGiven Method" -ForegroundColor Yellow 
     Add-Content "$ProgressFile" "Entered GetFilesWithVersionGreaterThanGiven Method"
     $script:Progress = "5:Entered"
     
     # Get the WebApplication Object
     $WebApplication = Get-SPWebApplication $Config.Configuration.WebApplication.URL
 
     # Assign the XML Output File Paths
     $FilesWithVersionGreaterThanGiven_XML_Path = $scriptBase + "Reports-$LogTimeFilesWithVersionGreaterThanGiven.xml"
     
     # Create the XML File Tags
     
     $xmlWriter = New-Object System.XMl.XmlTextWriter($FilesWithVersionGreaterThanGiven_XML_Path,$Null)
     $xmlWriter.Formatting = 'Indented'
     $xmlWriter.Indentation = 1
     $XmlWriter.IndentChar = "`t"
     $xmlWriter.WriteStartDocument()
     $xmlWriter.WriteComment('Files List On the WebApplication ' + $WebApplication.DisplayName)
     $xmlWriter.WriteStartElement('WebApplication')
     $xmlWriter.WriteEndElement()
     $xmlWriter.WriteEndDocument()
     $xmlWriter.Flush()
     $xmlWriter.Close()
     
     # Get All SiteCollections within webApplication
     $SiteCollections =  $WebApplication | Get-SPSite -Limit All
     #$SiteCollections =  Get-SPSite "http://ctsc00556722901:5555/sites/TeamSite2/"
     
     # write the output on XML File
     $xmlDoc = [System.Xml.XmlDocument](Get-Content $FilesWithVersionGreaterThanGiven_XML_Path);
     $siteCollectionNode = $xmlDoc.CreateElement("SiteCollections")
     $xmlDoc.SelectSingleNode("//WebApplication").AppendChild($siteCollectionNode)
     $xmlDoc.Save($FilesWithVersionGreaterThanGiven_XML_Path)
     
     # Iterate through the Site Collections
     foreach($SiteCollection in $SiteCollections)
     {
         $siteCollectionName = $SiteCollection | select @{label = "Title";Ex = {$_.rootweb.Title}} 
         
         # write the output on XML File
         
         $xmlDoc = [System.Xml.XmlDocument](Get-Content $FilesWithVersionGreaterThanGiven_XML_Path);
         $siteCollectionNode = $xmlDoc.CreateElement("SiteCollection")
         $xmlDoc.SelectSingleNode("//WebApplication/SiteCollections").AppendChild($siteCollectionNode)
         $siteCollectionNode.SetAttribute("Name", $siteCollectionName.Title)
         
         
         $subSitesNode = $siteCollectionNode.AppendChild($xmlDoc.CreateElement("SubSites"));
         $xmlDoc.Save($FilesWithVersionGreaterThanGiven_XML_Path)
         
         # Get All the Webs
         $Webs = Get-SPWeb -site $SiteCollection -Limit All 
         
         # Iterate through the Webs
         foreach($Web in $Webs)
         {
             # write the output on XML File
             $subSiteNameNode = $subSitesNode.AppendChild($xmlDoc.CreateElement("SubSite"));
             $subSiteNameNode.SetAttribute("Name", $Web.Title)
             $subSiteNameNode.SetAttribute("Url", $Web.Url)
             $subSiteNameNode.SetAttribute("WebID", $Web.Id)
             
             $parentWebTitle = ""
                             
             if($Web.ParentWebID -ne "00000000-0000-0000-0000-000000000000")
             {
                 $parentWeb = $SiteCollection.OpenWeb($Web.ParentWebID)
                 $parentWebTitle = $parentWeb.Title
                 
             }
             else
             {
                 $parentWebTitle = "RootWeb"
             }    
             $subSiteNameNode.SetAttribute("ParentWebName", $parentWebTitle)
             $subSiteNameNode.SetAttribute("ParentWebID", $Web.ParentWebID)
                             
             $FilesNode = $subSiteNameNode.AppendChild($xmlDoc.CreateElement("Files"));
             
             $xmlDoc.Save($FilesWithVersionGreaterThanGiven_XML_Path)
             
             # Iterate through the Lists
             foreach ($list in $Web.Lists) 
             {
                 # validate for Document Library
                 if ($list.BaseType -eq “DocumentLibrary”) 
                 {
                     # Iterate threough the Doc Library Items
                     foreach ($item in $list.Items) 
                     {
                         # Check for the Version
                         if([decimal]$item.File.UIVersionLabel -ge [decimal]$Config.Configuration.FetchFilesAboveTheVersion)
                         {
                             # If Yes, then write the details on the XML Output file
                             
                             $FileNode = $FilesNode.AppendChild($xmlDoc.CreateElement("File"));
                             $FileNode.SetAttribute("Name", $Item.File.Title)
                             $FileNode.SetAttribute("Url", $Item.File.Url)
                             $FileNode.SetAttribute("Version", $item.File.UIVersionLabel)
                             
                             $xmlDoc.Save($FilesWithVersionGreaterThanGiven_XML_Path)
                                                                               
                         }
                     }
                 }
             } 
         }
     }    
     # write the output on XML File
     $xmlDoc.Save($FilesWithVersionGreaterThanGiven_XML_Path)
     
     Write-Host "Completed GetFilesWithVersionGreaterThanGiven Method" -ForegroundColor Yellow 
     Add-Content "$ProgressFile" "Completed GetFilesWithVersionGreaterThanGiven Method"
     $script:Progress = "5:Success"
 }
 ########### End of Method #################
 

The snippet is self-explanatory.

Happy Coding,

Sathish Nadarajan.

Category : PowerShell, SharePoint

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

How to Identify the Version and Service Packs installed on a SharePoint 2013 Server

Sathish Nadarajan
 
Solution Architect
May 13, 2014
 
Rate this article
 
Views
42256

In many cases, we may not be bothered about the Version, Service Packs installed on our Server when we do the development. It is obvious that, when we get the requirement, immediately we will start analysis the requirement.

But recently there was a situation that one of our client wants to move on to the new Service Pack which released on this April. In that case, we may also have to analyze the impact of the new Service Pack. Before knowing that, I just wanted to know, what are the things installed on our Dev environment first. Then on top of it, what needs to be installed and what would be the impact after installation.

To answer all these questions, First we need to know what is the version installed on our Farm.

Use the following command to get the Version of the product installed using PowerShell script.

(Get-SPFarm).Products

The output of the above command will be something like,

image

By seeing the GUID, we will be able to identify the Product. These GUIDs will not change. On all the environments, and all the machines, the GUIDs will remain same.

Here are all of the product GUIDs:

GUIDProduct
35466B1A-B17B-4DFB-A703-F74E2A1F5F5EProject Server 2013
BC7BAF08-4D97-462C-8411-341052402E71Project Server 2013 Preview
C5D855EE-F32B-4A1C-97A8-F0A28CE02F9CSharePoint Server 2013
CBF97833-C73A-4BAF-9ED3-D47B3CFF51BESharePoint Server 2013 Preview
B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9SharePoint Server 2013 Enterprise
298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0SharePoint Server 2013 Enterprise Preview
D6B57A0D-AE69-4A3E-B031-1F993EE52EDCMicrosoft Office Web Apps Server 2013
9FF54EBC-8C12-47D7-854F-3865D4BE8118SharePoint Foundation 2013

And to know about the Service Packs, there is no need of any PowerShell Commands. That we can directly go to the Central Administration and find.

1. Go to Central Administration.

2.image

3. Click on “Upgrade and Migration” on the Quick Links.

4.image

5. Click on “Check Product and Patch Installation Status”

6.image

7. This will tell us the current Patches Installation. By seeing the Version column we can identify. On the screen shot above shared, there is no SP installed. You can download the latest Service Pack from Here.

8. To Identify the Version through C#, please refer the link http://msdn.microsoft.com/en-us/library/jj659075.aspx

Happy Coding.

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment