There is a CLI method to list functions of an Azure FunctionApp (docs)
az functionapp function list -g MyResourceGroup -n MyFunctionAppName
How do I get functions deployed on a specific deployment slot?
For reference, another method – functionapp function keys list
has a parameter (-s
) for specifying the slot (docs).
2
Answers
ChatGPT helped me out. The method
az rest
can be used to retrieve the list of functions deployed on a specific deployment slot.Works like a charm. The only caveat is that when requesting production slot, you need to omit
slots/$DEPLOYMENT_SLOT/
from the request.By default
az functionapp list
command does not contain--slot
parameter to filter the function apps by slots.Refer this MS document:-
az functionapp | Microsoft Learn
I added one Function app in staging slot and ran the below alternatives to fetch the same deployment slots for specific function app via default hostname.
As an alternative you can try the below command.
Code:-
Output- Hostname is allocated to staging slot like below:-
To get the specific function app with its slot.
You can also use the command below:-
Code:-
Output- Hostname is allocated to staging slot like below:-
I tried running
az functionapp function list
and did not receive any slot property also the command does not contain--slot
parameter as Deployment slots are added at the Function app level that is app service plan level to manage the application deployment and not its dependent functions like the HTTP or queued triggers at functions level.Refer here :-
az functionapp function | Microsoft Learn
Code:-
Output:-
Even
az functionapp function show
does not contain--slot
parameter or slot property in the output.Code:-
Output:-
References:-
az functionapp deployment slot | Microsoft Learn
az functionapp function | Microsoft Learn
az functionapp function | Microsoft Learn