Home / AZURE / Issue with Enabling Diagnostic Logs on Azure Resources through Portal

Issue with Enabling Diagnostic Logs on Azure Resources through Portal

Over the weekend, I found an issue with the Azure portal when I tried to enable the logging for the NSG(network Security group) in an Azure Subscription. The logging from the portal can be enabled by going to the NSG and then in the settings blade, click Diagnostics and then in the diagnostics pane, next to Status , click on the ON button. As soon as you do this, you will run into an error similar to the below.

This error happens when the Microsoft Insights is unable to register with the resource and will not show any data. To work around this issue, a PowerShell cmdlet needs to be executed to enable Microsoft Insights with this resource. I have also noted that this is not isolated to the NSG diagnostics only. Please note that Azure PowerShell module is required to be installed on the local computer before the cmdlets can be run. To install the Azure PowerShell, please follow the link below and download the WebPI(web platform installer) for the azure PowerShell.  The link to install the PowerShell module for Azure is below.

https://azure.microsoft.com/en-us/documentation/articles/PowerShell-install-configure/

After the installation of the cmdlet, please run the following from the PowerShell console:

#Login to the Azure subscriptions

Add-AzureRmAccount

#Get the list of available subscriptions

Get-AzureRmSubscription

#Select the subscription which would need the diagnostics to be enabled, change the subscription name to the selected subscription

Select-AzureRmSubscription -SubscriptionName ‘NameofSub’

#Register the Microsoft Insights with the diagnostics

Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Insights

After running the cmdlet, the logging capabilities will be visible in the portal and can be enabled for the NSG. The option to enable the diagnostics is visible on the portal as shown below.

Hope you enjoyed this quick fix. Till next time. 🙂

About prabthind

Prab Thind is currently working as Senior Consultant at Infront Consulting Group. Works primarily with Azure and System Center. Prab holds multiple Microsoft Certifications in Azure and Private Cloud.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

x

Check Also

Azure MFA Server with Windows VPN

Integrate Azure MFA(Multi-Factor Authentication) Server with Windows VPN Azure MFA is one of the many ...