I was able to do this after some research. I'm not sure if all of these steps are required, but this is what I did, and it works for me now.
First, I followed the instructions on the accepted answer to this Stack Overflow question: https://stackoverflow.com/questions/77629955/azure-static-web-apps-visual-studio-2022 - so I added the staticwebapp.config.json
as instructed. Then I ran swa init
and modified the resulting swa-cli.config.json
to include the correct output location for my existing VS publish profile.
Then I followed the instructions on this GitHub issue https://github.com/Azure/static-web-apps-cli/issues/885 - so I installed the Azure command line interface, and then attempted to login with az login
. This failed for some reason, and I had to run it again against my particular tenant id using the --tenant
flag. Lastly, I ran swa login
.
Once I did this, I was able to successfully publish from within Visual Studio.
