Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 运行AZ命令的Azure函数_Powershell_Azure Functions_Azure Cli - Fatal编程技术网

Powershell 运行AZ命令的Azure函数

Powershell 运行AZ命令的Azure函数,powershell,azure-functions,azure-cli,Powershell,Azure Functions,Azure Cli,我有一个Powershell脚本,其中包含从Azure函数运行的az命令 我在requirements.psd1中指定了模块,并且启用了主机json托管依赖项 在我的脚本中,我输入了以下命令 Get-Module -Name Az -ListAvailable Import-Module Az Get模块在安装4.8.0后返回 然后我得到一个警告 [Warning] The Function app may be missing a module containing the 'az' co

我有一个Powershell脚本,其中包含从Azure函数运行的az命令

我在requirements.psd1中指定了模块,并且启用了主机json托管依赖项

在我的脚本中,我输入了以下命令

Get-Module -Name Az -ListAvailable
Import-Module Az

Get模块在安装4.8.0后返回

然后我得到一个警告

[Warning] The Function app may be missing a module containing the 'az' command definition. If this command belongs to a module available on the PowerShell Gallery, add a reference to this module to requirements.psd1. Make sure this module is compatible with PowerShell 7. For more details, see https://aka.ms/functions-powershell-managed-dependency. If the module is installed but you are still getting this error, try to import the module explicitly by invoking Import-Module just before the command that produces the error: this will not fix the issue but will expose the root cause.
接实际指挥

az storage account keys list <blah>

[Error] ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

az存储帐户密钥列表
[错误]错误:术语“az”无法识别为cmdlet、函数、脚本文件或可操作程序的名称。请检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
az cli当前在功能中不可用 powershell环境。这是一个功能问题,我们正在研究 它

请参阅

使用相应的
Azure PowerShell模块
应该是目前唯一的方法

您可以使用而不是
az存储帐户密钥

az cli当前在功能中不可用 powershell环境。这是一个功能问题,我们正在研究 它

请参阅

使用相应的
Azure PowerShell模块
应该是目前唯一的方法


您可以使用Azure CLI命令而不是Azure powershell代替
az存储帐户密钥

az存储帐户密钥列表
,这将是powershell cmd Get AzStorageAccountKey,但我已经能够在安装了Azure CLI的windows计算机上的powershell中运行az命令?是的。但是azure功能环境与您的本地PC设置几乎没有关系好吧,我现在离题了,但这让我想起了过去,是否有某种形式的决策树或我可以用来知道在这些场景中使用什么风格的(类似的)语言?
az storage account keys list
这是一个azure CLI命令,不是Azure powershell这将是powershell cmd Get AzStorageAccountKey,但我已经能够在安装了Azure CLI的windows计算机上的powershell中运行az命令?是的。但是azure功能环境与您的本地PC设置几乎没有关系好吧,我现在离题了,但这让我想起了过去,是否有某种形式的决策树或我可以用来知道在这些场景中使用(类似)语言的风格?