Adding BGInfo extension on Azure Resource Manager VM

Microsoft has not yet added a way to add extensions to Resource Manger VMs on Azure. Luckily there is a way to do this using Powershell.

Prerequisites:

You need to have the Azure Powershell tools installed – see https://azure.microsoft.com/da-dk/documentation/articles/powershell-install-configure/

Afterwards connect to Azure – see this http://azurefabric.com/powershell-1-0-and-arm-tenants-and-subscriptions/

First step:

First we need to install the Windows Azure VM Agent on the VM server. This can be downloaded from here Рhttp://aka.ms/vmagentwin.

You need to run this installer from an elevated command prompt (run command prompt or Powershell as administrator).

If you skip this step you will be in all kinds of trouble ūüėČ I didn’t install this before I installed the BGInfo extensions. The extension was installed, but the status was failed. Also the standard extension (if you installed diagnostics) Microsoft.Insights.VMDiagnosticsSettings failed after this. Installing the Azure VM Agent afterwards does not solve these problems. I’m currently trying to uninstall the BGInfo extension again from the portal, it has been running for 54 minutes now… I will update this post later, when I have a solution for this mess.

Second step:

Start up your Azure Powershell and connect to your subscription (see prerequisites)

Run this command to install the BGInfo extension (thank you BigSkyTech – Technet forums post)

Warning! Users will get disconnected while the VM is being updated!

Set-AzureRmVMExtension -ExtensionName BGInfo -Publisher Microsoft.Compute -Version 2.1 -ExtensionType BGInfo -Location northeurope -ResourceGroupName YOUR_RESOURCE_GROUP -VMName YOUR_VM_NAME

Next time you log in to your server, the BGInfo should now be displayed, yay!

The extension also becomes visible in the Azure management portal Рlook under Virtual Machines > YOUR_VM > Settings > Extensions

Want more?

Wanna see all¬†available extensions? Run this…

Get-AzureVMAvailableExtension | Out-GridView

If you want to install Microsoft Antimalware you can run…
Don’t use this just yet… it’s kinda buggy ūüė¶
Set-AzureRmVMExtension -ExtensionName IaaSAntimalware -Publisher Microsoft.Azure.Security -Version 1.3 -ExtensionType IaaSAntimalware -Location northeurope -ResourceGroupName YOUR_RESOURCE_GROUP -VMName YOUR_VM_NAME
Be patient, it can take quite a while to add certain extensions, don’t give up! ūüôā

 

 

Advertisements

sessionState mode=”InProc”

Just wanted to share a silly mistake that I made when testing NAV 2016 web client (could have been any version).

NAV 2016 webservice error

Problem:

When trying to access the webclient I got the above error (<sessionState mode=”InProc”/>).

Solution:

I forgot to add the port number in the url. The webclient runs on port 8080 (default), but I didn’t specify this when typing in the url. I was trying to access https://nav2016.yourdomain.com/INSTANCE_NAME/WebClient/ instead of https://nav2016.yourdomain.com:8080/INSTANCE_NAME/WebClient/.

The reason this has given me such a headache is that the url https://nav2016.yourdomain.com/INSTANCE_NAME/WebClient/ does exist, but the web client is configured for port 8080 which is why I am getting the above error.

I hope this will help someone else save some time ūüôā

“Microsoft.Dynamics.Nav.Client has stopped working” error when starting NAV client

“Microsoft.Dynamics.Nav.Client has stopped working”

This message has given me a headache today, but now I finally found a solution…

The error message came up when I tried to start up the NAV 2013 RTC client. There were 2 error messages in the Event Log, but none of them said anything useful.

I have been fighting with a problem similar to this once before, where I had to give up and never found a solution. The problem seemed to be related to roaming profiles where the user profile was stored¬†at \\server\profiles$\username\… and the error message there was something like “app data path contains illegal characters”. Anyway, my point is that this customer only had this problem on Lenovo laptops. There were no problems running NAV in a VM using the same username and Group Policies.

This makes me think that there might be some kind of software preinstalled on Lenovo computers?!? There seem to be a problem when the NAV client has to write to C:\Users\username\appdata\…

Long story short… I fixed the problem by changing the NAV 2013 RTC shortcut and adding the parameter -settings:”C:\ProgramData\Microsoft\Microsoft Dynamics NAV\70\ClientUserSettings.config”.

settings

Hyper-V VM stuck in backing up status

Sometimes Hyper-V VMs gets stuck in a backing up status. You can’t see this status in SCVMM but it shows in the Hyper-V Manager. When a VM is in a backing up state, all backups will fail!

If you try to reboot the Hyper-V host server, it will often hang, trying to shut down the Hyper-V Virtual Machine Management service.

I have been struggling with this issue for quite a while, but now there is finally a much better solution than having to reset the Hyper-V host server.

EDIT: This can be fixed with a single Powershell “script”. Run Powershell as administrator and then run “get-process -name vmms | select id | kill -force” on the Hyper-V server. The process will start automatically again after a few seconds. Everything will keep on running, only the Hyper-V manager will loose connection for a few seconds.

Here’s the solution – http://richardstk.com/2014/11/24/hyper-v-vm-stuck-in-backing-up-state/

Thanks Richard!

Update:

If you want to use Powershell to show the status of all your VM’s across all Hyper-V servers, you can use this:

Get-VM -ComputerName hpv01,hpv02,hpv03