检查是否通过Powershell启用了Azure功能

时间:2018-10-19 17:29:36

标签: azure powershell azure-functions azure-powershell

From this question,我可以使用以下脚本获取所有已部署功能(已启用或未启用)的列表,但是有什么方法可以知道禁用了哪些功能?

$Params = @{
    ResourceGroupName = $ResourceGroupName
    ResourceType      = 'Microsoft.Web/sites/functions'
    ResourceName      = $AppName
    ApiVersion        = '2015-08-01'
}
Get-AzureRmResource @Params

enter image description here

1 个答案:

答案 0 :(得分:2)

在Azure Functions v2中,当存在名称为AzureWebJobs.{functionName}.Disabled和值为true(请参阅https://docs.microsoft.com/en-us/azure/azure-functions/disable-function#functions-2x---all-languages)的环境变量时,功能将被禁用。

您可以使用以下方法在Azure Powershell中获取功能应用程序的环境变量

(Get-AzureRmWebApp -ResourceGroupName {resourceGroupName} -Name {appName}).SiteConfig.AppSettings

然后进行相应的过滤。

相关问题