Here the complete host.json
, recarding to the Microsoft Docs:
Don't forget to restart the Function to reload the Configuration!
{
"version":"2.0",
"managedDependency":{
"Enabled":true
},
"extensionBundle":{
"id":"Microsoft.Azure.Functions.ExtensionBundle",
"version":"[2.*, 3.0.0)"
},
"functionTimeout": "00:05:00"
}
Another trick is, only to define the required Az-Modules in requirements.psd1
and not all of them:
Bad:
# This file enables modules to be automatically managed by the Functions service.
# See https://aka.ms/functionsmanageddependency for additional information.
#
@{
# For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'.
# To use the Az module in your function app, please uncomment the line below.
'Az' = '6.*'
}
Good:
# This file enables modules to be automatically managed by the Functions service.
# See https://aka.ms/functionsmanageddependency for additional information.
#
@{
# For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'.
# To use the Az module in your function app, please uncomment the line below.
# 'Az' = '6.*'
'Az.Accounts' = '2.*'
'Az.Resources' = '4.*'
'Az.Monitor' = '2.*'
}