title: Azure Functions Powershell Module Import
body: <p>I am not able to have the AzuedAD module to run in Azure Functions it gives the below warning and error. It works on the local machine but not in the Azure functions app
  It is running on the serverless plan</p>
  <pre><code>2021-05-23T04:37:44.334 [Warning] WARNING: Module AzureAD is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell Core please use 'Import-Module -SkipEditionCheck' syntax.
  </code></pre>
  <p>The syntax  for  'Import-Module -SkipEditionCheck' = ?</p>
  <p><strong>Requirements.Psd1</strong></p>
  <pre><code>#
  @{
      # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. Uncomment the next line and replace the MAJOR_VERSION, e.g., 'Az' = '5.*'
      'Az' = '4.1.0'
      'AzureAD' = '2.0.2.135'
  }
  </code></pre>
  <p><strong>host.json</strong>
  The ManagedDependency has an issue stating that  *</p>
  <blockquote>
  <p>&quot;Property managedDependency is not allowed.&quot;</p>
  </blockquote>
  <ul>
  <li></li>
  </ul>
  <pre><code>{
    &quot;version&quot;: &quot;2.0&quot;,
    &quot;logging&quot;: {
      &quot;applicationInsights&quot;: {
        &quot;samplingSettings&quot;: {
          &quot;isEnabled&quot;: true,
          &quot;excludedTypes&quot;: &quot;Request&quot;
        }
      }
    },
    &quot;extensionBundle&quot;: {
      &quot;id&quot;: &quot;Microsoft.Azure.Functions.ExtensionBundle&quot;,
      &quot;version&quot;: &quot;[1.*, 2.0.0)&quot;
    },
    &quot;managedDependency&quot;: {
      &quot;enabled&quot;: true
    }
  }
  </code></pre>
  <p><strong><strong>The Code</strong> run.ps1</strong></p>
  <pre><code>using namespace System.Net
  
  # Input bindings are passed in via param block.
  param($Request, $TriggerMetadata)
  
  
  Import-Module AzureAD -UseWindowsPowerShell  
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  #[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls, [Net.SecurityProtocolType]::Tls11, [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Ssl3
  $Username =
  $Password=  | ConvertTo-SecureString -AsPlainText -Force  
  $Credential = New-Object System.Management.Automation.PSCredential($Username, $Password) 
  Connect-AzureAD  -Credential $Credential | Out-Null
  
  $list = Get-AzureADGroupMember  -ObjectId 123456
  
  
  
  # Associate values to output bindings by calling 'Push-OutputBinding'.
  Push-OutputBinding -Name Response -Value (
      [HttpResponseContext]@{
      StatusCode = [HttpStatusCode]::OK
      Body = $list
  }
  )
  </code></pre>