简体   繁体   English

在Azure Powershell函数中使用Azure CLI

[英]Using Azure CLI inside an Azure Powershell Function

I want to trigger a HTTP Azure Function to automate some Azure related tasks using the CLI. 我想触发HTTP Azure Function,以使用CLI自动执行一些与Azure相关的任务。

I assumed the Azure CLI would automatically be included with a Powershell function, though it appears that I'm wrong, since trying to invoke the 'az' command produces the typical... 我认为Azure CLI将自动包含在Powershell函数中,尽管看来我错了,因为尝试调用'az'命令会产生典型的...

ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program. 错误:术语“ az”未被识别为cmdlet,函数,脚本文件或可运行程序的名称。

Please explain to me how I'd use Azure CLI inside my Azure Powershell Function, thanks. 请向我解释如何在Azure Powershell函数中使用Azure CLI。


Edit: I was able to achieve what I wanted by using the Azure SDK in a C# Function, consider investigating this when wanting to do some automation in Azure, as I was thinking about this the wrong way and using the SDK makes much more sense than what I originally had in my head! 编辑:我能够通过在C#函数中使用Azure SDK来实现我想要的,在想要在Azure中进行一些自动化时考虑进行调查,因为我在想这是错误的方式,因此使用SDK比我原来脑子里有什么!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM