In SharePoint there used to be a ‘copy shortcut’ option in the right-click menu on a document. This feature is not available currently. Now we need to go to the share sub-menu to get a link to the document, but what is offered there is the docidredir link, not the full path.
This SPFx extension opens a dialog where the user can see the document full path. The Email Link button helps the user to share the link via default email client.
The first step is to create a SPFx Git Repository Project in VSTS.
Let us clone the newly created Git project into your favorite local folder using the following git command
git clone -b master repopath
SharePoint Framework(SPFx) Web Part Setup
Go to the project directory using command prompt/ terminal and set up your SPFx Web Part project as explained here. I am going to use my sample code here but feel free to write your own logic in your SPFx Web Part.
This is my project folder structure
One Time Activity
Let us package artifacts and upload the files in app catalog site and CDN library.
Open the write-manifests.json file under config folder and update the cdnBasePath parameter with your CDN SharePoint Document Library path.
Make sure you are still in the project directory you used to set up your web part project. In the console window, execute the following gulp task:
This will build the minified assets required to upload to the CDN library in temp\deploy directory. Go to your CDN SharePoint Library and upload the generated files.
In the console window, execute the following gulp task to package your client-side solution that contains the web part:
The command will create the .sppkg package file in the sharepoint/solution.
Go to your App Catalog site and upload the generated .sppkg file to the App Catalog. This will deploy the client-side solution package. SharePoint will display a dialog and ask you to trust the client-side solution to deploy. Click deploy.
At this point the web part is ready to be used on a page. Open a site where you want to test the web part and go the Site contents page of the site. Choose Add – App from the toolbar and choose the your app to be installed on the site.
After the app has been installed, add the webpart in a page
Check-in the code and push the same to master branch via Visual Studio Code editor.
At this point we are ready integrate our SPFx web part project repository with VSTS continuous build and release process.
Upload the highlighted custom gulp tasks provided by Elio Struyf and install the necessary npm packages as per the instruction given.
Update the gulpfile.js as shown below:
Continuous Integration and Delivery Setup in VSTS
Switch back to VSTS
Go to build & release section and click New button
Select the empty template and click Apply.
Configure the following variables for the build and release. Adjust the values as per your environment.
Add the following tasks and configure it as shown below
NPM Install – npm
Update CDN Location – Gulp
Bundle Project – Gulp
Package Solution – Gulp
Upload Files in CDN – Gulp
Upload App Package to App Catalog – Gulp
Deploy App – Gulp
Also enable the continuous integration settings so that the build process starts when the latest code is checked-in in master branch.
All done. Now it is time to test our continuous build and release process by pushing a new code change to git repository and check build process get triggered.
Let us change the progress bar color to red and check-in the latest change to git.
Commit & Push Code Changes
Build and Release Status
As you can see in the screenshot, the latest code got updated and progress bar color is reflecting.
Note: You can isolate the deployment process from the build process using a release template.
Is it possible to host Multiple Provider Hosted Apps in a Single Azure Web Site?
The answer is Yes. If yes how?
Here you go…..
Create Azure Site
Create Required App Folders
Go to azure web site
Click on the Configure link in the top navigation for the web site
Scroll to the bottom of the page and enter the values for your new virtual paths as shown below:
Note: Make sure you check the Application checkbox.
Register your apps using appregnew.aspx page as shown below
Note: Here I am adding my virtual directory sub folder name(App1 and App2) after azure website URL.
Your app manifest file should look like this
Note: Here I am adding my virtual directory sub folder name(App1 and App2) after ~remoteAppUrl. If you don’t have Remote Event Receiver in your app, you do not need to configure InstalledEventEndpoint and UninstallingEventEndpoint.
Publishing configuration(App Web Project) should be something like this
Note: Here I am adding my virtual directory sub folder name(App1 and App2) after site name.
Finally the app package configuration should be like this
Note: Here I am NOT adding my virtual directory sub folder name(App1 and App2).
I want a custom app to be installed by default whenever a site is created with a specific site collection/managed path/template and users from that site should not remove that app from that site. The best way to implement this is to create a feature stabling with custom site definition. Unfortunately, SharePoint Online does not support feature stabling or site definition.
As a SharePoint or global admin in Office 365, you can create an App Catalog site to make internally developed custom apps available for users to install when they browse apps under the From Your Organization filter on the Site Contents page. Site owners can then add these apps.
The first step is to create the App Catalog site collection if it hasn’t already been created.
Once the App Catalog has been provisioned, upload the first version(my first version: 126.96.36.199) of your app in the app catalog site.
Install the first version of your app in the app catalog site.
Select the ellipses ( …) next to the app, select the ellipses ( …) again in the callout to view the menu, and then select Deployment.
Now you will be redirected to the “Manage App Deployments” page where in you can configure where you wish to install the app. App can be installed with Site Collections, Managed Paths and Site Templatesbased scopes.
Configure the setting as per your requirement and click Ok (if required trust the app)
In this example, I wanted to install my app in https://sharepointrider.sharepoint.com/sites/dev site collection under sites managed path with Developer Site templates only.
Now the app should be installed in the above said sites
Note: If you notice, the app information callout’s footer section is rendered only with an About callout action and user can not remove the app from the site.
Now upload the next version(188.8.131.52) of your app in the app catalog site
Upgrade the app in the app catalog site
Now your app should get upgraded automatically in the sites you configured in step # 4.
This approach provides the flexibility and governance for SharePoint add-in deployments.
MAC SharePoint users were downloading the files from SharePoint 2007 Document Libraries using the CURL command but the same is not working after migrating the SharePoint 2007 sites to SharePoint Online(SPOL).
SharePoint Online uses claims based authentication and direct NTLM based curl commands are not allowed.
SPOL allows remote applications to call the REST API with user impersonation. This article demonstrates how to access SPOL REST API and download the files from a tenant using Apple Bash Script and Curl commands. However, outside of .NET the authentication piece is not so straightforward. App authentication solves this issue for registered apps but in this document you will see how remote user authentication can be achieved, regardless of platform.
The below diagram illustrates the HTTP requests which need to be made in order to authenticate SharePoint Online.
Office 365 Tenant connected with Active Directory Federated Service(ADFS) and MAC OS
Download the BashSPOLFileDownload.sh file from here
Open BashSPOLFileDownload.sh file in a text editor(TextWrangler/TextMate) and update the UserName (Line #4) and Password (Line #5).
Note: The UserName & Password provided should have access to download the file from SharePoint Online.
To download the file from a different SharePoint Online site/library/folder/file where the account has access, change the values of EndPoint(Line #6) and FileServerRelativeUrl(Line #7) values.
Save the BashSPOLFileDownload.sh file
Open Terminal (command line tool) and go to the path where BashSPOLFileDownload.sh file is saved
Execute the following command to convert the BashSPOLFileDownload.sh file executable chmod 700 BashSPOLFileDownload.sh
Run the script using just the name of the script(Example : ./ BashSPOLFileDownload.sh)
If all goes well, you should be able to see the downloaded file in the output path given in OutputFilePath(Line #9).
UserName and Password provided might be wrong
Access denied from SharePoint Online for the UserName and Password provided
Provided Site/Document Library/Folder/File is not available in SharePoint Online or wrong
Text Editor might have changed or corrupted the BashSPOLFileDownload.sh file while saving
Create an Azure Website in Azure Portal. In this example, I am going to create an azure website with name “cloud-demo-providerapps”
I wish to use one azure website to host multiple provider hosted apps. So I am going to create separate folders to deploy my provider hosted app files as shown below: (In this example, I am going to deploy my provider hosted app files under “AzureDeployTest” folder.)
Note: It is mandatory to check the application checkbox
To prepare the build, create a new folder in your system(laptop/server). In this example the folder name is “SPOL_Stage_Build_09252015V01”
Download the azure website profile from azure portal and paste it inside the “SPOL_Stage_Build_09252015V01” folder. In this example my azure profile name is “cloud-demo-providerapps.azurewebsites.net.PublishSettings”
Note: This will be done by admin team. So include this in the deployment instruction.
Create a XML file inside the “SPOL_Stage_Build_09252015V01” folder with name “xml” and configure the XML file in the below format
I have created a SharePoint Framework WebPart using AngularJS 1.5.8 (not using TypeScript) which was working fine in workbench.html. However I have noticed that we get intermittent errors and WebPart failed to render when a user does things like refresh. We could reproduce this error in all the major browsers.
TypeError: s.bootstrap is not a function
TypeError: qa.fn is undefined
One thing is very clear from the error is that the angular related objects/modules are not recognized when the SPFx WebPart is trying to bootstrap. So I started analyzing the other components involved in the page and I could find the following
More than one SPFx WebPart using angualr 1.5.8
Initially I thought it might be an angular load timing/sequence issue and tried to reference angular in the page layout directly but no luck
MS Engineer suggested to load JQuery latest version(2.X or 3.X) for custom actions but still I could not resolve the issue.
I also tried to load the custom actions with JQuery noConflict() method
As we all aware angular uses the lite version of JQuery internally. If JQuery is not available in the page, angular.element delegates to AngularJS’s built-in subset of JQuery, called jqLite. I noticed the SPFx WebPart was loading in all the browsers consistently when custom actions with no JQuery or without custom actions on the page. This means the JQuery(any version) included in the custom action conflicts with the jqLite included in angular. This was the root cause.
Now I have 2 options
Remove JQuery from custom actions
Avoid JQuery Conflict in SPFX WebPart
As per the MS Engineer, The product group is looking at adding some documentation/samples to show how to do option 2. Let us wait for this update as we can not completely avoid JQuery in SharePoint Development.