Posts

Create O365 Group and Team using Graph API

Image
I would like to share the procedure to create a Microsoft 365 Group and a team in teams using Graph API. We will use application (AD App) permisions instead of current user (Delegate) permissions. Create Group Reference: https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http Create Team Reference: https://docs.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=http   Steps to create Daemon App: Create App in Azure Active Directory Provide following application Graph API permissions. Groups.ReadWrite.All, Directory.ReadWrite.All, Team.Create Grant Admin Consent. I have used Azure serverless Function App technology because it allows developers to host business logic that can be executed without managing or provisioning infrastructure. I have created a Http trigger function to create Group using Graph API. I have chosen .Net Framework to write C# code. Create Group Code: I have created another Http trigger function to crea...

Automated Site Collection Provisioning

Image
In this post, I would like to talk about automated site collection and teams ( Microsoft Teams ) provisioning in Microsoft 365. We had to provide Self-Service site and team creation for one of the clients instead of depending on Admins and at the same time without compromising governance. For this reason, we have added Admin approval step in Power Automate. The SharePoint site also should be created with custom template. We have developed a Governed Self-Service Site Creation solution. The process is as follows. I have inspired this process from the MS Doc article . We have created a hub site to group/organize all the sites requested by specific group/department. Custom List is used to drive user requests for a new site and it is maintained in hub site. Invoke Power Automate for approval by admin before creating a site. Power Automate Process Admin Approval Call Azure Function to initiate provisioning Provisioning Solution Create a Site Template using PnP provisioning engine. The foll...

Create Modern Pages in Classic SharePoint Site

Image
If you want to create Modern pages in a Classic SharePoint Site (both Team and Publishing), you just need to make sure following things are available. 1. Activate Site Pages feature if Site Pages library not exist. (Site Settings => Manage Site Features) 2. Add Site Page content type to Site Pages library. That's it. Now, you should be able to create modern pages in classic site.

Ignore/exclude spfx solution files to check-in in TFS

There are lot of files and folders does not required to check-in into version control like git and TFS. That's why, the yeoman generator automatically creates .gitignore file to instruct git to exculde certain files.  But what about if you are using TFS. Don't worry. TFS also has a provision to instruct to exclude files that is .tfignore .  Just follow below steps to create a .tfignore file.  Create a file with name .tfignore. Copy all data from .gitignore file. Add a backslack (\) character infront of folders. That's it. Now, the azure repos extension excludes the files and folders to check-in.

Azure repos extension - TFVC support is limited to Local workspaces

Azure Repos extension issue in VS Code Most frequently you may face this error if you are using Azure repos extension in VS Code. It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces You will see this error even though you are using local workspaces. Even Teams sign in does not resolve the issue most of the times. Not sure whether it is an issue with extension or VS Code. We can fix this by performing following activities. Unfortunately, you have to do this whenever you get above issue. Open Developer Command Prompt for VS 2017/2019. It depends on the version of tf.exe you have configured in VS Code. Navigate to workspace root folder Enter tf workspace Login with your credentials Reopen VS Code It should resolve the issue now.

Workflow runs twice

I came across an issue with a Visual Studio declarative workflow running twice on a library and I have configured the workflow to run on change event. Initially I thought there might be an issue with VS workflow, and then I have created a SharePoint designer workflow but the issue remains same. I was clueless. I have one more workflow, that is also running on change for another library and there were no issues with that. Then I tried to compare both libraries and found that versioning is enabled on problematic library and no versioning enabled for other library. If I disable versioning, the workflow runs only once. That's strange. I am completely clueless what's happening internally. What my guess is that the workflow running on item check-in event and item updated event. After doing lot of research, finally I found a workaround that worked very well for me. At the end of the workflow I have paused the workflow for 1 minute. Surprisingly, it has resolved my problem.

SharePoint 2013 workflow REST API unauthorized error

When we write a workflow that calls SharePoint or non-SharePoint HTTP (REST) web service from SharePoint workflow, "Authorization: Bearer" is added to HTTP header by default, which may sometimes result in " 401 Unauthorized " error response. Following workaround can be followed to avoid this error. Add "Authorization" field set with empty string ("") in a "RequestHeader" property of "Call HTTP Web Service" action in case of SharePoint designer workflow and "HttpSend" action in case of Visual studio workflow. In case of SharePoint on-premise, we also need to grant full access to workflow service account (given while configuring workflow manager) at web application level (Web application --> User Policy).