Azure CLI命令在Azure功能应用程序内部不起作用(门户) [英] Azure CLI commands not working inside azure function apps (portal)
问题描述
我有在本地运行的powershell脚本,但是这些脚本未运行站点功能应用程序> powershell(windows)计算机。
I have powershell scripts which is running locally.But those scripts not running insite function apps > powershell (windows) machine.
az登录--service-principal -u $ ServicePrincipalId -p
$ ServicePrincipalPass --tenant $ ServicePrincipalTenant
az login --service-principal -u $ServicePrincipalId -p $ServicePrincipalPass --tenant $ServicePrincipalTenant
运行脚本
ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.
由于我没有在Windows机器中安装az cli,因此我在下面添加了以下内容来安装az命令
since i dont have az cli installed in the windows machine, i have added below line to install az command in my script.
Install-Module -Name Az -AllowClobber -Scope CurrentUser
在安装az时出现访问问题。
Getting access issue while installing the az.
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).
偶-强制不起作用。需要知道是什么原因引起的。
even -Force is not working. need to know what is causing the issue.
注意:-该脚本可以在本地Windows计算机中完美运行。问题是当尝试在门户网站上运行> functionapp> timertrigger
Note :- The script is perfectly running in local windows machine. the issue is when try to run on portal > functionapp> timertrigger
使用Windows计算机附加创建天蓝色的功能应用程序
Attaching azure function app creating with windows machine
将cli文件夹添加到kudu中后出现错误
Getting error after adding cli folder into kudu
> 2019-06-13T12:29:40.510 [Error] ERROR: File
> "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 :
> Result: ERROR: File
> "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
> "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-68v0_w99\azure-cli-core\azure\cli\core\commands\__init__.py", line 523, in execute
kudu控制台
推荐答案
由于错误表明您未安装环境中的Azure CLI。要安装Azure CLI,一种可能的方法是将在本地计算机上安装的整个CLI目录复制到功能KUDU路径 / home
。
As the error shows that you do not install the Azure CLI in the environment. To install the Azure CLI, a possible way is to copy the whole CLI directory that you installed in the local machine to your function KUDU path /home
.
在测试中,函数KUDU中的复制路径为 D:/ home / CLI2 /
。
In the test, the copy path in the function KUDU is D:/home/CLI2/
.
测试代码:
D:/home/CLI2/wbin/az.cmd login --service-principal -u 'xxxxxx' -p 'xxxxxx' --tenant 'xxxxxx' | Write-Host
输出的屏幕截图:
这篇关于Azure CLI命令在Azure功能应用程序内部不起作用(门户)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!