Is there an alternative way to add another Registered Cloud to Visual Studio? - azure

I've lost the ability to log in to Visual Studio using my work account which is prohibiting me from being able to connect to my Azure Dev Ops repos. I believe the reason is because it's trying to auth me against Azure Gov instead of Azure Comm where my account lives.
When I go to my account options I see the US Azure Gov cloud as registered and when I click "Add" I can see the other Gov clouds; but I don't see the commercial cloud. And when I try to add https://login.microsoftonline.com/ manually, it complains that the server returned a 404. Doing a trace reveals the GET to the metadata endpoint is the culprit. https://login.microsoftonline.com/metadata/endpoints?api-version=1.0
I've checked with other developers and they do have it in their list along with the others I have; they have no issues logging in or connecting to the repos. We're running the same major version of VS 2019 - 16.8.x.
Is there an alternative way to register the comm cloud or get that list to be populated with it?
UPDATE: updated to 16.9.4 without luck.

My google-fu finally kicked in and I found a solution.
Near the bottom of the answer from TianyuSun-MSFT, they suggest:
...you can also close all Visual Studio instances and go to C:\Users[user name]\AppData\Local.IdentityService then rename(or delete) the .IdentityService folder, after that you can restart Visual Studio 2019 and try to log in again.
That worked. But before I did it, I investigated the json configs in there and saw a lot pertaining to older versions I no longer have installed. Perhaps, that was the issue.
Once I restarted and logged in, the commercial cloud was automatically added to the list of Registered Clouds.

Related

How to debug Azure Functions on Azure Portal?

I have created an Azure function. Can i debug Azure Functions on Azure portal without visual studio?
I am passing a complex parameter as File Model, i have to see what's coming in parameter value in debug mode?
There is no debug experience in the portal. Constrained to just the portal, you'll have to use log output to debug.
You might also look into the Azure Functions CLI which provides a local debugging experience. it doesn't require VS.
For Azure Functions V1, you can attach debugger then debug from Visual Studio as the code runs inside csx script:
https://markheath.net/post/remote-debugging-azure-functions
For Azure Functions V2, It seems there is no way till now but you can get massive logs and analytics based on your need.
Or may be you can find a way by uploading the debug version contains (.pdb files) and try to attach debugger. Check this:
https://github.com/Azure/Azure-Functions/issues/872
And i opened an issue here to ask about this:
https://github.com/Azure/Azure-Functions/issues/1051
I have another easiest solution It may feet in your issue or may not, I faced a situation that i want to test azure function webhook but that wouldn't work with localhost so the only solution for me is to test it after publishing and for that i was in need for debug on azure itself but there is another brilliant solution:
You can expose your localhost urls to the public by using many services and for example:
https://localtunnel.github.io/www/
Make sure that you installed nodejs, and follow the instructions to install the localtunel package globally through npm and then you can generate a public url for your localhost webhook so you can verify it against any third party and debug it.
Through Azure Functions Portal you won't able to have debugging tools for do that.
But you can you some ways to debug your azure functions:
1º) Remote debugging using Visual Studio IDE;
2º) Local Debugging using both Visual Studio or VS Code, too;
3º) Event though you're using Azure Functions CLI, you'll need some IDE, that is Visual Studio or VS Code;
The only way that there is on Azure Functions Portal to have something like a debugging is the LOG Window that is localized right below Function Code Window.

Can't install Azure WebApp Application Insights without Visual Studio

I have wordpress installed and running in an Microsoft Azure WebApp. When I created the WebApp, the system automatically created Application Insights, which I tried to enable, but unlike on my other WebApps, the server side tracking wasn't working and I couldn't fix it, so I tried to delete it and added a new Application Insights resource...
Unfortunately I can't figure out, how to get it running, sice now I dont have a "deploy" button, to make it work, nor do I have Visual Studio - which every guide recommends to use and is a bit annoying.
What I need to do is install somehow the system monitor for App Insights in my App but can't find out how. (without VS)
Any help appreciated. Thanks
EDIT (SOLVED) :: Justins comment is the solution to this problem.
use the application insights plugin for WordPress. It will set up all of the necessary things to get the server side tracking.
http://github.com/Microsoft/ApplicationInsights-WordPress

Remote Debugging Azure Mobile Service

Trying to debug azure mobile service running in the cloud. I have published debug configuration, in the options indicated to allow debugging non JustMyCode and use source server.
Attach to running process works and I could put break points and step through the code, though I could not get the values of any variables. Even 'this' would not show the values in the watch window.
Prior to that I was trying to debug a release published configuration and the watch used to display values of some of the variables. Others were indicated that due to optimizations values are not available.
Thanks for help,
Ruben
I think you did something wrong, because if you did the remote debug the break point should be hit and you can see all data.
Please see this article
Cconnecting a menu app to azure mobile service > How to do the remote debugging
If it not help, provide a movie with that you are doing :)
I recommend to have Azure SDK 2.5 and Visual Studio 2013 update 4

