Azure / azure-functions-powershell-library

MIT License
2 stars 3 forks source link

Bug Bash: Unable to find `profile.ps1` in the function app root folder #38

Open michaelpeng36 opened 2 years ago

michaelpeng36 commented 2 years ago

When running func start --verbose with the new programming model and invoking a basic HTTP Trigger, the following system log appears:

System Log: { Invocation-Id: e5ebe247-8c57-46ff-bb8c-2f9cdda6bb19; Log-Level: Trace; Log-Message: No 'profile.ps1' is found at the function app root folder: <functionAppRootFolder>

Checking the files of the function app, it seems profile.ps1 is actually present. Here are the contents:

# Azure Functions profile.ps1
#
# This profile.ps1 will get executed every "cold start" of your Function App.
# "cold start" occurs when:
#
# * A Function App starts up for the very first time
# * A Function App starts up after being de-allocated due to inactivity
#
# You can define helper functions, run commands, or specify environment variables
# NOTE: any variables defined that are not environment variables will get reset after the first execution

# Authenticate with Azure PowerShell using MSI.
# Remove this if you are not planning on using MSI or Azure PowerShell.
if ($env:MSI_SECRET) {
    Disable-AzContextAutosave -Scope Process | Out-Null
    Connect-AzAccount -Identity
}

# Uncomment the next line to enable legacy AzureRm alias in Azure PowerShell.
# Enable-AzureRmAlias

# You can also define functions or aliases that can be referenced in any of your PowerShell functions.