0
votes

I want to trigger a HTTP Azure Function to automate some Azure related tasks using the CLI.

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...

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

Please explain to me how I'd use Azure CLI inside my Azure Powershell Function, thanks.


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!

1
If you do not mind, you can upload Azure CLI into the Azure Function and you also can run the CLI command in the function. - Charles Xu
@CharlesXu thanks for the tip, I wasn't actually aware of this possibility, I'm still learning about Azure Functions. I was able to do what I wanted by using the Azure SDK in a C# Azure Function - so I'd also recommend checking out the SDK since it's pretty awesome actually, supports doing quite a lot of things programmatically, including sparking up ACI's which is what I wanted. - Dom

1 Answers

2
votes

It might be not supported right now as you can see in the following github issue : https://github.com/Azure/azure-functions-powershell-worker/issues/221.