0

I have an Azure App Service that I created in November of 2017. The App Service is called ManifestAPI.

I created a QA deployment slot for the app service, called ManifestAPI-QA and have been happily deploying my code updates for the API to the QA slot since then. I am deploying using the Kudu zipdeploy API from my Bamboo deployment server to the Azure QA deployment slot. No errors and and all of the endpoints are working fine.

Now, we are preparing to move the product to production and I am trying to deploy to the base App Service, ManifestAPI. So I created a deployment in Bamboo using the exact same release code as I am deploying to the QA slot and I deploy it to the ManifestAPI URL. However, when I try to run the API in the base app service, I get a 502.5 error.

I tried just doing a direct publish from within VisualStudio 2017 using the same code base and the publish profile from the base ManifestAPI App Service, thinking there was an issue with the Bamboo deployment. But I get the same 502.5 error.

Looking at the Kudu site in the LogFiles folder at the eventlog.xml file, I see the following;

<Event>
    <System>
        <Provider Name="IIS AspNetCore Module"/>
        <EventID>1000</EventID>
        <Level>1</Level>
        <Task>0</Task>
        <Keywords>Keywords</Keywords>
        <TimeCreated SystemTime="2018-06-25T23:03:57Z"/>
        <EventRecordID>1583337234</EventRecordID>
        <Channel>Application</Channel>
        <Computer>RD0003FF11B70E</Computer>
        <Security/>
    </System>
    <EventData>
        <Data>Application 'MACHINE/WEBROOT/APPHOST/ManifestAPI' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\ManifestAPI.dll', ErrorCode = '0x80004005 : 80008096.</Data>
    </EventData>
</Event>

Checking on the error on Google seemed to implicate an issue with the .Net Core DLLs installed on IIS itself.

Plus since the API is working fine in the QA deployment slot IIS instance I believe that means my code is good. So, I am thinking that there must be some issue with the IIS Instance and the .NET Core files that Microsoft is providing.

I compare the Extensions of the ManifestApi and the ManifestAPI-QA instances and they are the same on both instances.

ASP.NET Core 2.1 (x86) Runtime  2.1.0-preview2-final  No
ASP.NET Core Extensions  2.1.0-preview2-final  No

I tried doing a Swap from the working QA slot to the Production (base App Service ) slot and got the same 502.5 error.

I created a new deployment slot called ManifestAPI-Prod, by cloning the ManifestAPI-qa instance, deployed my deployment package to that slot and set the connection strings and application settings to match exactly what I had in the base app service Application Settings section. The ManifestAPI-Prod deployment slot worked just fine.

So I opened a support case with Microsoft in Azure and so far I have spent over 2 days going back and forth with the techs trying to figure this out. They keep saying that it has to be an issue in my code but that doesn't make any sense to me because the exact same deployment package works in the QA slot and now the Prod slot. One tech even said that I wasn't deploying correctly. However, I am using dotnet publish in VS2017 and then zipping up the resultant directory of files and pushing to Kudu via the zipdeploy API. This has been working great for the deployment slots do I can't understand how I am deploying it incorrectly.

At this point, I am at a loss as to how to deploy the API to the production (base) slot.

What am I missing here?

UPDATE 6/27/18 This was solved by uninstalling all of the extensions in the Azure production slot instance. Then reinstalling the Microsoft Core extensions. The Extensions blade still said ASP.NET Core Extensions 2.1.0-preview2-final but when I went to the Azure console for that instance and typed dotnet --info, it listed the following;

.NET Core SDK (reflecting any global.json):
 Version:   2.1.301
 Commit:    59524873d6

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x86
 Base Path:   D:\Program Files (x86)\dotnet\sdk\2.1.301\

Host (useful for support):
  Version: 2.1.1
  Commit:  6985b9f684

.NET Core SDKs installed:
  1.1.8 [D:\Program Files (x86)\dotnet\sdk]
  2.1.101 [D:\Program Files (x86)\dotnet\sdk]
  2.1.300 [D:\Program Files (x86)\dotnet\sdk]
  2.1.301 [D:\Program Files (x86)\dotnet\sdk]

Of note is that the listing for 2.1.0-preview2-final was no longer in the list of files displayed by dotnet --info

whiskytangofoxtrot
  • 927
  • 1
  • 13
  • 41

1 Answers1

1

I don't know why your app is failing, but I do see one red flag: you seem to be using 2.1.0-preview2-final. Now that 2.1 is GA, you should update your project to use it.

In addition, note that the preview build required a Site Extension to be installed, while the final bits do not. So you will want to uninstall the preview Site Extension (you can do this from Azure Portal).

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Thanks David. My project was updated to 2.1. The issue was the extensions in the IIS Production instance in Azure. I removed all extensions and then added the Microsoft Core Extensions back. Doing a dotnet --info from the Azure console showed that it was now the correct version, even though in the Azure Extensions page, it still said 2.1.0-preview2-final – whiskytangofoxtrot Jun 27 '18 at 15:44
  • Strange, it shouldn't say anything about preview2 in the Extensions page if you uninstalled the extension. Maybe Portal just needs a refresh? – David Ebbo Jun 27 '18 at 15:45
  • Refreshed several times. It still says the version is 2.1.0-preview2-final on the extensions page. – whiskytangofoxtrot Jun 27 '18 at 15:51
  • And if you click it, are you able to uninstall it? Also, try going to Kudu Console and look under `D:\home\SiteExtensions`. There shouldn't be a folder at all for that extension if it's uninstalled. – David Ebbo Jun 27 '18 at 15:53
  • Yes, I can uninstall it. And yes, it is no longer in the D:\Home\SiteExtensions folder when I uninstall it. And when I install it again, it shows up in the D:\Home\SiteExtensions folder as the "Microsoft.AspNetCore.AzureAppServices.SiteExtension " folder an inside that folder, it has " Microsoft.AspNetCore.AzureAppServices.SiteExtension.2.1.0-preview2-final.nupkg". However, my production site is now working. – whiskytangofoxtrot Jun 28 '18 at 14:03
  • But why are you installing it again? As I state in my Answer, the final 2.1.0 bits do not need this site extension. – David Ebbo Jun 28 '18 at 14:14