Skip to content

Instantly share code, notes, and snippets.

View binduchinnasamy's full-sized avatar

Bindu Chinnasamy binduchinnasamy

  • Microsoft
  • Bangalore - India
View GitHub Profile
@binduchinnasamy
binduchinnasamy / FunctionEnableDisable.ps1
Last active January 14, 2021 07:57
Powershell run book to enable or disable azure function
$connectionName = "AzureRunAsConnection"
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
Add-AzureRmAccount -ServicePrincipal -TenantId $servicePrincipalConnection.TenantId -ApplicationId $servicePrincipalConnection.ApplicationId -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
$functionname="<<FunctionAppName>>"
$resourceGroupName ="<<Resource Group Name>>"
$webApp = Get-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $functionname
$appSettingList =$webApp.SiteConfig.AppSettings
$appSettings = @{}
ForEach ($kvp in $appSettingList) {
$appSettings[$kvp.Name] = $kvp.Value