Your role instances have recycled a number of times during an update or upgrade operation

I am trying to deploy a Cloud Service with 1 Web Role to Azure.
When I do so, I get this message:
Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
The project runs just fine locally, and I'm having a hard time figuring out how to start debugging this issue. Are there any common problems that cause this message or steps to figure out what is causing it?
See https://learn.microsoft.com/en-us/archive/blogs/kwill/windows-azure-paas-compute-diagnostics-data. This will walk through all of the diagnostic data available as well as how to troubleshoot the most common issues.
We also had this annoying problem and in our case:
We use local storage, but it wasn't defined in service definition (or Worker Role's properties)
Our worker role project has reference to a service project which has reference to data layer project. But, the worker role project doesn't have reference to the data layer project. As soon as we added reference to data layer project in worker role project, it deploys successfully.
Problem #1 can be easily noticed if you first run the project in your local machine. Exception will be thrown.
Problem #2, however, is more difficult, mainly because it runs just fine in local machine. After 5 days of trouble shooting, we finally found the problem. So, check all references and try to add sub-reference projects, those that are referenced by other references.
We had similar problem, and it was due to some DDLs failed to load. (due to different version from the one MS have deployed to the VM)
Try to set CopyLocal to "true" for all the References in the project, and re-deploy.
I would either remote desktop to the cloud instance and review the Windows Event Logs for exceptions or redeploy with IntelliTrace Enabled. If you choose the later, you can download the IntelliTrace logs from Visual Studio and debug
http://msdn.microsoft.com/en-us/library/windowsazure/ff683671.aspx
One way to find out the actual error is to click on the " 1 instance" at the top of Dashboard after trying to deploy your web role. It will tell you the status of the role instance. The status should include more information about the type of error which blocks your deployment.
It depends on what your case is. For me, the status claimed that I had an unhandled Security exception. After some investigation, it turned out that under my role's OnStart(), I tried to create a event source. However, Azure service doesn't have the permission to create an event source.
For more possible issues, check http://blogs.msdn.com/b/kwill/archive/2013/09/06/troubleshooting-scenario-3-role-stuck-in-busy.aspx
For me, the issue was with my SQL Azure DB firewall rules. My Azure SQL Database servers are not set to "Allow Access to Azure services", so I have to explicitly list IPs that are allowed.
I discovered this after wrapping my code in a try/catch that swallowed all exceptions, refactoring my OnStart() and RunAsync() methods, and setting all my references to Copy Local = True. None of that worked, then I saw that I had this line in my RunAsync() method:
log4net.Config.XmlConfigurator.Configure();
I am using the AdoNetAdapter for log4net and connecting to an Azure SQL DB for logging, so that led me to check the firewall rules.
For me, I had some differing version of nuget packages in my various projects. Once I consolidated everything to the same version(s), it worked fine.
With the release of Windows Azure SDK version 2.2 for Visual Studio 2012 and 2013, Now you can Remote Debug Cloud Resources within Visual Studio.
Once your cloud service is published and running live in the cloud, you can simply set a breakpoint in your local source code. This may help you in digging out what's going wrong!

Windows azure deployment

I just built a simple hello world windows azure service containing just one web role, I used visual studio 2008 and Windows azure tools for VS 1.2 I am pretty new to this and I have been trying to deploy an application all afternoon now. I'm in australia and deploying in the region Asia anywhere.
I have pretty much followed the info provided on MSDN and it says uploaded 95% then after about ten minutes the deployment disappears. I have tried using the old windows azure developer portal and 30minutes later I can not access the service and it's status is either busy or stopped.
I have the introductory offer for an extra small compute instance on the subscription I am deploying to. Can anyone with experience with windows azure elaborate on the subject of deploying apps and the status on my application, I am very keen to get into the platform and this issue has just about spoiled my weekend.
Most likely it is related to the UseDevelopmentStorage=true for a connection string. I have accidentally done this a couple of times myself and things just magically don't work and there is no explanation. Missing DLL's are usually a little harder to track down as the application may or may not start depending on where the failure happens. Trace logging and/or infrastructure logging is the best way to find out if the DLL is missing if you can get your application to run that far.
As pointed out already, the best place to start is making the simplest "Hello World!" you possibly can and start extending from there. Yes it will take you a while to make progress but the experiences you gain from this will be invaluable moving forward.
Two things to check before deployment
1. Change Roles' Connection Strings to point to Azure Storage instead of UseDevelopmentStorage
2. All References not belong to asp.net framework should be set to "Copy Local=True"
I would guess that the deployment is going successfully but that the role instances are not able to start. The most common causes of this are eithe referrences to development storage while deployed (UseDevelopmentStorage=true) or a referrence to an assembly with copylocal!=true.

Resources