Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renewal fails when App Service Plan and App Service reside in different resource groups #18

Open
ohadschn opened this issue Feb 15, 2020 · 0 comments

Comments

@ohadschn
Copy link

I believe the issue is here:

await appServiceManager.Inner.WebApps.CreateOrUpdateHostNameBindingAsync(setting.ServicePlanResourceGroupName ?? setting.ResourceGroupName, setting.WebAppName, hostName, binding);

While the certificate should indeed be created in the App Service Plan resource group (found that out the hard way), the binding should use the App Service's resource group (so setting.ServicePlanResourceGroupName should be ignored in this line even if specified).

The error looks like this:

Microsoft.Rest.Azure.CloudException: Can not perform requested operation on nested resource. Parent resource 'my-web-app' not found.
   at Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.<CreateOrUpdateHostNameBindingWithHttpMessagesAsync>d__73.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\9677551D-8B46-49FC-A1DE-7E37AB07CFED\69\7309f51a\WebAppsOperations.cs:line 10192
--- 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.Azure.Management.AppService.Fluent.WebAppsOperationsExtensions.<CreateOrUpdateHostNameBindingAsync>d__68.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\9677551D-8B46-49FC-A1DE-7E37AB07CFED\fb\a552699e\WebAppsOperationsExtensions.cs:line 863
--- 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`1.GetResult()
   at LetsEncrypt.Azure.Core.V2.AzureWebAppService.<Install>d__3.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\637CC4BA-08DF-45DA-95C2-3C2D92591C70\b2\7f905cf5\AzureWebAppService.cs:line 98
--- 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.GetResult()
   at LetsEncrypt.Azure.Core.V2.LetsencryptService.<Run>d__6.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\637CC4BA-08DF-45DA-95C2-3C2D92591C70\a7\575516a2\LetsencryptService.cs:line 73
--- 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.GetResult()
   at OhadSoft.AzureLetsEncrypt.Renewal.Management.RenewalManager.<RenewCore>d__7.MoveNext() in G:\GitHub\letsencrypt-webapp-renewer\src\OhadSoft.AzureLetsEncrypt.Renewal\Management\RenewalManager.cs:line 60
--- 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.GetResult()
   at OhadSoft.AzureLetsEncrypt.Renewal.WebJob.Cli.CliRenewer.Renew(String[] args) in G:\GitHub\letsencrypt-webapp-renewer\src\OhadSoft.AzureLetsEncrypt.Renewal.WebJob\Cli\CliRenewer.cs:line 21
   at OhadSoft.AzureLetsEncrypt.Renewal.WebJob.Program.CliMain(String[] args) in G:\GitHub\letsencrypt-webapp-renewer\src\OhadSoft.AzureLetsEncrypt.Renewal.WebJob\Program.cs:line 88 (False)
AzureLetsEncryptRenewer.exe Error: 0 : Unexpected exception: Microsoft.Rest.Azure.CloudException: Can not perform requested operation on nested resource. Parent resource 'new-app-cert-renew-test' not found.
   at Microsoft.Azure.Management.AppService.Fluent.WebAppsOperations.<CreateOrUpdateHostNameBindingWithHttpMessagesAsync>d__73.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\9677551D-8B46-49FC-A1DE-7E37AB07CFED\69\7309f51a\WebAppsOperations.cs:line 10192
--- 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.Azure.Management.AppService.Fluent.WebAppsOperationsExtensions.<CreateOrUpdateHostNameBindingAsync>d__68.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\9677551D-8B46-49FC-A1DE-7E37AB07CFED\fb\a552699e\WebAppsOperationsExtensions.cs:line 863
--- 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`1.GetResult()
   at LetsEncrypt.Azure.Core.V2.AzureWebAppService.<Install>d__3.MoveNext() in C:\Users\ohad1\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\637CC4BA-08DF-45DA-95C2-3C2D92591C70\b2\7f905cf5\AzureWebAppService.cs:line 98
--- End of stack trace from previous location where exception was thrown ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant