Showing posts with label DevOps. Show all posts
Showing posts with label DevOps. Show all posts

SPFX with DevOps using SharePoint ALM & Blob Storage

Implement SPFx (SharePoint Framework) deployment with DevOps using SharePoint ALM Commands & Blob Storage

Azure DevOps (Visual Studio Team Services / Team Foundation Server) consists of a set of tools and services that help developers implement DevOps, Continuous Integration, and Continuous Deployment processes for their development projects.

This article explains the steps involved in setting up your Azure DevOps environment with Continuous Integration and Continuous Deployment to automate your SharePoint Framework builds, unit tests, and deployment.

SharePoint ALM (Application Life Cycle Management) APIs provide simple APIs to manage deployment of your SharePoint Framework solutions and add-ins across your tenant or Site Collection level.

ALM APIs can be used to perform exactly the same operations that are available from a UI perspective

Continuous Integration

Continuous Integration (CI) helps developers integrate code into a shared repository by automatically build  and packaging the solution each time new code changes are submitted.

Setting up Azure DevOps for Continuous Integration with a SharePoint Framework solution requires the following steps:

Office Azure & SharePoint ALM - Build Pipeline

  • Node 10.x
  • Gulp Clean
  • Gulp Build
  • Gulp Bundle --ship
  • Gulp Package-Solution --ship
  • Publish Build Artifacts  (Task Version 1)
    • "Display Name" -> Publish Artifact: CDN
    • "Path to Publish" -> temp/deploy
    • "Artifact Name" -> CDN
    • "Artifact Publish Location" -> Azure Pipeline
  • Publish Build  Artifact
    • "Display Name" -> Publish Artifact: App
    • "Path to Publish" -> sharepoint/solution
    • "Artifact Name" -> App
    • "Artifact Publish Location" -> Azure Pipeline


Continuous Deployment

Continuous Deployment (CD) takes validated code packages from build process and deploys them into a staging or production environment. Developers can track which deployments were successful or not and narrow down issues to specific package versions.

Setting up Azure DevOps for Continuous Deployments with a SharePoint Framework solution requires the following steps:

  • Office Azure & SharePoint ALM - Build Pipeline
  • Azure file copy (Task Version 2)
    • "Display name"-> AzureBlobFileCopy
    • "Source"->  $(System.DefaultWorkingDirectory)/_AzureDevOpsCI/CDN
    • "AzureConnectionType"-> Azure Resource Manager
    • "Azure Subscription"
    • "Destination Type"-> Azure Blob
    • "RM Storage Account"- > 
    • "Container Name"->
  • SharePoint ALM: Catalog Scoped Actions
    • "Display name"->SharePoint ALM: Add Solution Package
    • "Connection to SharePoint" -> commsite01
    • "Action"-> Add Solution  Package
    • "Path to SharePoint Solution Package"-> $(System.DefaultWorkingDirectory)/_AzureDevOpsCI/App/devops-01.sppkg
    • "
    • "PackageId output variable"-> AppPackageId
  • SharePoint ALM: Catalog Scoped Actions
    • "Display name"->SharePoint ALM: Deploy Solution Package
    • "Connection to SharePoint" -> commsite01
    • "Action"-> Deploy Solution Package
    • "Id of the package in the SharePoint App Catalog"  -> $(AppPackageId)


End to End implementation SPFx deployment using Azure DevOps with SharePoint (Application Life Cycle Management) & Blob Storage for Static files.




SPFX with DevOps using Office 365 CLI

Implement SPFx (SharePoint Framework) deployment with Azure DevOps Pipeline using Office 365 CLI

Azure DevOps (Visual Studio Team Services / Team Foundation Server) consists of a set of tools and services that help developers implement DevOps, Continuous Integration, and Continuous Deployment processes for their development projects.

This article explains the steps involved in setting up your Azure DevOps environment with Continuous Integration and Continuous Deployment to automate your SharePoint Framework builds, unit tests, and deployment.


Continuous Integration

