title: PNP PowerShell Connect-PnpOnline with -AccessToken is not setting connection in Azure Functions
body: <p>I have an Azure Function which is using PnpPowershell. I'd like to work with the users authorization. So I created a service which is getting an OAuth token from Microsoft for the user. I then give the token to the Azure Function to use it to connect via <em>Connect-PnpOnline</em>.</p>
  <pre><code>Connect-PnpOnline -AccessToken $token -Url $url
  Apply-PnPProvisioningTemplate &quot;Template.xml&quot;
  </code></pre>
  <p><em>Connect-PnpOnline</em> executes without any errors/warnings, but <em>Apply-PnpProvisioningTemplate</em> raises the following error: <em><strong>The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect.</strong></em></p>
  <p>I'd have expected the connection to be in place. I can use this token to query the MS Graph, so I'd have expected it to be valid. Does anyone have tried something similar and have an idea how to solve the issue?</p>
  <p>Found this:</p>
  <p><a href="https://docs.microsoft.com/de-de/powershell/module/sharepoint-pnp/connect-pnponline?view=sharepoint-ps" rel="nofollow noreferrer">https://docs.microsoft.com/de-de/powershell/module/sharepoint-pnp/connect-pnponline?view=sharepoint-ps</a></p>
  <p><a href="https://github.com/pnp/PnP-PowerShell/issues/2631" rel="nofollow noreferrer">https://github.com/pnp/PnP-PowerShell/issues/2631</a></p>
  <p><a href="https://github.com/pnp/PnP-PowerShell/issues/2184" rel="nofollow noreferrer">https://github.com/pnp/PnP-PowerShell/issues/2184</a></p>