title: Azure Functions: PowerShell Script Interacting with SharePoint Online
body: <p>I'm playing around with Azure Functions, specifically a PowerShell script function. I'm wondering how I can use a script that is reaching out to SharePoint Online.</p>
  
  <p>To run against SharePoint Online I would normally use the "SharePoint Online Management Shell" which is a version of PowerShell that pre-loads the SharePoint Online library so that I can use methods like Get-SPOSite, etc.</p>
  
  <p>How can I include this library in my Azure Function PowerShell script so that I can use these functions? I'm assuming I need to load the library at the top of my script, but how do I load the library?</p>
  
  <p>I've uploaded the DLL into my function and am trying to use:</p>
  
  <pre><code>[System.Reflection.Assembly]::LoadFrom('Microsoft.Online.SharePoint.Client.Tenant.dll')
  </code></pre>
  
  <p>But this doesn't appear to work. I think my issue is that I don't know the absolute path to my uploaded file. This is what I see on the left hand pane:</p>
  
  <p><a href="https://i.stack.imgur.com/TUXaW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TUXaW.png" alt="enter image description here"></a></p>
  
  <p>But I don't know what the path of these files are.</p>
  
  <p>Any ideas? Documentation is frustratingly slim with the Azure Functions at the minute.</p>