0

Error: AzResourceGroupDeployment failed!

I was trying to deploy multiple resources using ARM Template deployment and got interrupted with the following error.

New-AzResourceGroupDeployment : 11:59:25 PM – Error: Code=InvalidTemplateDeployment; Message=The template deployment ‘AzureFunctionsVPN’ is not valid according to the validation procedure. The tracking id is ’16b65e77-8c46-462f-8f4c-a909492f7229′. See inner errors for details.

It is very common to see such errors while working with ARM Template deployments. I found the following command-let extremely helpful without which it would have been a herculean task.

Get-AzLog -CorrelationId 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -DetailedOutput

If you are still using old RM command-lets, use the following

Get-AzureRMLog -CorrelationId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -DetailedOutput

The above command generates a lengthy JSON Output, pay attention to Properties > Status Message > Message

Note: Please give at least a minute before you run the above command, it usually takes that much time for the log to show up, otherwise you might get an empty response sometimes.

You can also get the logs based on a date and time range. For more information please refer to the following link.

https://docs.microsoft.com/en-us/powershell/module/az.monitor/get-azlog?view=azps-3.8.0

0

Error: No match was found for the specified search criteria for the provider ‘NuGet’

I received the following error while installing Azure PowerShell Modules.

Install-Module -Name Az -AllowClobber

PackageManagement\Install-PackageProvider : No match was found
for the specified search criteria for the provider 'NuGet'.
The package provider requires 'PackageManagement' and 'Provider'
tags. Please check if the specified package has the tags.

Issue:

The issue, as I understand it, is that PowerShell by default uses TLS 1.0 for web requests and causing an issue in this case. So when the Install-Module command is trying to install the missing Package-Provider as a pre-requisite and AZ Modules itself, it’s failing! See step 3 to change the default to TLS 1.2

Solution:

Step 1: Check the PowerShell version installed and update it if required.

$PSVersionTable.PSVersion

Note: Azure PowerShell works with PowerShell 5.1 or higher on Windows, or PowerShell Core 6.x and later on all platforms. You should install the latest version of PowerShell Core available for your operating system. Azure PowerShell has no additional requirements when running on PowerShell Core.

To use Azure PowerShell in PowerShell 5.1 on Windows:

  1. Update to Windows PowerShell 5.1 if needed. If you’re on Windows 10, you already have PowerShell 5.1 installed.
  2. Install .NET Framework 4.7.2 or later.
  3. Make sure you have the latest version of PowerShellGet. Run Update-Module PowerShellGet -Force.

Step 2: Check if the NuGet package provider is installed

Get-PackageProvider -ListAvailable

Following is what I have initially, notice NuGet package provider is missing.

Step 3: Run the following command

The following will for the PowerShell to use TLS 1.2 

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Step 4: Re-Run Install-Module command

Install-Module -Name Az -AllowClobber

Note: The above command should have installed the missing package-provider as well and should look like the following. See highlighted.

References:

https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.8.0

0

Azure Service Bus Feature Summary

This post acts as a quick reference for all the popular features that differentiate Service Bus from Storage Queues.

This blog post assumes that you have some fundamental understanding of messaging options within Azure. But if you want to get started and need a more detailed understanding please refer to the following articles.

Microsoft Service Bus

Messaging options in the Microsoft Azure Platform

Service Bus feature summary:

Note: All the above options applies to both Queues and Topics.

Time to live:
Message time to live determines how long a message will stay in the queue before it expires and is removed or dead lettered. When sending messages it is possible to specify a different time to live for only that message. This default will be used for all messages in the queue which do not specify a time to live for themselves. 

Lock Duration:
Sets the amount of time that a message is locked for other receivers. After its lock expires, a message pulled by one receiver becomes available to be pulled by other receivers. Defaults to 30 seconds, with a maximum of 5 minutes.

Duplicate Detection:
Enabling duplicate detection configures your queue to keep a history of all messages sent to the queue for a configurable amount of time. During that interval, your queue will not accept any duplicate messages. Enabling this property guarantees exactly-once delivery over a user-defined span of time

Dead Lettering:
Dead lettering messages involves holding messages that cannot be successfully delivered to any receiver to a separate queue after they have expired. Messages do not expire in the dead letter queue, and it supports peek-lock delivery and all transactional operations.

Sessions:
Service bus sessions allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.

Partitioning:
Partitions a queue across multiple message brokers and message stores. Disconnects the overall throughput of a partitioned entity from any single message broker or messaging store. This property is not modifiable after a queue has been created.

References:

Time to live:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-expiration
Duplicate Detection:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/duplicate-detection
Dead-Letter-Queues:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues
Sessions:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-sessions
Partitioning:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-partitioning