ARM template output: Why can I not access the ipAddress of a publicIpAddress ?

Zoltán Tóth 1 Reputation point

In an ARM template output, I have this:

"ip": {  
    "type": "string",  
    "value": "[reference(variables('publicIPAddressName'),'2020-07-01','Full').properties.ipAddress]"    

or the same applies for this:

"ip": {  
    "type": "string",  
    "value": "[reference(variables('publicIPAddressName')).ipAddress]"    

This will cause a deployment error at output evaluation, as:

The template output 'ip' is not valid: The language expression property 'ipAddress' doesn't exist, available properties are 'provisioningState, resourceGuid, publicIPAddressVersion, publicIPAllocationMethod, idleTimeoutInMinutes, dnsSettings, ipTags'.."  

And indeed, I can only access the fields listed in the error message (e.g. publicIPAddressVersion)
This is weird because I can access the whole object via


which contains the ipAddress under properties, as specified.

Other people say this very example (for "ip") works for them.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
1,825 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. TravisCragg-MSFT 5,676 Reputation points Microsoft Employee

    I have a possible explanation for this -

    The 'ipaddress' property only exists if the 'publicIPAllocationMethod' is set to 'Static'. ( A Static Public IP Address). If you did this on an IP Address that was not static, it would return an error, but work for those that were static.

    You can use to view the JSON of any of your azure resources, and verify that a property exists or not.

    0 comments No comments

  2. Zoltán Tóth 1 Reputation point

    I can still see the ipAddress as part of the whole object, with dynamic address allocation:

      "name": "simpleLinuxVMPublicIP",
      "id": "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/publicIPAddresses/simpleLinuxVMPublicIP",
      "etag": "W/\"053bdc94-a30a-423d-9097-a4ce3de4dbf0\"",
      "location": "eastus",
      "properties": {
        "provisioningState": "Succeeded",
        "resourceGuid": "...",
        "ipAddress": "",                     // <-------------
        "publicIPAddressVersion": "IPv4",
        "publicIPAllocationMethod": "Dynamic",           // <--------------
        "idleTimeoutInMinutes": 4,
        "dnsSettings": {
          "domainNameLabel": "simplelinuxvm-...",
          "fqdn": ""
        "ipTags": [],
        "ipConfiguration": {
          "id": "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/networkInterfaces/simpleLinuxVMNetInt/ipConfigurations/ipconfig1"
      "type": "Microsoft.Network/publicIPAddresses",
      "sku": {
        "name": "Basic"

    Also note that I get this in my output if I query the whole object (with ...'Full', as I wrote above.)
    (Btw, it would be really strange if I could not get a dynamically allocated IP address afterwards)

  3. Nathan Bell 26 Reputation points

    I had the same problem: when running a deployment to create a VM with dynamically assigned public IP address, the property was not available in the output object. However, if I re-ran the exact same deployment i.e. the VM already exists, the dynamic IP address was then available in the output. As Travis mentioned, with a static IP address, the property was available in both cases. In order to prevent the error for a dynamic address, I used the following bicep expression: == 'Dynamic' ? '' :

    which compiles to json as:

    "[if(equals(reference(resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))).publicIPAllocationMethod, 'Dynamic'), '', reference(resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))).ipAddress)]"

    Later in the deployment script, I gathered the public IP address using something like:

    $publicIpAddress = Get-AzPublicIpAddress -ResourceGroupName 'MyResourceGroupName' -Name 'MyPublicIpName' | Select-Object -ExpandProperty ipAddress
    0 comments No comments