2

I've published my ASP.NET MVC web site to Azure App Service countless times. Today, though, when I tried to do so, I got a publish error. Thinking it might be related to a recent password change, I signed out of my Microsoft account and deleted my old publishing profile so I could start fresh.

However, now, when I use the Publish wizard to set up a new publish profile, it won't even show me my Azure resources. Here's what I'm doing:

  1. Sign out of Microsoft account in Visual Studio.
  2. Right-click web project > Publish...
  3. Click Add a publish profile
  4. Select Azure as the target
  5. Select Azure App Service (Windows) as the specific target
  6. The wizard asks me to sign in.
  7. Sign in.
  8. When the sign-in window goes away, the Publish window momentarily shows the UI for picking the target Azure App Service, but then it immediately switches back to the screen telling me to sign in.

Here are some images:

Prior to signing in...

Prior to signing in

For just a few moments after signing in...

For just a few moment after signing in

Immediately afterward...

Afterward

No matter what I do, I can't see my Azure resources. Is anyone else hitting this? Do I need to delete a folder somewhere to clear out some cruft? Thanks in advance?

Brian Rak
  • 4,912
  • 6
  • 34
  • 44
  • Try clearing your Visual Studio cache and delete the previous credentails and the restart it and then re-give credentials – RithwikBojja Mar 30 '23 at 06:00
  • 1
    To delete cache go to ```%localappdata%\Microsoft\VisualStudio``` and clear all which starts with 17 – RithwikBojja Mar 30 '23 at 06:20
  • 1
    Hello, @RithwikBojja. Thank you for the reply. Weirdly, when I got up this morning, the problem had gone away. I did notice a Windows Firewall dialog that I hadn't noticed last night, so perhaps some traffic was being blocked, but I didn't actually accept any changes, so that might be a red herring. Perhaps this was a temporary issue on the Azure side. At any rate, thank you again for the reply. I'll try deleting the cache as you suggest if it happens again! – Brian Rak Mar 30 '23 at 15:48
  • Hi @BrianRak , Can you please let me know how it was resolved on your side, what you have changed in your Azure account or something else because I am facing this issue form the last one day, and still not resolved, visual studio version - 17.5.5 and trying with the azure free subscription. – Atul May 06 '23 at 18:56
  • I can't see them either. Tried clearing cache, sign out-in azure accounts, even re-installed VS, nothing works. Same symptoms, the empty list flashes for a half-seconds and then goes away to the "Immediately Afterward.." screen above. Running VS 17.5.5 community edition – WirelessG May 11 '23 at 15:10
  • To get around it I had to go to the webapp, select Download Publish Profile, then build a new Publish Profile in VS using the downloaded file. – WirelessG May 11 '23 at 16:11

5 Answers5

1

This type of issue occurs when there are any pending updates for the Visual Studio.

Check for the update, update / use any latest version of Visual Studio.

  • Install the latest Visual Studio version by selecting Azure development.

enter image description here

  • Check whether the Azure Subscription is in Active state by login in Azure Portal.

  • In Visual Studio => Tools => Options => Azure Service Authentication => Account Selection, select the Azure account.

enter image description here

  • In VS,File => Account Settings, check the Account options.

enter image description here

  • Here Iam using VS 2022 17.5.0 version.
  • Now, try to publish he Application, select Azure App Service=> click on Create new or Create a new Instance.

enter image description here

Harshitha
  • 3,784
  • 2
  • 4
  • 9
  • 2
    Hello, @Harshitha. Thank you very much for your reply. I was actually running the most recent update -- in fact, this started happening right after updating to 17.5.3. Fortunately, though, when I got up this morning, the problem had gone away. Perhaps there was a temporary error on the Azure side. At any rate, thank you again. – Brian Rak Mar 30 '23 at 15:46
  • 1
    I still get this issue with VS2022 17.5.4 – Dan Nguyen Apr 17 '23 at 10:37
  • @DanNguyen - Please refer similar issue [here](https://stackoverflow.com/questions/75953145/visual-studio-2022-caches-old-tenant-id-cant-get-rid-of-it/75963839#75963839). – Harshitha Apr 17 '23 at 10:40
  • 1
    Tried everything here and in the post referenced above by @Harshitha and nothing has worked. This didn't happen until I upgraded to 17.5.3, and continues with 17.5.4. – Alarion Apr 19 '23 at 20:51
0

Just for reference I was having the exact same issue as above but it came down to my Azure Access Priveledges having being changed. Once the correct priveledges were restord to my Azure AD profile the visual studio plugin started to work again

0

Try to set "YES" to Access management for Azure resources in the Azure portal. Log in to the Azure portal > Azure Active Directory.

enter image description here

Now click on Properties and set Access management for Azure resources to Yes. I hope this will work. If this does not work then, click on Manage security defaults and set it to Disabled (Not recommended).

enter image description here

Now you can see the Azure resources.

enter image description here

0

I tried all of the above answers with no luck. The only thing that helped was the work-around to download the publishprofiles from the Azure app service and use them. Now however, with VS 17.6.4 it works again. It appears the whole "publish" flow is a bit different in the new version and this finally fixed it for me.

WirelessG
  • 227
  • 2
  • 11
0

Had a similar issue, no azure subscription was showing despite being logged into my account and having a valid subscription. What I found that resolved it for me was ensuring that under account options (Tools > Options > Environment > Accounts) I had "Authenticate across all Azure Active Directories when adding accounts" selected. This wasn't selected under my sign in options, once I selected this I was able to access my Azure subscription from within Visual Studio.

account sign in options

WiseyD
  • 26
  • 4