Active Directory account keeps getting locked - visual-studio

We use Visual Studio for development and Team Foundation Server for source control.
I save my Active Directory account credentials in publish profiles of my web application projects.
Could this be the reason why my AD account keeps getting locked? For instance maybe VS or TFS are trying to communicate using saved credentials? Has anyone faced this issue?
EDIT 1:
We use ADFS for SSO. All TFS as well as publish profile authentication goes through ADFS. ADFS logs show something tries my account with bad password 10 times in 5 minutes or once every 30 seconds. Does that sound about right for Team Explorer within Visual Studio? Does that sound right for publish profile within Visual Studio? Only VS team can tell I guess?

Related

AAD-Authentication not working since Visual Studio 2017 update to version 15.7.4

I have Visual Studio 2017 Enterprise 15.7.4 installed on Windows 10. The OS is connected to my AAD Work/School account. My problem occurs on 5 different machines and started to appear today.
When I start VS I'm logged in (top right) and every thing is fine. The list of subscriptions is shown in Cloud Explorer too.
I now open a ASP.NET Core web project and want to publish it to an existing Web App in Azure. As soon as I'm in the screen where I can define the target subscription, VS starts to re-authenticate eventually showing the popup-dialog querying for my credentials. This dialog sometime appears several times in a row.
I can authenticate without any error shown and now everywhere in VS (Account settings, Cloud Explorer, Server Explorer, Publish Dialog) appears the "Reenter your credentials" link and all subscriptions are inaccessible now.
From this moment on there is now way to authenticate against AAD inside of VS without getting the "Reenter-thing" anymore.
What I already tried:
Went to account settings and removed all existing accounts from VS -> restarted VS and performed signup again.
Closed all VS instances -> deleted the file system folder %LOCALAPPDATA%\.IdentityService -> started VS and signed in again
Right click on Azure Node in Server Explorer and selected "Connect to Microsoft Azure Subscription..."
Nothing of the above works. I was able to use this stuff just 2 days ago. That's why I suspect the update.
I then tried to post a question on Visual Studio Community Site. This asks me to use the "Report a problem"-feature in VS. Guess what? The sign-in is broken there too so I cannot even get my problem to MS.
Any further suggestions are highly welcome.
Have you tried out to use a none Windows User - create a blank User on your Subscription and deploy with this user...
Maybe a problem with windows integrated User?
Best
Niels
Today it was just announced that there is a new feature in preview in AzureAD - maybe that’s the reason?
See
https://cloudblogs.microsoft.com/enterprisemobility/2018/06/19/azure-ad-password-protection-and-smart-lockout-are-now-in-public-preview/
Update
Maybe just refresh the User Tokens...
Use this PS lines…
$cred = Get-Credential
Connect-AzureAD -Credential $cred
$user = Get-AzureADUser | Where-Object {$_.UserPrincipalName -eq "your_aad_login_name"}
Revoke-AzureADUserAllRefreshToken -ObjectId $user.ObjectId

Visual Studio - Publish Web App to Azure "Reenter your credentials" does not work

