You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/20200211-properly-remove-team/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -340,7 +340,7 @@
340
340
<h1id="how-to-quickly-and-properly-delete-a-team-without-waiting">How to quickly and properly delete a Team (without waiting)</h1>
341
341
<divclass="admonition note">
342
342
<pclass="admonition-title">Article update</p>
343
-
<p>2020-11-29 : I've updated the article following the the update of the CLI for Microsoft 365, adding a new command for permanently delete a site collection.</p>
343
+
<p>2020-11-29 : I've updated the article following the update of the CLI for Microsoft 365, adding a new command for permanently delete a site collection.</p>
344
344
</div>
345
345
<h2id="use-case">Use Case</h2>
346
346
<p>You work for a company that wants to automatically create a Team with Tabs, Channels and other stuff that will make a new project team ready to rock the stage.</p>
<p>As you can see, it's a 403 error, which is well-known when using Graph API endpoints that have not been allowed on the first place.</p>
408
-
<h3id="add-graph-api">Add Graph API</h3>
422
+
<h3id="add-graph-api-through-ui">Add Graph API through UI</h3>
409
423
<p>From the Azure portal, display the <em>Azure Active Directory</em> (AAD), then select the <strong>App Registration</strong> menu and select <strong>All Applications</strong>, then click on <strong>SharePoint Online Client Extensibility Web Application Principal</strong>. It's the AAD Application that holds the connection to the API (Microsoft and others) from SharePoint (SPFx or every other development) using the <em>Implicit Flow</em>.</p>
410
424
<p>Once here, click on <strong>Add a permission</strong>, then select <strong>Microsoft Graph</strong> and add the [<em>People.Read</em>] Graph API <ins>delegated permission</ins> (you can type the name of the permission in the available search box to get it easily).</p>
2</pre></div></td><tdclass="code"><divclass="codehilite"><pre><span></span><code>m365 login <spanclass="c1"># Don't execute that command if you're already connected</span>
437
+
m365 spo serviceprincipal grant add --resource <spanclass="s1">'Microsoft Graph'</span> --scope <spanclass="s1">'People.Read'</span>
438
+
</code></pre></div>
439
+
</td></tr></table>
440
+
441
+
<divclass="admonition info">
442
+
<pclass="admonition-title">Info</p>
443
+
<p>Don't be surprised if by that way, the permission appears in the "Other permissions granted for [your tenant]": it won't prevent your SPFx solution to work.</p>
444
+
</div>
420
445
<h3id="try-again">Try again</h3>
421
446
<p>Now try to use the <code>PeoplePicker</code> component again: you'll see that with the addition of the Graph API permission, you should be able to use that component!</p>
2</pre></div></td><tdclass="code"><divclass="codehilite"><pre><span></span><code>m365 login <spanclass="c1"># Don't execute that command if you're already connected</span>
461
+
m365 spo serviceprincipal grant add --resource <spanclass="s1">'contoso-api-dp20200915'</span> --scope <spanclass="s1">'user_impersonation'</span>
462
+
</code></pre></div>
463
+
</td></tr></table>
464
+
465
+
<divclass="admonition info">
466
+
<pclass="admonition-title">Info</p>
467
+
<p>Don't be surprised if by that way, the permission appears in the "Other permissions granted for [your tenant]": it won't prevent your SPFx solution to work.</p>
468
+
</div>
469
+
<divclass="admonition warning">
470
+
<pclass="admonition-title">Warning</p>
471
+
<p>If you use an Azure Function as an API and enable <strong>Managed Identity</strong> for any reason, you better have to rename the linked AAD Application to give it a different name than both your Function and its <strong>Managed Identity</strong>. Otherwise, the command will try to find a scope on it instead of the AAD App and fail.</p>
472
+
</div>
433
473
<h3id="updated-sample">Updated sample</h3>
434
474
<p>To run your custom API from your SPFx component, you can update your sample like below:</p>
0 commit comments