Open TehWardy opened 4 years ago
Ok having created a new "copy of the project" by simply telling VS to create a new azure functions project and then importing the code from the original and changing nothing ... I found that the publish profiles have the following differences ...
The broken one has these extra elements
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<_IsPortable>true</_IsPortable>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<DeployIisAppPath>CLXDev-Workflow</DeployIisAppPath>
And for the elements that they both had I notice that there was a single key difference other than urls / key information username ect ...
<WebPublishMethod>ZipDeploy</WebPublishMethod>
<WebPublishMethod>MSDeploy</WebPublishMethod>
...
It seems that MSDeploy isn't working for Azure Functions I guess.
Can you share what your broken project file looks like?
Of course ... here it is ...
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://clxdev-workflow.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ResourceId>/subscriptions/{my sub id}/resourceGroups/Dev/providers/Microsoft.Web/sites/{ResourceName}</ResourceId>
<UserName>$CLXDev-Workflow</UserName>
<_SavePWD>True</_SavePWD>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>{ResourceName}.scm.azurewebsites.net:443</MSDeployServiceURL>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<DeployIisAppPath>{ResourceName}</DeployIisAppPath>
</PropertyGroup>
</Project>
This file was generated by an earlier version of the tooling for VS. I get the impression (due to a delay when I ask it to build the profile) it's trying to do the same thing even now, but for some reason that fails and so as a fallback it takes the zip route.
Is there some advantage to executing an Azure functions app directly out of a Zip package, surely that would slow execution times down having to unpack it?
Running from zip (or officially known as "run from package") has a lot of benefits and is the recommended way to deploy function apps. You can see here for more details: https://github.com/Azure/app-service-announcements/issues/84.
Do you see any more explicit errors in the Output window in VS? You may need to change the source from the dropdown to see if there's anything useful.
Nothing more than I've already given you. To be honest since having this i figured out I could just delete the existing publish profile and resource in the cloud then:
Not sure how to save the generated auth info though so I can check in to the azure devops repo and have pipelines use it later.
Feels overkill, but it solved the issue.
I think i'm seeing something like these ...
https://github.com/Azure/azure-functions-host/issues/4055 https://github.com/Azure/azure-functions-host/issues/4578
Everything builds and runs fine locally. Left a working deploy-able solution on Friday, came in this morning to fix something completely unrelated and it's unable to publish.
This is what my VS output window has to say about the matter ...
Things I've tried ...
I can confirm ...