Azure AAD authentication, clicked on wrong microsoft ID in browser and now authentication fails every time - python-3.x

I was running a python program to fetch data from Azure Data Explorer, process it and write. The way I authenticate is:
import os
os.system("az login")
#browser pops up, I click on the relevant microsoft account and login.
I can now go back to my IDE and continue with my program. After finishing coding my programs, I restarted the kernel and ran it again for testing. This time, on the browser, I accidently clicked on the wrong micrsoft azure account and the login succeeded (because it was a valid login), but I knew it was wrong so I immediately restarted my kernel again. But ever since then I've been stuck at an error when I actually run a query:
'Caller is not authorized to perform this action', '#type': 'Kusto.DataNode.Exceptions.UnauthorizedDatabaseAccessException',
I tried cleaning the cache with az
az cache purge
#no output on console
I tried going to a different browser, closing everything and restarting. I also tried to find kusto or azure-data-explorer folders under AppData in the windows system and manually deleting the cache, but didn't find any such folders. Note: I haven't restarted the system yet, it's an ec2 instance and I have a lot of work open.
I am able to run the same program normally on a different windows machine succesfully. How can I fix this in an easy way in the future? I normally don't use windows or Azure for development work.

The az logoutcommand should do the work and let you logout from the current active accounts.
But as your tests this don't work for you so a second alternative is to use az logout with all specific accounts az logout --username -Doc

Related

VS Code Keeps Updating

VS Code keeps updating. I think it might be my workstations configuration. I have two accounts assigned to me on the domain for security. One for regular usage and a second with elevated privilege's. I login with the regular and have VS Code configured to always start as Administrator which prompts me for my second elevated user credentials.
Can this be causing the issue and what can I do to help VS Code with the update process?
The key seems to be the shortcut to open VS Code. The properties for the shortcut showed it was opening and running in my regular login account profile directory. When I switched the shortcut to my elevated profile account the updates stopped happening every time I opened VS Code.

IIS on windows 10 application pool keeps stopping

I am having an issue with IIS resulting in the app pool stopping, so I am getting a 503 error
Event Viewer reports
Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly.
DETAIL - Access is denied.
Windows has backed up this user profile. Windows will automatically try to use the backup profile the next time this user logs on.
Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.
I believe this may be because I followed instructions I found on google to clear down files from AppData amongst other place, last week when C: became full (bad move ). Sadly, there is no backup to reinstate the lost files. I expect I have removed an account or permissions somehow.
I have tried setting Load User Profile to False and also setting Identity to LocalSystem but not allowed these settings in the app pool
I was hoping to reinstall IIS but cannot find a solution for that. Does anyone please have advice?

SSIS Connection to Excel via ACE.OLEDB as Service Account

