Catching Azure Automation Child runbook Errors

Microsoft Azure

Today I had a very fun time trying to figure out where errors were coming from my child runbook when it ran fine on it’s own. Its seems Microsoft error handling from inline calls to child runbooks is a bit buggy and cost me a day of looking through working code to figure out the problem. It reports weird errors out of which not all are actually true or correct. You may get errors like:

If you do look at the code the foreach/if loop error is referring to as the problem is most likely coming from a function or a method inside the loop. I found deleting (not commenting as it doesn’t work) all code below the if statement or foreach loop gives a better and more precise message exactly where the error is coming from.

New-Object PSObject Problem with Azure Automation

Microsoft Azure

I found a weird behaviour in Azure automation, if you use “New-Object PSObject” it runs perfectly fine when the script is executed directly (via the portal or the Powershell command “Start-AzureRmAutomationRunbook”). However if you try and do an inline call from another workbook it fails and errors out with something like:

the code i used initially was (snippet):

It seems like this command is no longer supported or runs correctly when the child workbook is called by another workbook. To get around this i recommend using the Powershell v3 method which works perfectly:

 

Google Domain Verification Azure DNS

Microsoft Azure

Before you can use your domain with G Suite/Google Cloud, you need to verify that you own it. This can be achieved simply by adding a txt verification record to your domain’s settings. Although Google do provide instructions for a lot of DNS providers such as AWS, GoDaddy etc…However I did notice that Azure was not included in this list.

For convenience I have outlined steps below if you are using Azure to manage the DNS Zone.

Get Verification Code

  1. Open a new browser window or tab, and sign in to your Google Admin console.
  2. Select the option to Verify Domain.
  3. Select Other from the provider list
  4. Select the Add a domain host record (TXT or CNAME) verification method.
  5. Copy the complete contents of the Value/Answer/Destination field. The contents should have “google-site-verification=” at the beginning. This is the verification record that you will submit to your domain host.

Add Verification Record to Azure DNS

  1. Open a new browser window or tab, and sign in to your Azure Portal.
  2. Open up DNS Zones
  3. Select the Domain
  4. Click add Record Set
  5. It will already prefix with your domain, so either leave blank or use @. However if you are using a subdomain enter the subdomain such as test.contoso.com. Although the @ should cover the complete domain, I noticed the google verification process was looking for the exact subdomain record
  6. Select TXT from the Type dropdown
  7. Leave TTL as 1 Hour
  8. In the Value field paste the google site verification string
  9. Click Ok to create the record

Now return back to google and finish the verification process. It may take up to 72hr for some changes to take effect.

Using nslookup, you can verify to see if the TXT record is returned.

From command prompt:

nslookup
set type=txt
subdomain.yourdomain.com

 

 

 

Azure Public and Internal Load balancer for the same availability set

Microsoft Azure

This is one people keep asking me which Microsoft hasn’t published officially. Currently Microsoft Azure allows you to have a public and private load balancer in front of the same availability set.

You can also link both load balancer to the same machines in the availability set. This will enable your servers to have a load balanced private and public IP, which comes in real handy.

You can also link the public to some of the machines and the private to other machines in the availability set.

 

Web Application Proxy Event ID 12019 – (0x8007007b)

Windows

For anyone that has received the below WAP error, especially in Server 2016, please make sure that the published application name does not have any forward slashes “/”.

It seems to like other characters like: “wqe.()-_\sdfds123″££$%%” but not forward slashes.

 

OMS and Power BI Integration Schedule

Microsoft Azure

This is more of a gotcha than anything else but when you’re setting up a schedule to export OMS queries/logs to Power BI please be aware that the initial schedule you setup will also be the historical data it retrieves. What I mean by that is, if I setup a schedule for 24 hours (which is currently the max) in its initial sync it will export the data from that point back 24 hours. So don’t be surprised if you only have the last x amount of data, once the schedule is running it will keep exporting every x hours or minute whatever you have setup so your data over time will grow beyond the schedule you initially setup.

This does raise some concerns and questions:

  • What happens if the sync fails, most likely you will lose some data and it will not be consistent
  • How do I export all the data and sync I? For the moment you can export it to CSV and then import it in PowerBI.
  • You could cheat and set a schedule for 24 hours let it sync and then change it to an hour, this will at least get you the 24 hours rather than just an hour of historical data
  • Is this going to change as this feature is still in preview?