I'm trying to deploy the contents of a dotnet project after running dotnet publish
, but the newer versions of azure-cli
complain with the following error message:
$ az webapp up --name MyAppService
Could not auto-detect the runtime stack of your app, see 'https://go.microsoft.com/fwlink/?linkid=2109470' for more information
Following the link, https://go.microsoft.com/fwlink/?linkid=2109470, I can see that it's looking for a *.csproj file, but that doesn't make sense to me, since I'm deploying files from my publish directory. From what I can see, if I run it from the directory that contains a *.csproj file it works, but tries to zip and upload all the source code and not just the published files.
It originally worked in azure-cli
v2.0.66. Recently I downgraded to v2.0.75 (as indicated here https://stackoverflow.com/a/59529584) and it works also, but I would like to keep azure-cli
up to date. I've also seen that the azure-cli
has added an --html
flag to deploy static files, but my situation is a bit different.
So the question is: How do I get az webapp up
to work from the dotnet publish
directory in versions of azure-cli
>v2.0.75?
I think that there is some related bug.
I had a similar issue. Following this tutorial the final step was apply the az webapp up
command but the deployed site only had a message saying "You do not have permission to view this directory or page". That means that no site was detected on the deployed site folder.
I applied the dotnet publish
command and tried to run az webapp run
from the published folder but the result was the same as you: "Could not auto-detect the runtime stack of your app, see 'https://go.microsoft.com/fwlink/?linkid=2109470' for more information."
Finally, from the root project folder I ran dotnet publish -o .
and then az webapp up
and got the deployment working as expected. This sounds really crazy because I finally got merged the published files with the source code.
This is my first attemp to use az webapp up
, I hope that this issue to be solved soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With