We have a process which needs to work with a series of Excel (sigh) files.
The setup is:
SQL agent job run as a SSIS proxy account.
Calls SSIS package on a share on the server.
Which then starts accessing these excel files using the ACE driver.
The process will work under my credentials.
The process will work under other people's credentials.
The process will work in debug mode (although this is not a fair test
as that would use my local machine's driver)
The process will not work using the SSIS proxy account.
The process WILL work if I make the SSIS proxy account an
administrator on the server.
I have ruled out the following:
access to the files share. The account can load text files from
there.
32bit/64bit issues. The account CAN run given sufficient
permissions.
My opinion is that the service account needs some sort of level of permission to be able to use the driver. I can't work out what though.
I have tried LOCAL SECURITY POLICY option "Load and unload device drivers" with no success. ( I did think this had done it, but then realised that I had left the account in the admin group :-( )
Finally, the error message in question:
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager
"TPR_ReadReportsExcelConnection" failed with error code 0xC0202009.
There may be error messages posted before this with more information
on why the AcquireConnection method call failed.
This seems to be beyond the supported scope depending on how you've set up your SSIS proxy account. See Additional Information section here. Not enough points to post an image so here is the important sentence:
provided the SSIS jobs run in the context of a logged-on user with a valid HKEY_CURRENT_USER registry hive

User Profile Service failure: No more threads can be created in the system

Has anyone encountered this issue: We have windows boxes running on Citrix XenCenter and periodically they will stop allowing RDP connections to the host (error message http://imgur.com/mKDM5uT )
"The User Profile Service service failed the logon. No more threads can be created in the system."
Currently the only way to resolve the issue is to reboot the vm. Has anyone else had this problem? Does anyone know of a fix or of a way to get into the host again without having to reboot? Thanks.
Actually there is no exact reason why this is happening in windows but this issue may occur if The C:Users(user-name) user profile folder was manually deleted instead of properly deleting the user account through User Accounts in the Control Panel. A user profile that is manually deleted does not remove the security identifier (SID) from the profile list in the registry. Since the SID is still present, Windows 7 will still try to load the profile by using the ProfileImagePath that points to a nonexistent path. Therefore, the profile cannot be loaded or The C:Users(user-name) user profile folder itself was manually renamed, instead of using the proper method in this tutorial or A unknown issue with the user profile entering into a backup state occurred or Corrupted user profile or Occasionally, Windows 7 might not read your user profile correctly, for example, if your antivirus software is scanning your computer while you try to log on. Try restarting your computer and logging on.
For permanent solution it may help you
http://www.solveinweb.com/solved-the-user-profile-service-failed-the-logon-user-profile-cannot-be-loaded/

How do I debug a Worker Role using Remote Desktop with Windows Azure?

I now have my Windows Azure environment set up so that I can access my Worker Role with Remote Desktop. However, I'm not sure how to proceed at the moment. After much digging I found a web site that was offline but in Google's cache there was mention of attaching to the Worker Role running in the Azure Cloud from the Visual Studio debugger. But I only have Visual Developer (not studio) 2010 and I have searched all over and as far as I can see there is no such option to attach to a remote server. I am able to publish my project to the Azure Cloud without error and I have a "healthy" instance of my Worker Role showing as active and running.
I did connect with RDP through the Azure Management portal. The login worked fine and up came the remote desktop window. I searched through much of what I could find and was unable to find my Worker Role. I must have the wrong impression of RDP, because I had hoped to see the Worker Role's main display form when I logged in, just like I do when I debug it locally in the Cloud Emulator. But instead all I saw was a blank desktop with some base level server inspection and management routines. I even checked the Event Viewer for Application related messages and saw none.
So now I'm stuck wondering if my Worker Role is actually running or not, despite the seemingly positive status messages from the Management Portal, and I still want to attach to my Worker Role for debugging through Visual Developer, if it's possible, but I am unable to figure out how.
Anyone with experience in this area that can give me some solid tips on what to do next, please respond.
UPDATE: I believe my worker role may be running because I opened a command window and did a Netstat and saw it listening on the correct port. However, that may just be my Worker Role shell class that starts the custom EXE I have it launch as a spawned proces. I still haven't confirmed if my custom EXE is running yet.
UPDATE-2: Just ran TaskList from a command window and the custom EXE is listed.
UPDATE-3: Everything is working as I just ran a remote test of the service so that's not a problem. Still want to know how to attach to the Worker Role from Visual Developer 2010 for remote debugging, and if it's possible to see the custom EXE's display form like I do when doing local debugging in the Cloud Emulator.
-- roschler
There is a set of articles here which goes in length on how to set up for remote debugging in Azure:
http://blogs.u2u.be/peter/post/2011/06/21/Remote-debugging-an-Azure-Worker-role-using-Azure-Connect-Remote-desktop-and-the-remote-debugger.aspx
http://blogs.u2u.be/peter/post/2011/06/24/Remote-debugging-an-Azure-worker-role-using-Azure-Connect-remote-desktop-and-remote-debugger-part-2.aspx
http://blogs.u2u.be/peter/post/2011/06/26/Remote-debugging-a-Windows-Azure-Worker-Role-using-Azure-Connect-Remote-desktop-and-the-remote-debugger-part-3.aspx
The key takeaway is that you don't need to actually install Visual Studio on Azure, you only need to copy the Remote Debugger bits and then use Azure Connect to add your developer machine to the Virtual Network.
You can setup Remote Debugging with Visual Studio 2012
http://code.msdn.microsoft.com/Remote-Debugging-Windows-dedaaec9
When you say:
But instead all I saw was a blank desktop with some base level server inspection and management routines.
this is exactly what you get with an Azure VM. It's a basic OS install, plus the bare minimum of Azure stuff it needs to run and the code you've uploaded. There's no fancy monitoring or health checks available on the machine by default, you're expected to have provided those yourself to have them available without having to RDP into the machine to check on it.
RDP is very good for tracking down certain problems, like checking that a startup task will run, checking which directories items are installed in and just generally being nosey. If you need extra tools to track down a problem, you can just install them while you're connected to the server. For example I have RDPed into a server and installed the Microsoft Debugging Tools, to track down a memory issue.
I suppose you could remote into your VM, install Visual Studio there, and debug the process...
I also suppose it might be possible to enable remote debugging (not sure what's involved there, but such a thing exists, and it works over TCP) and debug from a local instance of Visual Studio.
To my knowledge, neither is commonly done.
Based on other answers, you would be better off writing a log file to a local storage. You can read the file from RDP if you reallyhace to. Keep in mind, debugging on Azure isn't really simple, and rightly so.
What I was thinking though was, maybe you could run the process using the user's credentials. I can't verify at the moment, but you have a better shot of seeing the ui when you rdp.

Resources