Skip to content

Commit 27096a3

Browse files
Deployed 2f88a4d with MkDocs version: 1.0.4
1 parent be17393 commit 27096a3

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

articles/20200211-properly-remove-team/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
<h1 id="how-to-quickly-and-properly-delete-a-team-without-waiting">How to quickly and properly delete a Team (without waiting)</h1>
341341
<div class="admonition note">
342342
<p class="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>
344344
</div>
345345
<h2 id="use-case">Use Case</h2>
346346
<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>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

sitemap.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>None</loc>
5-
<lastmod>2021-03-02</lastmod>
5+
<lastmod>2021-03-03</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>None</loc>
10-
<lastmod>2021-03-02</lastmod>
10+
<lastmod>2021-03-03</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
</urlset>

sitemap.xml.gz

0 Bytes
Binary file not shown.

tips/20210302-spfx-api-permissions/index.html

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,15 @@
248248
</li>
249249

250250
<li class="md-nav__item">
251-
<a href="#add-graph-api" class="md-nav__link">
252-
Add Graph API
251+
<a href="#add-graph-api-through-ui" class="md-nav__link">
252+
Add Graph API through UI
253+
</a>
254+
255+
</li>
256+
257+
<li class="md-nav__item">
258+
<a href="#add-graph-api-through-cli-for-microsoft-365" class="md-nav__link">
259+
Add Graph API through CLI for Microsoft 365
253260
</a>
254261

255262
</li>
@@ -279,6 +286,13 @@
279286
Add your AAD Application to the SharePoint Service Principal
280287
</a>
281288

289+
</li>
290+
291+
<li class="md-nav__item">
292+
<a href="#add-custom-api-through-cli-for-microsoft-365" class="md-nav__link">
293+
Add custom API through CLI for Microsoft 365
294+
</a>
295+
282296
</li>
283297

284298
<li class="md-nav__item">
@@ -405,7 +419,7 @@ <h3 id="run-it-in-remote-workbench">Run it in remote workbench</h3>
405419
<p>Display your developer toolbox (F12) and go to the browser console, you should see the following error:</p>
406420
<p><img alt="alt text" src="../../images/tips/20210302/peoplepicker-console-fail.png" title="PeoplePicker console fail" /></p>
407421
<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-
<h3 id="add-graph-api">Add Graph API</h3>
422+
<h3 id="add-graph-api-through-ui">Add Graph API through UI</h3>
409423
<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>
410424
<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>
411425
<p><img alt="alt text" src="../../images/tips/20210302/aad-app-spo-api-graph.png" title="AAD App SPO Graph API" /></p>
@@ -417,6 +431,17 @@ <h3 id="add-graph-api">Add Graph API</h3>
417431
<p class="admonition-title">Warning</p>
418432
<p>It can take a couple of minutes before consented permissions is effective, so don't be surprised if it's not working right away after approval.</p>
419433
</div>
434+
<h3 id="add-graph-api-through-cli-for-microsoft-365">Add Graph API through CLI for Microsoft 365</h3>
435+
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
436+
2</pre></div></td><td class="code"><div class="codehilite"><pre><span></span><code>m365 login <span class="c1"># Don&#39;t execute that command if you&#39;re already connected</span>
437+
m365 spo serviceprincipal grant add --resource <span class="s1">&#39;Microsoft Graph&#39;</span> --scope <span class="s1">&#39;People.Read&#39;</span>
438+
</code></pre></div>
439+
</td></tr></table>
440+
441+
<div class="admonition info">
442+
<p class="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>
420445
<h3 id="try-again">Try again</h3>
421446
<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>
422447
<p><img alt="alt text" src="../../images/tips/20210302/peoplepicker-ui-success.png" title="PeoplePicker UI success" /></p>
@@ -430,6 +455,21 @@ <h3 id="add-your-aad-application-to-the-sharepoint-service-principal">Add your A
430455
<p>Finally, grant this permission by clicking on <strong>Grant admin consent for contoso</strong>.</p>
431456
<p>If you go again in the <em>API access</em> page, you should see something like this:</p>
432457
<p><img alt="alt text" src="../../images/tips/20210302/api-access-custom-approved.png" title="API access custom approved" /></p>
458+
<h3 id="add-custom-api-through-cli-for-microsoft-365">Add custom API through CLI for Microsoft 365</h3>
459+
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
460+
2</pre></div></td><td class="code"><div class="codehilite"><pre><span></span><code>m365 login <span class="c1"># Don&#39;t execute that command if you&#39;re already connected</span>
461+
m365 spo serviceprincipal grant add --resource <span class="s1">&#39;contoso-api-dp20200915&#39;</span> --scope <span class="s1">&#39;user_impersonation&#39;</span>
462+
</code></pre></div>
463+
</td></tr></table>
464+
465+
<div class="admonition info">
466+
<p class="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+
<div class="admonition warning">
470+
<p class="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>
433473
<h3 id="updated-sample">Updated sample</h3>
434474
<p>To run your custom API from your SPFx component, you can update your sample like below:</p>
435475
<div class="superfences-tabs">

0 commit comments

Comments
 (0)