hi, this part of the code returns an error message "Operation returned an invalid status code 'NotFound'". I have created a certificate and host name properly.
webApp = await webApp
.Update()
.DefineSslBinding()
.ForHostname(hostname)
.WithExistingCertificate(certificateThumbPrint)
.WithSniBasedSsl()
.Attach()
.ApplyAsync();
Error updating binding for 'test4.rhplus.cloud' with certificate 'BF7DA709EBA510CD325AA9652FC76F0C510C3561'Microsoft.Azure.Management.AppService.Fluent.Models.DefaultErrorResponseException : Operation returned an invalid status code 'NotFound'at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.BeginCreateOrUpdateWithHttpMessagesAsync(String resourceGroupName,String name,SiteInner siteEnvelope,Dictionary2 customHeaders,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName,String name,SiteInner siteEnvelope,Dictionary
2 customHeaders,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperationsExtensions.CreateOrUpdateAsync(IWebAppsOperations operations,String resourceGroupName,String name,SiteInner siteEnvelope,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.AppServiceBaseImpl6.CreateOrUpdateInnerAsync[FluentT,FluentImplT,FluentWithCreateT,DefAfterRegionT,DefAfterGroupT,UpdateT](SiteInner site,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppBaseImpl
5.CreateResourceInternalAsync[FluentT,FluentImplT,DefAfterRegionT,DefAfterGroupT,UpdateT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppBaseImpl5.CreateResourceAsync[FluentT,FluentImplT,DefAfterRegionT,DefAfterGroupT,UpdateT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable
4.-CreateResourceAsyncIFluentResourceT,InnerResourceT,FluentResourceT,IResourceTat System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem1.ExecuteAsync[IResourceT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase
1.ExecuteNodeTaskAsync[TaskResultT](DAGNode1 node,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.CreatableUpdatable
5.ApplyAsync[IFluentResourceT,InnerResourceT,FluentResourceT,IResourceT,IUpdatableT](CancellationToken cancellationToken,Boolean multiThreaded)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async WebAppSSLManager.AzureHelper.AddCertificateAsync() at C:\home\site\repository\src\WebAppSSLManager\AzureHelper.cs : 237
2021-06-07T13:52:02.847 [Error] Unable to complete the processing for test4.rhplus.cloudMicrosoft.Azure.Management.AppService.Fluent.Models.DefaultErrorResponseException : Operation returned an invalid status code 'NotFound'at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.BeginCreateOrUpdateWithHttpMessagesAsync(String resourceGroupName,String name,SiteInner siteEnvelope,Dictionary2 customHeaders,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName,String name,SiteInner siteEnvelope,Dictionary
2 customHeaders,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppsOperationsExtensions.CreateOrUpdateAsync(IWebAppsOperations operations,String resourceGroupName,String name,SiteInner siteEnvelope,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.AppServiceBaseImpl6.CreateOrUpdateInnerAsync[FluentT,FluentImplT,FluentWithCreateT,DefAfterRegionT,DefAfterGroupT,UpdateT](SiteInner site,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppBaseImpl
5.CreateResourceInternalAsync[FluentT,FluentImplT,DefAfterRegionT,DefAfterGroupT,UpdateT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.AppService.Fluent.WebAppBaseImpl5.CreateResourceAsync[FluentT,FluentImplT,DefAfterRegionT,DefAfterGroupT,UpdateT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable
4.-CreateResourceAsyncIFluentResourceT,InnerResourceT,FluentResourceT,IResourceTat System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem1.ExecuteAsync[IResourceT](CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase
1.ExecuteNodeTaskAsync[TaskResultT](DAGNode1 node,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.CreatableUpdatable
5.ApplyAsync[IFluentResourceT,InnerResourceT,FluentResourceT,IResourceT,IUpdatableT](CancellationToken cancellationToken,Boolean multiThreaded)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async WebAppSSLManager.AzureHelper.AddCertificateAsync() at C:\home\site\repository\src\WebAppSSLManager\AzureHelper.cs : 237at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async WebAppSSLManager.WebAppSSLManager.Run(TimerInfo myTimer,IAsyncCollector`1 messageCollector,ILogger logger) at C:\home\site\repository\src\WebAppSSLManager\WebAppSSLManager.cs : 56