Understanding and Resolving the “Cannot Set or Update Property disallowPublicIpAddress” Issue in Azure DevTest Labs ARM Template Deployments

Luca Berton
6 min readJust now

When working with Azure DevTest Labs and deploying resources via ARM templates, users may encounter an issue related to the disallowPublicIpAddress property. This error typically manifests when running an ARM template deployment multiple times, especially in Incremental deployment mode, or when attempting to modify resources that already exist in the DevTest Labs environment. The specific error looks like this:

"error": {
"code": "CannotSetProperty",
"message": "Cannot set or update property disallowPublicIpAddress."
}

This error has been widely discussed in the Azure community, as seen in the GitHub Issue #386, which outlines common scenarios and behaviors around this issue.

What Causes This Error?

The disallowPublicIpAddress property determines whether a virtual machine (VM) in DevTest Labs is assigned a public IP address. This property can only be set during the initial creation of the VM. Once a VM has been created with or without a public IP, this property cannot be updated or changed through subsequent ARM template deployments.

Key Behavior of the…

--

--

Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday