Publishing function app fails with 401 Unauthorized error
0xced opened this issue · 5 comments
I have two almost identical function apps configured on the same Azure subscription. The only difference is that the first one (myapp-fr) is deployed in France Central and the second one (myapp-ch) is deployed in Switzerland North. I can browser them, see their properties, start/stop them from the Azure Explorer in Rider just fine. I'm using Rider 2024.1.2 (#RD-241.15989.179) with the Azure Toolkit for Rider plugin 3.50.0.1773-2024.1.
✅ Publishing my project to myapp-fr
works fine:
Got existing Function App with Id: '/subscriptions/redacted-fake-4ce9-a703-b69e492b1a5e/resourceGroups/myapp-fr/providers/Microsoft.Web/sites/myapp-fr'
Verifying runtime is 'DOTNET-ISOLATED' (version '~4')
Collecting 'MyApp' project artifacts...
Using configuration: 'Release' and platform: 'Any CPU'
Creating 'MyApp' project ZIP...
Project ZIP is created: '/private/var/folders/xx/randomletters6and9numbers/T/rider-publish2014820478743084279.zip'
Stop Function App 'myapp-fr'...
Publishing ZIP file. Attempt 1 of 3...
Published ZIP file successfully
Deleting ZIP file '/private/var/folders/xx/randoml3tters6and9numbers/T/rider-publish2014820478743084279.zip'...
Deploy succeeded.
Start Function App 'myapp-fr'...
URL: https://myapp-fr.azurewebsites.net
Done.
❌ Publishing the same project to myapp-ch
fails with a vague authorization error:
Got existing Function App with Id: '/subscriptions/redacted-fake-4ce9-a703-b69e492b1a5e/resourceGroups/myapp-ch/providers/Microsoft.Web/sites/myapp-ch'
Verifying runtime is 'DOTNET-ISOLATED' (version '~4')
Collecting 'MyApp' project artifacts...
Using configuration: 'Release' and platform: 'Any CPU'
Creating 'MyApp' project ZIP...
Project ZIP is created: '/private/var/folders/xx/randoml3tters6and9numbers/T/rider-publish5196542433690921481.zip'
Stop Function App 'myapp-ch'...
Publishing ZIP file. Attempt 1 of 3...
Publishing ZIP file. Attempt 2 of 3...
Publishing ZIP file. Attempt 3 of 3...
Fail publishing ZIP file. Response code: 401. Response message: Unauthorized.
Fail publishing ZIP file: java.lang.RuntimeException: Fail publishing ZIP file. Response code: 401. Response message: Unauthorized.
Fail publishing ZIP file
Is there anything I can do to diagnose this authorization issue?
Hi! You could try to deploy manually via az functionapp deploy
to see if this problem is specific to Rider. You can check the IDE log file, the error will probably be logged. Also, you could try the preview version of the plugin #777 - we reworked the deployment in it, maybe that will help.
I tried the 4.0 preview of the plugin and got almost the same issue. When I created the publish configuration for myapp-ch
there was an error on the configuration hinting that publishing would not work: "App Service plan name is not provided". (The publish configuration of myapp-fr
had no errors.) After refreshing the function menu of the publish configuration and changing the function a few times then back to myapp-ch
the error vanished and I was finally able to successfully publish my function app from Rider.
So, it is working now? Without detailed logs, it's hard to say what happened
Yes it's working now.
I looked at the logs while playing with my publish configurations but saw nothing special.
You can close this issue but I still think there's a bug in the configuration editor. For what it's worth, I initially duplicated myapp-fr
publish configuration to create myapp-ch
publish configuration. Maybe there's something to look for in there.
I'll check duplication, thank you