I can't publish an asp.net app to Azure Web App in Visual Studio 2015. It asks me to reenter my credentials, which I do, and then get the same "renter your credentials" screen.
I have two Azure accounts, one is my synced Azure AD identity (account#company.com), and the other as a cloud-only identity (account#company.onmicrosoft.com). When trying to log in with either of these accounts, Visual Studio still says "Reenter your credentials" and does not show any subscriptions or resource groups.
Looking at a Fiddler, I can see Azure return a list of all of my subscriptions, yet Visual Studio does not populate and thinks my credentials are invalid (Fiddler screenshot below)
I had the same problem
In the Acount settings of your visual studio top right..
Delete all acounts an then sign in with the proper azure account.
Then when you go to publish you can add the account
I have experienced exactly what you describe here, however when I ensured that I was connected to Visual Studio using the same account as I wished to publish with, the "reenter credentials" message disappeared.
Go to Options > Accounts,
On the "Add and reauthenticate accounts using:" field select Device code .
Login in the browser with the provided code and then you are able to publish without re-entering credentials.
I had this issue with visual studio 2019, my Microsoft account was linked with my gitHub account. I unlinked my github account by logging into my windows account going into security and unlinking the account
Same issue here with VS 2019 and 2022 (preview), but the account settings in Visual Studio only showed my 'Home Organization'. Deleting and re-adding didn't help.
Finally, I fixed it by removing an external organization that I was a member of from my account.
Go to https://myaccount.microsoft.com and login. On the left panel, select Organizations and delete all, except your Home Organization.
Of course, if you actually need the external organization(s), this isn't going to help you.

Visual Studio can't switch accounts when connecting to Team Foundation Server

I have different accounts with different VSO subscriptions. I'm trying to connect to a different account (from the one I'm logged in VS-2015) so that I can check in code in the repository that I have in that account. But when trying this, Visual Studio brings me to the profile website, from which is basically a dead end - what am I supposed to do from there?
The "Connect to Team Foundation Server screen sometimes just freezes after authentication, and doesn't go anywhere from there.
So clearing the settings file, which is named CurrentSettings usually in the folder C:\Users\your user name \Documents\Visual Studio 2015\Settings (Windows) - helped get passed this issue.
Also, when you are brought to the VSO Profile page (the one I showed in my picture question) you have to select the project you are trying to open.

This account has no subscription - Publishing to Azure from Visual Studio

Earlier this year I successfully deployed a MVC app to Azure from Visual Studio.
Now I'm trying to do the same thing again, but now I am told my azure account "has no subscription".
However I am 100% positive I do have a subscription associated with my email. My old MVC app still runs and I can see my Pay-as-you-go is properly charged.
What I Have tried to fix it
Emptied my browser caches, history, cookies etc.
Removed my account from Visual Studio, restarted, and added them again.
Formatted my computer and reinstalled everything (not really because of this problem, but the timing was perfect).
Updated the Azure SDK to the newest 2.9.5.
I did the following things above based on advice from these pages:
Visual Studio not finding my Azure subscriptions
Unable to publish to Azure with VS2015
No subscription found in windows azure account
But alas, no luck.
The only thing that comes to thought is I tried to add an Azure Pass to my account, but without luck. But I can't see how that should change anything...
So my question is: How do I make Visual Studio recognize my current Pay-as-you-go subscription, so I can publish my services, apps, etc. from Visual Studio directly?
Or at least: What has gone wrong? Whom can I contact to get help with this?
As always, thank you for your time and patience, and please write a comment if you need further information.
You may try to connect first via the server explorer (ctrl+alt+s). (The server explorer has an azure root node, if the azure sdk installed)
If you have connected, the publish wizard won't ask (usually) for sign in again.
In my case, the solution was as follows:
Open Server Explorer in Visual Studio, right-click on Azure and select "Manage and filter subscriptions":
Screenshot of Manage Subscriptions Dialog
Click the Certificates tab, click Import, then click Download subscription file. This will take you to the azure portal page where you can download a .publishsettings file for your subscription. After downloading that file, click the Browse button in the Import dialog shown above and select that file.
I had the same issue. To solve it I opened the server explorer (ctrl+alt+s) and refreshed the Azure connection. It still said 0 subscriptions, but in the publishing options I could connect without any issue.

Visual Studio loses password for Azure Website Publish

I am new to publishing to Azure websites straight from Visual Studio. I am running VS 2015, have setup my Azure website with 1 channel so far and have successfully published to the website. I then, went about my week (several reboots) and finally came back to the project, made some changes then tried to publish with the saved publish settings. The password was missing! And, as you know, it is not really a password but rather the hash of the password.
How do you save this information so you are not forced to build a new publish every time you restart Visual Studio? I now have a half dozen publish profiles, all for the one site!
In your publish profile, next to Resource Group, click "Manage in
Cloud Explorer".
In Cloud Explorer, navigate to your App Service.
In the bottom window, click "Download Publish Profile".
In this file you can find your password.
Make sure you are signed in with your azure account by entering your credentials every so often.
If you are signed in, try not changing or clicking on the password field. Just click on publish without touching the previous info.
I always either import the XML from Azure Web portal, or I select the website by signing into Azure in Visual Studio.
Please let me know if this helped.

Resources