Value for reference id is missing. Path properties.ipConfigurations[0].properties.publicIPAddress

Martin Brown 11 Reputation points
2020-08-02T19:44:23.49+00:00

I'm trying to deploy a Virtual Machine using an ARM Template. The VM needs to have a static IP address. When deploying the template I'm getting an error. I think I'm getting the reference to the public IP address from the network interface wrong but I can't see how I should do this? The error is:

20:13:01 - The deployment 'my-template' failed with error(s). Showing 1 out of 1 error(s).
| Status Message: Cannot parse the request. (Code: InvalidRequestFormat) - Value for reference id is
| missing. Path properties.ipConfigurations[0].properties.publicIPAddress. (Code:MissingJsonReferenceId)
| - Value for reference id is missing. Path properties.networkSecurityGroup.
| (Code:MissingJsonReferenceId) CorrelationId: ab49b076-8888-8888-8888-8888888888

I've defined the IP Address thus:

    {
        "type": "Microsoft.Network/publicIPAddresses",
        "apiVersion": "2020-04-01",
        "name": "[variables('myVmIpName')]",
        "location": "[variables('location')]",
        "sku": {
            "name": "Basic"
        },
        "properties": {
            "ipAddress": "198.51.100.176",
            "publicIPAddressVersion": "IPv4",
            "publicIPAllocationMethod": "Static",
            "idleTimeoutInMinutes": 4,
            "dnsSettings": {
                "domainNameLabel": "[variables('myVmDnsName')]",
                "fqdn": "[concat(variables('myVmDnsName'), '.', variables('location'), '.cloudapp.azure.com')]"
            }
        }
    },

And the network interface is defined like this:

    {
        "type": "Microsoft.Network/networkInterfaces",
        "apiVersion": "2020-04-01",
        "name": "[variables('myVmNicName')]",
        "location": "[variables('location')]",
        "properties": {
            "ipConfigurations": [
                {
                    "name": "ipconfig1",
                    "properties": {
                        "privateIPAllocationMethod": "Dynamic",
                        "publicIPAddress": "[reference(variables('myVmIpName'))]",
                        "subnet": "[reference(variables('myVnetName')).subnets[0]]",
                        "primary": true,
                        "privateIPAddressVersion": "IPv4"
                    }
                }
            ],
            "enableAcceleratedNetworking": false,
            "enableIPForwarding": false,
            "networkSecurityGroup": "[reference(variables('myVmNsgName'))]"
        }
    }

I've changed some of the definition to protect the innocent, but hopefully it is near enough to show the error.

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.
2,264 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 44,906 Reputation points Microsoft Employee
    2020-08-05T12:49:54.933+00:00

    @Martin Brown Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. !
    I would like to work closer on this issue so If you have a support plan, I request you file a support ticket, else please do let us know, we will try and help you get a one-time free technical support. In this case, could you send an email toAzCommunity[at]Microsoft[dot]com referencing this thread. Please mention "ATTN subm" in the subject field and subscription ID. Thank you for your cooperation on this matter and look forward to your reply.

    Hope this helps!

    ----------------------------------------------------------------------------------------------------------------------------------

    (If the reply was helpful please don't forget to accept as answer, thank you)

    0 comments No comments