Get Azure Web App configuration App setting vaule using powershell

Sathish Kumar Karikalan 81 Reputation points
2023-06-20T10:35:32.25+00:00

I am looking for Powershell script to retrieve Particular Azure Web App Application settings value based on Key filter.

Thanks
Sathish

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
0 comments No comments
{count} votes

Accepted answer
  1. Luke Murray 11,436 Reputation points MVP Volunteer Moderator
    2023-06-21T01:09:04.6533333+00:00

    Hi, Sathish

    Try this:

    Replace the ResourceGroup and App Service and KeyFilter vaue variables to suit your environment.

    # Import the Azure PowerShell module
    Import-Module Az
    
    # Set the name of the Azure Resource Group and App Service
    $resourceGroupName = "rg-azure-search-openai-demo-dev"
    $appServiceName = "fggggghh"
    
    # Set the key filter for the application configuration setting
    $keyFilter = "800"
    
    # Get the application configuration settings for the App Service
    $app = Get-AzWebApp -ResourceGroupName $resourceGroupName -Name $appServiceName 
    $appSettings = $app.SiteConfig.AppSettings 
    # Find the setting with the specified key filter
    $setting = $appSettings | Where-Object { $_.Value -like $keyFilter }
    
    # Output the value of the setting
    Write-Output $setting.Value
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.