Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to retreive dynamic IP address after deployment #4234

Open
MCKLMT opened this issue Jan 31, 2018 · 3 comments
Open

Impossible to retreive dynamic IP address after deployment #4234

MCKLMT opened this issue Jan 31, 2018 · 3 comments

Comments

@MCKLMT
Copy link
Contributor

MCKLMT commented Jan 31, 2018

Issue Details

It's possible to retrieve a static IP address in outputs of a template but not a dynamic IP.

Repro steps

This template works, the IP is in the outputs:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "publicIPAddresses_name": {
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[parameters('publicIPAddresses_name')]",
            "apiVersion": "2017-06-01",
            "location": "westeurope",
            "properties": {
                "publicIPAddressVersion": "IPv4",
                "publicIPAllocationMethod": "Static",
                "idleTimeoutInMinutes": 4
            }
        }
    ],
    "outputs": {
        "resourceID": {
            "type": "String",
            "value": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_name'))]"
        },
        "ipaddress": {
            "type": "String",
            "value": "[reference(parameters('publicIPAddresses_name')).ipAddress]"
        }
    }
}

This template does not work:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "publicIPAddresses_name": {
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[parameters('publicIPAddresses_name')]",
            "apiVersion": "2017-06-01",
            "location": "westeurope",
            "properties": {
                "publicIPAddressVersion": "IPv4",
                "publicIPAllocationMethod": "Dynamic",
                "idleTimeoutInMinutes": 4
            }
        }
    ],
    "outputs": {
        "resourceID": {
            "type": "String",
            "value": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_name'))]"
        },
        "ipaddress": {
            "type": "String",
            "value": "[reference(parameters('publicIPAddresses_name')).ipAddress]"
        }
    }
}

The error message is:

{  
   "code":"DeploymentOutputEvaluationFailed",
   "message":"Unable to evaluate template outputs: 'ipaddress'. Please see error details and deployment operations. Please see https://aka.ms/arm-debug for usage details.",
   "details":[  
      {  
         "code":"DeploymentOutputEvaluationFailed",
         "target":"ipaddress",
         "message":"The template output 'ipaddress' is not valid: The language expression property 'ipAddress' doesn't exist, available properties are 'provisioningState, resourceGuid, publicIPAddressVersion, publicIPAllocationMethod, idleTimeoutInMinutes'.."
      }
   ]
}

Why is it working for static IP but not dynamic?

Thanks

@michaelsync
Copy link

Hi team, Any update on this issue?

CC @zjpjack

@MCKLMT
Copy link
Contributor Author

MCKLMT commented Jul 12, 2018

Hi,
I solved my issue with the help of a PM whom shared with me a trick. This template can help you to understand how: https://github.com/Azure/azure-quickstart-templates/tree/master/201-application-gateway-webapp-iprestriction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants