Windows Azure Automation Error – user_realm_discovery_failed Solved

Windows Azure Automation Error – user_realm_discovery_failed Solved

I was working with Windows Azure Automation using a MSDN account to create a run book that will run nightly to turn off all my running virtual machines. 

This is super easy and you area even provided a sample script that all you need to do is set your Active Directory (AD) User Name and your Subscription Name. 

Once I completed this and created an Automation Asset of Type Credential for my newly created AD User I was all set to go.  The AD User has been added as a co-administrator on the account to allow them access to the virtual machines. 

I set up the account like this:

With this configuration I received the following errors.

6/24/2015 8:27:46 PM, Error: Add-AzureAccount : user_realm_discovery_failed: User realm discovery failed: The remote server returned an error: (500)
Internal Server Error.
At Stop-AllAzureVM:35 char:35
+
    + CategoryInfo          : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount
 
6/24/2015 8:27:47 PM, Error: Select-AzureSubscription : The subscription name Azure Pass doesn’t exist.
Parameter name: name
At Stop-AllAzureVM:39 char:39
+
    + CategoryInfo          : CloseError: (:) [Select-AzureSubscription], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.SelectAzureSubscriptionCommand
 
6/24/2015 8:27:47 PM, Error: Get-AzureVM : No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to
set the default subscription.
At Stop-AllAzureVM:44 char:44
+
    + CategoryInfo          : CloseError: (:) [Get-AzureVM], ApplicationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.GetAzureVMCommand

Lets loos closer at the User Name value setup in the Credential:

That’s right is has a space at the end of the name from doing a copy and paste of the user name.

If you run into this error you will want to check your user name setup under both the Asset Type of Credential and your user name entered in your script. 

Once I removed the space everything worked as expected..

Best of luck!

Dynamic request content and response content negotiation for RESTFul APIs exposed by BizTalk Server

Dynamic request content and response content negotiation for RESTFul APIs exposed by BizTalk Server

One of the core tenets of RESTFul architecture is that APIs should support content negotiation. That is to say that the service consumer should be able to tell the service through the use of the Accept HTTP header what format the response message should be returned in. On the flip side, it is commonly accepted […]
Blog Post by: Johann

BizTalk Terminator STILL Not Cleaning Up Caching Items?

BizTalk Terminator STILL Not Cleaning Up Caching Items?

I originally published my BizTalk Terminator Not Cleaning Up Caching Items blog back in 2011 where I suggested to use the Terminate Multiple Instances (Hard Termination) task if the normal WMI-based Terminate Cache Instances task doesn’t clean up all the caching instances.

Since then, I’ve come across a caching cleanup scenario that even the hard termination task can’t handle.  Basically, if there are cache message refs (in <HOST>Q or <HOST>Q_Suspended tables) that are missing their associated caching instance (in the Instances table), then even the hard termination task won’t be able to clean them up.  The reason is that the Terminate Multiple Instances (Hard Termination) task finds the instances for termination by looking through the Instances table – so in this case it never sees the orphaned cache message refs.

If you run into this scenario, what you will see is that that once Hard Termination has successfully cleaned up all caching instances, BHM or MBV will continue to complain about cache messages and if you run the View Count of Cache Messages in All Host Queues task, it will show Cache Messages and Message Refs existing even though there are no Associated Cache Instances:

The workaround so far has been to to first run the DELETE Orphaned Messages In All Hosts task (to clean up the orphaned message refs) and then run the Terminate Multiple Instances (Hard Termination) task as mentioned in the previous blog (to clean up the cache instances).

I have also created a new cache cleanup task called Terminate Caching Items (Hard Termination) This task checks all the <HOST>Q, <HOST>Q_Suspended, and Instances tables for caching items associated with any host and in any state and cleans them all up.  The purpose of this new task is to handle all cache item cleanup scenarios with one step – so the user doesn’t have to dig into the state of the cache items in their environment to know how to clean them up.  So if BHM or MBV complain about cache items, simply running this task on the correct MessageBox should take care of it. 

This new task is available in BHM v3.1 and Terminator v2.2.

If you were not already aware that Terminator has been integrated into the BizTalk Health Monitor (BHM) tool, see here.

BizTalk Terminator – Now Available via BHM

BizTalk Terminator – Now Available via BHM

I just wanted to let everyone know that BizTalk Terminator is now also available as a part of BizTalk Health Monitor (BHM) – the new BizTalk tool that integrates MBV and Terminator functionality into an MMC Snap-In that you can run as a part of your BizTalk Admin Console.

Update:  Final version of standalone Terminator released.
More info here – including a comparison of the 2 versions of Terminator.

Terminator functionality can be found in BHM’s Maintenance node:

  • You must be on BHM v3 or above to get the Terminator functionality
  • Get BHM from https://www.microsoft.com/en-us/download/details.aspx?id=43716
  • See here for a walkthrough of BHM v3 functionality – including Terminator integration.
  • See the BHM blog at http://blogs.msdn.com/b/biztalkhealthmonitor for more information on BHM.
  • So far, I’ve included the most popular Terminator tasks in BHM and plan to add more over time
  • BHM officially supports BizTalk 2010, 2013, 2013R2, and 2016.
  • I’m going to continue updating standalone Terminator for now and it is still available here. 
  • At some point, I’ll probably end up creating a final build of the standalone version and move all new development to BHM.  I’ll update this blog once that decision is made.
  • Standalone Terminator tool is no longer being updatedThe final version of standalone Terminator is v2.5.  All new development (including BTS2016 support) is happening in BHM Terminator. 
  • MBV is no longer being updated and the last update to it was in July 2014.  To make sure you are using the latest MBV repository with the latest rules/queries, be sure to move to BHM.
“SOA Patterns with BizTalk Server 2013 and Microsoft Azure – Second Edition” available for pre-order from Packt Publishing

“SOA Patterns with BizTalk Server 2013 and Microsoft Azure – Second Edition” available for pre-order from Packt Publishing

Disclaimer – Shameless (but hopefully informational) plug follows 🙂 Close to a year ago myself and my colleagues Mark, Mahindra, and Colin were approached by Packt Publishing to update Richard Seroter’s “SOA Patterns with BizTalk Server 2009” book for BizTalk Server 2013. We considered this a great honour seeing as the base material in the […]
Blog Post by: Johann

Keeping Service Bus Relays alive for BizTalk based WCF services – Application Initialization and keepalives

Keeping Service Bus Relays alive for BizTalk based WCF services – Application Initialization and keepalives

One of the key areas to focus on when using Service Bus Relays to expose on premise BizTalk hosted WCF services externally without making any firewall changes is availability. Service Bus Relay endpoints in Azure will only be enlisted upon initialization of your on premise service. NOT when your application pool starts, NOT when you […]
Blog Post by: Johann

Service Bus Relay based services slow to startup and slow runtime performance

Service Bus Relay based services slow to startup and slow runtime performance

While working on a project using the WCF webHttpRelayBinding binding with SAS based authentication over transport security, I found that my services were taking a very long time to spin up (30-60 seconds) and that my runtime performance was a bit less than optimal in terms of latency (and I had proven that the latency […]
Blog Post by: Johann