microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

[BUG]: AzureFunctionApp Resource file has already set to module.json #18577

Open gabrielweyerjb opened 1 year ago

gabrielweyerjb commented 1 year ago

Task name

AzureFunctionApp

Task version

2.223.1

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Microsoft Windows Server 2019

Task log

2023-07-03T22:34:33.4573017Z ##[section]Starting: Deploy Order Processor Function App
2023-07-03T22:34:33.4676737Z ==============================================================================
2023-07-03T22:34:33.4676910Z Task         : Azure Functions Deploy
2023-07-03T22:34:33.4676998Z Description  : Update a function app with .NET, Python, JavaScript, PowerShell, Java based web applications
2023-07-03T22:34:33.4677165Z Version      : 2.223.1
2023-07-03T22:34:33.4677236Z Author       : Microsoft Corporation
2023-07-03T22:34:33.4677341Z Help         : https://aka.ms/azurefunctiontroubleshooting
2023-07-03T22:34:33.4677444Z ==============================================================================
2023-07-03T22:34:34.8219912Z ##[warning]Resource file has already set to: D:\a\_tasks\AzureFunctionApp_501dd25d-1785-43e4-b4e5-a5c78ccc0573\2.223.1\node_modules\azure-pipelines-tasks-azure-arm-rest-v2\module.json
2023-07-03T22:34:34.8265526Z Got service connection details for Azure App Service:'[redacted]'
2023-07-03T22:34:38.3311291Z NOTE: Function app is VNet integrated.
2023-07-03T22:35:06.1941434Z Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
2023-07-03T22:35:06.1941937Z Deleting App Service Application settings. Data: ["WEBSITE_RUN_FROM_ZIP"]
2023-07-03T22:35:06.1942776Z App Service Application settings are already present.
2023-07-03T22:35:12.8298785Z Validating deployment package for functions app before Zip Deploy
2023-07-03T22:35:13.7968253Z Package deployment using ZIP Deploy initiated.
2023-07-03T22:35:24.2420681Z Deploy logs can be viewed at https://[redacted].scm.azurewebsites.net/api/deployments/6e6645c6261e494796fe5fdbae6975e7/log
2023-07-03T22:35:24.2421459Z The web package has been deployed to App Service. Please note that the package mount or extraction errors will be logged in the deployment logs in the location above.
2023-07-03T22:35:24.2422079Z NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory.
2023-07-03T22:35:25.2748617Z App Service Application URL: https://[redacted].azurewebsites.net
2023-07-03T22:35:25.2873430Z ##[section]Finishing: Deploy Order Processor Function App

Relevant log output

2023-07-03T22:34:34.8219912Z ##[warning]Resource file has already set to: D:\a\_tasks\AzureFunctionApp_501dd25d-1785-43e4-b4e5-a5c78ccc0573\2.223.1\node_modules\azure-pipelines-tasks-azure-arm-rest-v2\module.json

Aditional info

Another deployment on the 26th of June didn't have this warning.

The version used was: 2.221.105
FinVamp1 commented 1 year ago

@manolerazvan can you help with someone to look into this?

lwnexgen commented 1 year ago

Also seeing this. Not sure what issues it is causing but a deploy last week did not show the warning.

FinVamp1 commented 1 year ago

Hello,

I'll follow up more on this tomorrow. The Task Lib supports adding resource paths via https://github.com/microsoft/azure-pipelines-task-lib/blob/ab676de8207ae472532e84765d3c9c5e290cb85b/node/internal.ts#L147

This takes a path and an optional parameter to ignore warnings. If this is true then this is this is logged as a Debug statement otherwise it is logged as a warning. The default is false.

The Azure Function App Task always has called this function with just the path name and not the optional parameter.

tl.setResourcePath(path.join( dirname, 'task.json')); tl.setResourcePath(path.join( dirname, 'node_modules/azure-pipelines-tasks-azure-arm-rest-v2/module.json'));

Will discuss with the library team to check what's happening here.

v-mohithgc commented 1 year ago

This issue has been addressed in this PR https://github.com/microsoft/azure-pipelines-tasks/pull/18592

FinVamp1 commented 1 year ago

This should be resolved in 2.225. Closing this issue

gabrielweyerjb commented 1 year ago

Confirmed as fixed in 2.225.1 which has started rolling out.

KaiBNET commented 1 month ago

Seems like this problem pops up again with agent version 243.1. :-(

FinVamp1 commented 1 month ago

Thanks, let me check into this.

spooky commented 1 month ago

I have the same on 2.245.1

KaiBNET commented 1 month ago

I think this is related to https://github.com/microsoft/azure-pipelines-tasks/issues/20408