Azure / Commercial-Marketplace-SaaS-Accelerator

A reference example with sample code for developers interested publishing transactable, Software as a-Service offers in the Microsoft commercial marketplace.
MIT License
193 stars 289 forks source link

The Deploy.ps1 script gets a IPV6 Public IP instead of and IPV4, causing an error while setting up the SQL firewall rule #635

Closed Giancarl021 closed 8 months ago

Giancarl021 commented 8 months ago

Describe the bug When running the Deploy.ps1 file, I get an FirewallRuleNotIPv4Address, showing that the service ifconfig.me is returning the wrong IP type.

To Reproduce Steps to reproduce the behavior:

  1. Execute the Deploy.ps1 PowerShell file;
  2. On the line 350, it will grab the IPV6 IP address, instead of the expected IPV4;
  3. An FirewallRuleNotIPv4Address error will be thrown

Expected behavior The correct IP type to be returned by the ifconfig.me service, which will lead to a clean execution.

Screenshots

      ➡️ Add SQL Server Firewall rules
{
  "endIpAddress": "0.0.0.0",
  "id": "/subscriptions/***/resourceGroups/SaaS-Accelerator/providers/Microsoft.Sql/servers/***/firewallRules/AllowAzureIP",
  "name": "AllowAzureIP",
  "resourceGroup": "***",
  "startIpAddress": "0.0.0.0",
  "type": "Microsoft.Sql/servers/firewallRules"
}
      ➡️ Running in local environment - Add current IP to firewall
(FirewallRuleNotIPv4Address) '0000:0000:0000:0000:0000:0000:0000:0000' is not a valid IPv4 address.
Code: FirewallRuleNotIPv4Address
Message: '0000:0000:0000:0000:0000:0000:0000:0000' is not a valid IPv4 address.

Environment (please complete the following information):

Additional context