Skip to content

Commit

Permalink
Merge pull request #1760 from Microsoft/users/anaggar/Null_IPConfigFi…
Browse files Browse the repository at this point in the history
…xInAzureTasks

Ignoring resources which have null ipconfig or frontendIPConfig
  • Loading branch information
anaggar committed May 19, 2016
2 parents 96046b6 + 1b6f5ae commit b9bd3f0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 41 deletions.
43 changes: 26 additions & 17 deletions Tasks/AzureFileCopy/Utility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,16 @@ function Get-MachinesFqdnsForPublicIP
#Map the ipc to the fqdn
foreach($publicIp in $publicIPAddressResources)
{
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
if(-not [string]::IsNullOrEmpty($publicIp.IpConfiguration.Id))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
else
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
elseif(-not [string]::IsNullOrEmpty($publicIP.IpAddress))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
}
}
}

Expand Down Expand Up @@ -557,13 +560,16 @@ function Get-MachinesFqdnsForLB
#Map the public ip id to the fqdn
foreach($publicIp in $publicIPAddressResources)
{
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
if(-not [string]::IsNullOrEmpty($publicIp.IpConfiguration.Id))
{
$fqdnMap[$publicIp.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
else
{
$fqdnMap[$publicIp.Id.ToLower()] = $publicIP.IpAddress
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
elseif(-not [string]::IsNullOrEmpty($publicIP.IpAddress))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
}
}
}

Expand All @@ -576,13 +582,16 @@ function Get-MachinesFqdnsForLB
#Get the NAT rule for a given ip id
foreach($config in $frontEndIPConfigs)
{
$fqdn = $fqdnMap[$config.PublicIpAddress.Id.ToLower()]
if(-not [string]::IsNullOrEmpty($fqdn))
if(-not [string]::IsNullOrEmpty($config.PublicIpAddress.Id))
{
$fqdnMap.Remove($config.PublicIpAddress.Id.ToLower())
foreach($rule in $config.InboundNatRules)
$fqdn = $fqdnMap[$config.PublicIpAddress.Id.ToLower()]
if(-not [string]::IsNullOrEmpty($fqdn))
{
$fqdnMap[$rule.Id.ToLower()] = $fqdn
$fqdnMap.Remove($config.PublicIpAddress.Id.ToLower())
foreach($rule in $config.InboundNatRules)
{
$fqdnMap[$rule.Id.ToLower()] = $fqdn
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopy/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 54
"Patch": 55
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopy/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 54
"Patch": 55
},
"demands": [
"azureps"
Expand Down
47 changes: 28 additions & 19 deletions Tasks/DeployAzureResourceGroup/Utility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,16 @@ function Get-MachinesFqdnsForLB
#Map the public ip id to the fqdn
foreach($publicIp in $publicIPAddressResources)
{
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
if(-not [string]::IsNullOrEmpty($publicIp.IpConfiguration.Id))
{
$fqdnMap[$publicIp.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
else
{
$fqdnMap[$publicIp.Id.ToLower()] = $publicIP.IpAddress
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
elseif(-not [string]::IsNullOrEmpty($publicIP.IpAddress))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
}
}
}

Expand All @@ -525,13 +528,16 @@ function Get-MachinesFqdnsForLB
#Get the NAT rule for a given ip id
foreach($config in $frontEndIPConfigs)
{
$fqdn = $fqdnMap[$config.PublicIpAddress.Id.ToLower()]
if(-not [string]::IsNullOrEmpty($fqdn))
if(-not [string]::IsNullOrEmpty($config.PublicIpAddress.Id))
{
$fqdnMap.Remove($config.PublicIpAddress.Id.ToLower())
foreach($rule in $config.InboundNatRules)
$fqdn = $fqdnMap[$config.PublicIpAddress.Id.ToLower()]
if(-not [string]::IsNullOrEmpty($fqdn))
{
$fqdnMap[$rule.Id.ToLower()] = $fqdn
$fqdnMap.Remove($config.PublicIpAddress.Id.ToLower())
foreach($rule in $config.InboundNatRules)
{
$fqdnMap[$rule.Id.ToLower()] = $fqdn
}
}
}
}
Expand Down Expand Up @@ -706,13 +712,16 @@ function Get-MachinesFqdnsForPublicIP
#Map the ipc to the fqdn
foreach($publicIp in $publicIPAddressResources)
{
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
else
if(-not [string]::IsNullOrEmpty($publicIp.IpConfiguration.Id))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
if(-not [string]::IsNullOrEmpty($publicIP.DnsSettings.Fqdn))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.DnsSettings.Fqdn
}
elseif(-not [string]::IsNullOrEmpty($publicIP.IpAddress))
{
$fqdnMap[$publicIp.IpConfiguration.Id.ToLower()] = $publicIP.IpAddress
}
}
}

Expand Down Expand Up @@ -766,8 +775,8 @@ function Get-AzureRMVMsConnectionDetailsInResourceGroup
{
$ResourcesDetails = Get-AzureRMResourceGroupResourcesDetails -resourceGroupName $resourceGroupName -azureRMVMResources $azureRMVMResources

$networkInterfaceResources = $ResourcesDetails["networkInterfaceResources"]
$publicIPAddressResources = $ResourcesDetails["publicIPAddressResources"]
$networkInterfaceResources = $ResourcesDetails["networkInterfaceResources"]
$publicIPAddressResources = $ResourcesDetails["publicIPAddressResources"]
$loadBalancerResources = $ResourcesDetails["loadBalancerResources"]

if($loadBalancerResources)
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DeployAzureResourceGroup/task.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"id": "94A74903-F93F-4075-884F-DC11F34058B4",
"name": "AzureResourceGroupDeployment",
"friendlyName": "Azure Resource Group Deployment",
Expand All @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 74
"Patch": 75
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DeployAzureResourceGroup/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 74
"Patch": 75
},
"demands": [
"azureps"
Expand Down

0 comments on commit b9bd3f0

Please sign in to comment.