Azure App Service - Web API Management: Dependency Configuration Fails

ManuBera 21 Reputation points
2022-11-25T08:15:10.467+00:00

Hey everybody,

my Web Api used to work fine and I was able to use my endpoints but something changed and they didn't update when I published my Web Api. I removed the Api Management service and added a new one. Now I'm trying to connect my Visual Studio project with this new ApiM service, but when I try to do this, it fails with the following message:

Configuring Azure API Management dependency apis1 in the project...  
Configuring msbuild files...  
Adding properties to [my Api path]\Properties\PublishProfiles\[my Api Project name] - Web Deploy.pubxml...  
Adding msbuild property 'ApiResourceId'...  
Adding msbuild property 'OpenApiDocumentName'...  
Adding msbuild property 'UpdateApiOnPublish'...  
ErrorSystem.NotImplementedException: The method or operation is not implemented.  
   at EnvDTE.SourceControl.CheckOutItem(String ItemName)  
   at Microsoft.WebTools.Shared.VS.VisualStudio.Wrappers.VsSourceControlWrapper.<CheckoutFilesAsync>d__4.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Microsoft.WebTools.Shared.VS.Msbuild.MsbuildProjectManager.<SetPropertiesAsync>d__8.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)  
   at Microsoft.WebTools.Shared.FeatureDetection.Msbuild.MsbuildDetectionEngine.<GenerateCoreAsync>d__4.MoveNext()  
ErrorFailed to configure Profile properties.  
ErrorFailed to configure dependency Azure API Management apis1.  

Could anyone help me with this? Or tell my another way to update my Web API on Azure? Usually I didn't have to do anything, my endpoints just updated fine and I was able to use them after publishing my Web Api.

When debugging locally, I get the swagger index.html with all my endpoints and there doesn't seem to be a problem. I'm using Asp Core 3.1 and Swashbuckle.AspNetCore 6.4.0 (and tried 5.6.3, 5.6.2 and 5.6.1).

Any help would be highly appreciated :)

Thanks!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ManuBera 21 Reputation points
    2022-11-25T14:14:33.397+00:00

    The problem in Visual Studio has not been resolved, but my real problem was my Web API not updating and I found the cause. To keep my Startup more tidy I arranged the code in ConfigureServices into methods and I had one for my swagger configuration. Little did I know that the AddSwaggerGen method needs to be inside the ConfigureServices method block (for Reflection maybe?). Now my API is updating again. The end.

    0 comments No comments