title: Azure CLI commands not working inside azure function apps (portal)
body: <p>I have powershell scripts which is running locally.But those scripts not running insite function apps > powershell (windows) machine.</p>
  
  <blockquote>
    <p>az login --service-principal -u $ServicePrincipalId -p
    $ServicePrincipalPass --tenant $ServicePrincipalTenant</p>
  </blockquote>
  
  <p>Getting below when i run the script</p>
  
  <pre><code>ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.
  </code></pre>
  
  <p>since i dont have az cli installed in the windows machine,  i have added below line to install az command in my script.</p>
  
  <pre><code>Install-Module -Name Az -AllowClobber  -Scope CurrentUser
  </code></pre>
  
  <p>Getting access issue while installing the az. </p>
  
  <pre><code>2019-06-11T12:42:59.698 [Warning] WARNING: InternalWebProxy: Could not find a part of the path 'D:\Program Files (x86)\SiteExtensions\Functions\2.0.12507\32bit\workers\powershell\runtimes\win-x86\lib\netcoreapp2.1\ref'.
  2019-06-11T12:42:59.843 [Warning] WARNING: Win32Helpers: Could not find a part of the path 'D:\Program Files (x86)\SiteExtensions\Functions\2.0.12507\32bit\workers\powershell\runtimes\win-x86\lib\netcoreapp2.1\ref'.
  2019-06-11T12:43:05.023 [Warning] WARNING: User declined to install module (Az).
  </code></pre>
  
  <p>even -Force is not working. need to know what is causing the issue.</p>
  
  <p>Note :- The script is perfectly running in local windows machine. the issue is when try to run on portal > functionapp> timertrigger</p>
  
  <p>Attaching azure function app creating with windows machine</p>
  
  <p><a href="https://i.stack.imgur.com/0O4kS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0O4kS.png" alt="enter image description here"></a></p>
  
  <p>Getting error after adding cli folder into kudu</p>
  
  <pre><code>&gt; 2019-06-13T12:29:40.510 [Error] ERROR:   File
  &gt; "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-68v0_w99\azure-cli-core\azure\cli\core\commands\__init__.py", line 523, in execute Microsoft.Azure.WebJobs.Script.Rpc.RpcException :
  &gt; Result: ERROR:   File
  &gt; "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-68v0_w99\azure-cli-core\azure\cli\core\commands\__init__.py", line 523, in execute Exception:   File
  &gt; "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-68v0_w99\azure-cli-core\azure\cli\core\commands\__init__.py", line 523, in execute
  </code></pre>
  
  <p>kudu console</p>
  
  <p><a href="https://i.stack.imgur.com/B6LaG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B6LaG.png" alt="enter image description here"></a></p>