Skip to content

Instantly share code, notes, and snippets.

@eralston
Last active January 21, 2023 16:41
Show Gist options
  • Save eralston/b43047db736111e8f61a9d50304442c2 to your computer and use it in GitHub Desktop.
Save eralston/b43047db736111e8f61a9d50304442c2 to your computer and use it in GitHub Desktop.
Powershell snippets for converting an Azure Function to version 4. Very necessary given the deprecation of version 2.
# Add new settings or configuration changes to Azure Function (Can be done ahead of time):
AzureTranscriptionSettings:Key
AzureTranscriptionSettings:Region = westus
# PowerShell Setup (Can be done ahead of time)
Uninstall-AzureRm
Install-Module -Name Az.Functions -AllowClobber
Install-Module Az.Websites
# Commands to change version
Import-Module Az.Websites
Login-AzAccount
Set-AzContext -Subscription "Prod"
Update-AzFunctionAppSetting -AppSetting @{"FUNCTIONS_EXTENSION_VERSION" = "~4"} -Name sb-usw-prv-fnc -ResourceGroupName sb-usw-prv -Force
Set-AzWebApp -NetFrameworkVersion v6.0 -Name sb-usw-prv-fnc -ResourceGroupName sb-usw-prv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment