Monday, June 25, 2018

Opening a Dynamics CRM form directly

Sometimes when opening an entity record in Dynamics CRM, you get the error “Record is Unavailable” and in the log file it contains the following error: “Microsoft.Crm.CrmException: systemform With Id = xxxxxxxxxxx not found”. I am not sure why exactly Dynamics CRM gets into this state and some of the solutions online are to clear your browser cache, etc.

In my case, the only way I was able to get the form to open was to get a link that forced a different form to be opened. You can do this one of 2 ways:

1. Have someone open an entity that you are having issues with and have them email you the link, using the Email Link functionality in the ribbon bar. Or

2. Use the following link and fill in the highlighted sections and enter it in the browser:

https://[dyanmicsCrmUrl]/main.aspx?pagetype=entityrecord&etn=[entityNameHere]&extraqs=formid%3d[GUIDHere]

And here is an example of how that might look:

https://myorgname.crm.dynamics.com/main.aspx?pagetype=entityrecord&etn=account&extraqs=formid%3d6da2bf43-566a-4622-9c06-f350ac6ebf67

Thursday, June 14, 2018

Set-AzureRmAppServicePlan throws “Long running operation failed with status 'Conflict'” error

I was trying to go from a standard tier to the free tier and I got a conflict error.

There are many reasons that you might get this error and they are typically related to some functionality not available in the free tier that you enabled in paid tiers. To figure out why, go into your App Service Plan and look at your activity log. You should an entry for operation name: “Update hosting plan” with a status of failed. If you look at the “Json” and search for “statusMessage”, you should be able to figure out why.

In my case the error was caused by the fact that I was using a hybrid connection.

"Cannot change to the target SKU 'Free' because the Hybrid Connections count will exceed the new limit of '0'\"

Wednesday, June 13, 2018

Connect to Azure RM using a Service Principal

$applicationId = "Guid"
$tenantId = "Guid"
$subscriptiondId = "Guid"
$sharedSecret = "SharedSecretKey"

#convert to securestring
$secpasswd = ConvertTo-SecureString $sharedSecret -AsPlainText –Force

#create credential object
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $secpasswd

#connect to Azure
Connect-AzureRmAccount -ServicePrincipal -Credential $credential -TenantId $tenantId -SubscriptionId $subscriptionId

#test it!
Get-AzureRmResourceGroup