Continuous Integration (CI) helps developers integrate code into a shared repository by automatically build  and packaging the solution each time new code changes are submitted.

Setting up Azure DevOps for Continuous Integration with a SharePoint Framework solution requires the following steps:

  • Office 365 CLI Build Definition
  • Node 10.x
  • Gulp Clean
  • Gulp Build
  • Gulp Bundle --ship
  • Gulp Package-Solution --ship
  • Copy Files
    •  "Display Name" -> Copy Files To: Copy Files to: $(Build.ArtifactStagingDirectory)/drop
    • "Contents" ->  **/*.sppkg
    • "Target Folder" -> $(Build.ArtifactStagingDirectory)/drop
  • Publish Build  Artifact
    • "Display Name" -> Publish Artifact: drop
    • "Publish To Path" -> $(Build.ArtifactStagingDirectory)
    • "Artifact Name"  -> Drop
    • "Artifact Publish Location" -> Azure Pipelines

Continuous Deployment

Continuous Deployment (CD) takes validated code packages from build process and deploys them into a staging or production environment. Developers can track which deployments were successful or not and narrow down issues to specific package versions.

Setting up Azure DevOps for Continuous Deployments with a SharePoint Framework solution requires the following steps:


  • Office 365 CLI Release Pipeline
  • Node 10.x
  • NPM 
    • "Display Name" -> npm custom
    • "Command" -> custom
    • "command and arguments" -> install -g @pnp/office365-cli
  • Command Line
    • "Display Name" -> Connect to SPO
    • "Scripts" -> 
    •  o365 login https://$(tenant).sharepoint.com/$(catalogsite) --authType password --userName $(username) --password $(password)
  • Command Line
    • "Display Name" ->SP add solution
    • "Scripts" -> 
      • o365 spo app add -p $(System.DefaultWorkingDirectory)/_SPFx-AutomateDeployment-CI/drop/drop/sharePoint/solution/clidemo-02.sppkg --overwrite --appCatalogUrl https://$(tenant).sharepoint.com/$(Devcatalogsite) --scope sitecollection
  • Command Line
    • "Display Name" -> Deploy Solution
    • "Scripts" -> 
      • o365 spo app deploy --name clidemo-02.sppkg --appCatalogUrl https://$(tenant).sharepoint.com/$(Devcatalogsite) --scope sitecollection

End to End implementation SPFx deployment with Azure DevOps using Office 365 CLI

 



Microsoft Search With Azure DevOps Graph Connector

 Microsoft Search shows the content that your organization has stored in Microsoft 365 Tenant or indexed through connectors.

 



Microsoft Graph connectors can index third-party data to appear in Microsoft Search results. The third-party data can be hosted on-premises or in the public or private clouds. Connectors expand the types of content sources that are searchable in your Microsoft 365 productivity apps and the broader Microsoft ecosystem.
 
In this article, let's understand how to index "Azure DevOps" items using Graph Connector into Microsoft Search Results.
 
Note
The Azure DevOps connector supports only the Azure DevOps cloud service.



License requirements
 
To view data from connectors in your search results, users must have one of the following Microsoft 365 or Office 365 subscriptions,
  • Microsoft 365 or Office 365 Enterprise E3 or E5
  • Microsoft 365 or Office 365 Education A3 or A5
Lets start configuration steps,
 
Step 1 - Navigate to Connectors
  1. Go to Microsoft 365 admin center.
  2. In the navigation pane, go to Settings.
  3. Select > Microsoft Search.
  4. Select > Connectors
  5. Select > + Add


Step 2 - Select Azure DevOps as data source
 
Microsoft has seven connector avaible to connect with external datasource and several partner released connector to connect with external datasource.


Step 3 - Fill connection name details
  • Name (mandatory)
  • Connection Id (mandatory)
  • Description (Optional)

Step 4 - Configure settings
 
AzureDevOps Organization -> Login to https://dev.azure.com and sign in with your orgnaization account. You can create new organization name or use existing one if exists.
 
Select Authentication Type as "Work or School Account"
 
You must register an app in AzureDevOps so that Microsoft search app can access the instance. Do use below information to complete the registration.
 
Navigate to https://app.vsaex.visualstudio.com/app/register
 
S.NOFieldsValuesDescription
1Company NameUse Appropriate NameThis is the name of your company.
2Application NameMicrosoft SearchThis unique value identifies the application that you're authorizing.
3Application Websitehttps://gcs.office.com/This required field is the URL of the application that will request access to your Azure DevOps instance during connector setup.
4Authorization Callback Urlhttps://gcs.office.com/v1.0/admin/oauth/callbackA required callback URL that the authorization server redirects to.
5Authorized ScopeSelect the following scopes: Identity (read), Work Items (read), Variable Groups (read), Project and team (read), Graph (read)This is the scope of access for the application
 
As configuration details complete, you will navigate to below details; i.e. App ID & Client Secret.
 
Extend Microsoft Search With Azure DevOps Graph Connector
Add generated App ID and Client Secret to complete authentication process.



Step 5 - Configure Data
 
Select project in the organization to crawl
 
Edit property, if  you need to add more properties click preview > Next to proceed. 


Step 6 - Manage Schema
 
You can choose which column can be set as Queryable, Searchable & Retrievable.  It is standard schema configuration as SharePoint Search.


Step 7 - Manage Search Permission
 
You can choose to use the ACLs specified in the full crawl screen or you can override them to make your content visible to everyone



Step 8 - Content Refresh Settings
 
You can configure the incremental and full refresh interval.



Step 9 - Review connection and complete
 
All defined configurations can be reviewed and modified here. Once it completes, click to finish to proceed.



Step 10 - Review connection and complete
 
Wait for a couple of minutes and connection state will change from Publishing to Ready. Once connection state is ready, two actions need to be performed in sequence,
  1. Create Result Source.
  2. Create Vertical.


Result Type 
 
A search result type is a rule that causes distinct kinds of search results to be displayed in different ways. It consists of the following,
  • One or more conditions to compare each search result against, such as the content source of the search result.
  • A result layout to use for search results that meet the conditions. The result layout controls the way that all results that meet the conditions appear and behave on a search results page.
Step 11 - Result Type Section
 
Once you select create result type, there will be simple steps to follow such as naming convention and entering the result type



Step 12 - Result Type Content Source
 
Select appropriate content source, so that crawled or configured data can be mapped properly.

Step 13 - Design Layout
 
Once you click "Launch Layout Designer", it will navigate to https://searchlayoutdesigner.azurewebsites.net/



Step 14 - Search Layout Designer
 
Select blank layout and design the required card.
 
Copy content from Layout Payload editor and paste into step no. 13.


Layout payload editor added to github link here
 
Step 15 - Review the resut type settings
 
Review the result type configuration and proceed to Vertical creation to map with defined result type.


Manage Vertical
 
Verticals make it easier for users to find the information that they have permission to see.
 
You can add search verticals that are relevant to your organization. These will appear on the Microsoft Search results page in SharePoint, Office, and Bing.
 
Before you start, make sure that the connector has been indexed. This can take up to 48 hours, depending on the file size.
 
You can’t create a vertical for content that resides in SharePoint.
 
There are three basic steps to add a vertical,
  1. Create the vertical. In this step, you define the vertical’s name, content source, and scope of the content to search.
  2. Define what the results for this vertical will look like.
  3. Enable the vertical (to be displayed) from the vertical list page.
Step 16 - Create Vertical
 
In the navigation pane, go to custom connector, and then select the Verticals Link.
 
To add a vertical, select Add. Or, to edit a vertical, select it in the list.
 
Remember, verticals are created in a disabled state. They must be enabled before users can see them.

Step 17 - Connect Vertical with Content Source


Step 18 - Review and Add Vertical



Outcome
 
Azure Devops Data Screen Shot,





Microsoft Search Result from DevOps,


Related Article:-


I hope you have enjoyed and learned something new in this article. Thanks for reading and stay tuned for the next article.