在 Azure Powershell 函数中使用 Azure CLI

Using Azure CLI inside an Azure Powershell Function

我想触发一个 HTTP Azure 函数来使用 CLI 自动执行一些与 Azure 相关的任务。

我假设 Azure CLI 会自动包含在 Powershell 函数中,尽管看起来我错了,因为尝试调用 'az' 命令会产生典型的...

ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.

请向我解释如何在我的 Azure Powershell 函数中使用 Azure CLI,谢谢。


编辑:我能够通过在 C# 函数中使用 Azure SDK 来实现我想要的,当我想在 Azure 中进行一些自动化时考虑对此进行调查,因为我以错误的方式考虑这个问题并使用 SDK比我最初想到的更有意义!

它现在可能不受支持,您可以在以下 github 问题中看到:https://github.com/Azure/azure-functions-powershell-worker/issues/221.