Set-AzureRmSqlServerFirewallRule Resource not found for the segment
Set-AzureRmSqlServerFirewallRule -FirewallRuleName $AzureFWRuleName -StartIpAddress $StartIP -EndIpAddress $EndIP -ServerName $($AzureSQLServerNames[$Count]) -ResourceGroupName $($AzureRGNames[$Count])
Returns Set-AzureRmSqlServerFirewallRule : NotFound: Resource not found for the segment 'firewallRules'.
This results in not being able to create a firewall rule via PS. Even if one is created manually in the UI and you try to execute a Set- it fails.
@ronbok Apologies for the bad experience. Can you execute the command with $DebugPreference="Continue" and include the logs - this will include messages between client and server, which should help in determining the underlying issue.
Closing this issue due to a lack of activity since it was opened.
@ronbok please feel free to reopen this issue if you have any other questions.
still not working, debug:
DEBUG: 9:55:48 - SetAzureSqlServerFirewallRule begin processing with ParameterSet '__AllParameterSets'. DEBUG: 9:55:48 - using account id 'blah'... DEBUG: [Common.Authentication]: Checking token expiration, token expires '03/19/2019 09:47:51 +00:00' Comparing to '03/19/2019 08:55:48 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:52:02.5172227' DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://management.azure.com/subscriptions/8b472e31-c1b5-4000-95d6-f518844c6c38/resourceGroups/CC-Test/providers/Microsoft.Sql/servers/qt-cc-jaka-sqlserver/firewallRules/Test?api-version=2014-04-01
Headers:
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: NotFound
Headers: x-ms-request-id : 70432305-f9d3-4d40-aece-59731206598e X-Content-Type-Options : nosniff DataServiceVersion : 3.0; Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-subscription-reads: 11999 x-ms-correlation-request-id : eb231ea9-ed6d-41fc-bd29-8f3b8d3e347d x-ms-routing-request-id : WESTEUROPE:20190319T085551Z:eb231ea9-ed6d-41fc-bd29-8f3b8d3e347d Cache-Control : no-store, no-cache Date : Tue, 19 Mar 2019 08:55:51 GMT Server : Microsoft-HTTPAPI/2.0
Body: { "code": "NotFound", "message": "Resource not found for the segment 'firewallRules'.", "target": null, "details": [], "innererror": [] }
Set-AzSqlServerFirewallRule : NotFound: Resource not found for the segment 'firewallRules'. At line:2 char:1
- Set-AzSqlServerFirewallRule -ResourceGroupName "CC-Test" -ServerName ...
-
+ CategoryInfo : CloseError: (:) [Set-AzSqlServerFirewallRule], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.FirewallRule.Cmdlet.SetAzureSqlServerFirewallRule
DEBUG: AzureQoSEvent: CommandName - Set-AzSqlServerFirewallRule; IsSuccess - False; Duration - 00:00:00.5862630; Exception - Hyak.Common.CloudException: NotFound: Resource not found for the segment 'firewallRules'.
at Microsoft.Azure.Management.Sql.LegacySdk.FirewallRuleOperations.
@ronbok, @kapolb
try to use New-AzSqlServerFirewallRule for creating a new rule and Set-AzSqlServerFirewallRule for updating an existing one.
Set-AzSqlServerFirewallRule: NotFound: Resource not found for the segment 'firewallRules'.
This message cryptically tells us that the named firewall rule cannot be found.
Has there been any update on this ticket?