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

[Bug Report]: Cannot deploy Virtual Machine with Static IP Address #1676

Closed
chris5287 opened this issue Jul 15, 2022 · 0 comments · Fixed by #1677 or #1684
Closed

[Bug Report]: Cannot deploy Virtual Machine with Static IP Address #1676

chris5287 opened this issue Jul 15, 2022 · 0 comments · Fixed by #1677 or #1684
Assignees
Labels
bug Something isn't working [cat] modules category: modules

Comments

@chris5287
Copy link
Contributor

chris5287 commented Jul 15, 2022

Describe the bug

The ipConfiguration.vmIPAddress property within the Virtual Machine module is sent via a nested bicep resource to the Network Interfaces module using privateIPAddress, instead of vmIPAddress

I would assume we cannot update the Network Intefaces modules to align to the privateIPAddress property (as that would be a break public interface, so I guess the fix is to map the Virtual Machine nested bicep to use vmIPAddress throughout.

1st nested layer:

privateIPAddress: contains(ipConfiguration, 'vmIPAddress') ? (!empty(ipConfiguration.vmIPAddress) ? ipConfiguration.vmIPAddress : null) : null

2nd nested layer:

privateIPAddress: contains(ipConfiguration, 'vmIPAddress') ? (!empty(ipConfiguration.vmIPAddress) ? ipConfiguration.vmIPAddress : null) : null

To reproduce

Example Bicep module call below

Code snippet

module vm 'main/modules/Microsoft.Compute/virtualMachines/deploy.bicep' = {
  name: '${deployment().name}_vm'
  params: {
    name: 'name'
    imageReference: {
      publisher: 'zscaler'
      offer: 'zscaler-private-access'
      sku: 'zpa-con-azure'
      version: 'latest'
    }
    vmSize: 'Standard_D4s_v3'
    adminUsername: 'azure-username'
    adminPassword: 'supersecretpassword'
    osType: 'Linux'
    osDisk: {
      diskSizeGB: '16'
      managedDisk: {
        storageAccountType: 'StandardSSD_LRS'
      }
    }
    nicConfigurations: [
      {
        nicSuffix: '-nic-01'
        enableAcceleratedNetworking: true
        ipConfigurations: [
          {
            name: 'ipconfig01'
            subnetId: '/subscriptions/...../subnets/....'
            privateIPAllocationMethod: 'Static'
            vmIPAddress: '192.168.10.10'
          }
        ]
      }
    ]
  }
}

Relevant log output

ERROR: InvalidTemplateDeployment - The template deployment 'deploy1' is not valid according to the validation procedure. The tracking id is 'xxxxxxxxxxxxxxxxxxxxxxx'. See inner errors for details.
TemplateFailedPrevalidation - The template request has multiple validation failures involving one or more Microsoft.Network resources. Please check details for information about each resource.
PrivateIPAddressMissing - Private IP address is required when privateIPAllocationMethod is Static in IP configuration /subscriptions/xxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx/providers/Microsoft.Network/networkInterfaces/name-nic-01/ipConfigurations/ipconfig01.
@chris5287 chris5287 added the bug Something isn't working label Jul 15, 2022
@chris5287 chris5287 changed the title [Bug Report]: [Bug Report]: Cannot deploy Virtual Machine with Static IP Address Jul 15, 2022
@AlexanderSehr AlexanderSehr added the [cat] modules category: modules label Jul 16, 2022
@rahalan rahalan moved this to Closed in Bug board Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [cat] modules category: modules
Projects
Status: Closed
2 participants