Azure / Azure/arm-template-whatif

does whatIf validate vm size and ip addresses

Open
#166 1 comment 0 reactions 0 assignees View on GitHub
provider bug provider improvement
Dominant language
HTML
Stars
101
Forks
21
Avg merge
3h 35m
Merged PRs (30d)
1

Description

Just started using WhatIf to validate my templates and I thought this would be covered but perhaps it doesn't.

When I pass in bogus IP address and vm sizes (via -TemplateParameterObject) it still succeeds.
Is Get-AzResourceGroupDeploymentWhatIfResult supposed to validate these things?

```
$templateParams = @{}
$templateParams.Add("virtualMachineSize","Standard_E8s_v3_no_such_size")
$templateParams.Add("staticIpAddress","10.20.30.400")

$results = (Get-AzResourceGroupDeploymentWhatIfResult `
-ResourceGroupName "$AzureResourceGroupName" `
-TemplateFile "$ArmTemplatePath" `
-TemplateParameterObject $templateParams)
```

The results contain:

```
+ Microsoft.Compute/virtualMachines/vm-usw-oo-test2-db-99 [2020-06-01]

apiVersion: "2020-06-01"
id: "/subscriptions/my-subscription/.../Microsoft.Compute/virtualMachines/my-vm"
location: "westus"
name: "my-vm"
properties.diagnosticsProfile.bootDiagnostics.enabled: true
properties.diagnosticsProfile.bootDiagnostics.storageUri: "https://sta1my1vm1.blob.core.windows.net/"
properties.hardwareProfile.vmSize: "Standard_E8s_v3_no_such_size"
```

and

```
+ Microsoft.Network/networkInterfaces/nic-usw-oo-test2-db99 [2020-07-01]

apiVersion: "2020-07-01"
id: "/subscriptions/my-subscription/.../Microsoft.Compute/virtualMachines/my-vm"
location: "westus"
name: "nic-my-vm"
properties.ipConfigurations: [
0:
name: "ipconfig1"
properties.privateIPAddress: "10.20.30.400"
properties.privateIPAllocationMethod: "Static"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the shown Get-AzResourceGroupDeploymentWhatIfResult call with the bogus virtualMachineSize and staticIpAddress values. Compare the What-If output with deployment validation and determine whether either value is expected to be rejected; the issue names no repository files or tests, so done means documenting the validation boundary or identifying an actionable repository change.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.