SOLVED

Error when trying to set Allow virtual network in ARM template (Azure SQL server)

%3CLINGO-SUB%20id%3D%22lingo-sub-219520%22%20slang%3D%22en-US%22%3EError%20when%20trying%20to%20set%20Allow%20virtual%20network%20in%20ARM%20template%20(Azure%20SQL%20server)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-219520%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20using%20an%20ARM%20template%20to%20provision%20an%20Azure%20SQL%20server%20with%20elastic%20pool%20and%20setting%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EvirtualNetworkRules%3C%2FP%3E%3CP%3Efirewallrules.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20whole%20template%20is%20working%20without%20any%20issues%2C%20except%20for%20virutalnetworkrules%2C%20I'm%20getting%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CDIV%20class%3D%22msportalfx-property-label-wrapper%22%3ERESOURCE%20ID%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-property-value%20fxs-part-properties-text%22%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%2Fsubscriptions%2Fguid%2FresourceGroups%2FRG-SQLtest%2Fproviders%2FMicrosoft.Sql%2Fservers%2Ftestsqlserver001%2FvirtualNetworkRules%2FAllowVnet%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22msportalfx-property-label-wrapper%22%3ESTATUSMESSAGE%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-property-value%20fxs-part-properties-text%22%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%7B%20%22error%22%3A%20%7B%20%22code%22%3A%20%22InternalServerError%22%2C%20%22message%22%3A%20%22An%20unexpected%20error%20occured%20while%20processing%20the%20request.%20Tracking%20ID%3A%20'ed836246-e40b-41ee-a88a-893e606f2070'%22%20%7D%20%7D%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22msportalfx-property-label-wrapper%22%3ERESOURCE%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-property-value%20fxs-part-properties-text%22%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%3CSPAN%3Etestsqlserver001%3C%2FSPAN%3E%2FAllowVnet%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3EAzure%20SQL%20template%3A%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22msportalfx-tooltip-overflow%22%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%22resources%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('AzureSqlServerName')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft.Sql%2Fservers%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%5D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22administratorLogin%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bparameters('sqlserverAdminLogin')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22administratorLoginPassword%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bparameters('sqlserverAdminLoginPassword')%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22resources%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22AllowAllWindowsAzureIps%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22firewallrules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222014-04-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22startIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%220.0.0.0%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22endIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%220.0.0.0%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22AllowVnet%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22virtualNetworkRules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22virtualNetworkSubnetId%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('VMSqlVnetID')%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleName')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22firewallrules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222014-04-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22startIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleIP')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22endIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleIP')%5D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%5D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-219520%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Resource%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENetworking%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVirtual%20Network%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-220326%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20trying%20to%20set%20Allow%20virtual%20network%20in%20ARM%20template%20(Azure%20SQL%20server)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-220326%22%20slang%3D%22en-US%22%3E%3CP%3EHey%2C%20Mohamed%2C%20hope%20you're%20doing%20fine.%3C%2FP%3E%3CP%3EChecking%20JSON%20reference%20about%20elastic%20pools%20and%20firewall%20rules%2C%26nbsp%3B%20at%20line%2017%2C%20when%20you%20specify%20the%20%22type%22%2C%20is%20not%20just%20%22firewallrules%22%2C%20instead%20you%20must%20use%20this%20one%3A%20%22Microsoft.Sql%2Fservers%2FfirewallRules%22.%3C%2FP%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%3EAt%20line%2029%2C%20the%20same%20applies%20to%20Virtual%20Network%20Rules%20which%20is%3A%20%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3EMicrosoft.Sql%2Fservers%2FvirtualNetworkRules%22.%20Then%2C%20our%20whole%20template%20would%20be%20like%20this%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CPRE%3E%3CSPAN%3E%22resources%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('AzureSqlServerName')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft.Sql%2Fservers%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%5D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22administratorLogin%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bparameters('sqlserverAdminLogin')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22administratorLoginPassword%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bparameters('sqlserverAdminLoginPassword')%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22resources%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Ename%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22AllowAllWindowsAzureIps%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft.Sql%2Fservers%2FfirewallRules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22startIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%220.0.0.0%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22endIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%220.0.0.0%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22AllowVnet%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft.Sql%2Fservers%2FvirtualNetworkRules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22virtualNetworkSubnetId%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('VMSqlVnetID')%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22name%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleName')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22type%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft.Sql%2Fservers%2FfirewallRules%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22location%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5BresourceGroup().location%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22apiVersion%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%222015-05-01-preview%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22dependsOn%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22%5BresourceId('Microsoft.Sql%2Fservers'%2C%20variables('AzureSqlServerName'))%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22properties%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22startIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleIP')%5D%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%22endIpAddress%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%5Bvariables('FWRuleIP')%5D%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%5D%3C%2FSPAN%3E%3C%2FPRE%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EPlease%2C%20try%20this%20adjustments%20and%20let%20us%20know%20if%20it%20worked.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EBest%20Regards%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECarlos%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I'm using an ARM template to provision an Azure SQL server with elastic pool and setting:

 

virtualNetworkRules

firewallrules.

 

The whole template is working without any issues, except for virutalnetworkrules, I'm getting the following error:

 

  • RESOURCE ID
    /subscriptions/guid/resourceGroups/RG-SQLtest/providers/Microsoft.Sql/servers/testsqlserver001/virtualNetworkRules/AllowVnet
  • STATUSMESSAGE
    { "error": { "code": "InternalServerError", "message": "An unexpected error occured while processing the request. Tracking ID: 'ed836246-e40b-41ee-a88a-893e606f2070'" } }
  • RESOURCE
    testsqlserver001/AllowVnet
     
    Azure SQL template:
     
    "resources": [
    {
    "name": "[variables('AzureSqlServerName')]",
    "type": "Microsoft.Sql/servers",
    "location": "[resourceGroup().location]",
    "apiVersion": "2015-05-01-preview",
    "dependsOn": [],
    "properties": {
    "administratorLogin": "[parameters('sqlserverAdminLogin')]",
    "administratorLoginPassword": "[parameters('sqlserverAdminLoginPassword')]"
    },
    "resources": [
    {
    "name": "AllowAllWindowsAzureIps",
    "type": "firewallrules",
    "location": "[resourceGroup().location]",
    "apiVersion": "2014-04-01-preview",
    "dependsOn": [
    "[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
    ],
    "properties": {
    "startIpAddress": "0.0.0.0",
    "endIpAddress": "0.0.0.0"
    }
    },
    {
    "name": "AllowVnet",
    "type": "virtualNetworkRules",
    "apiVersion": "2015-05-01-preview",
    "dependsOn": [
    "[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
    ],
    "properties": {
    "virtualNetworkSubnetId": "[variables('VMSqlVnetID')]"
    }
    },
    {
    "name": "[variables('FWRuleName')]",
    "type": "firewallrules",
    "location": "[resourceGroup().location]",
    "apiVersion": "2014-04-01-preview",
    "dependsOn": [
    "[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
    ],
    "properties": {
    "startIpAddress": "[variables('FWRuleIP')]",
    "endIpAddress": "[variables('FWRuleIP')]"
    }
    }
    ]

 

1 Reply
best response confirmed by Mohamed Shehata (Occasional Contributor)
Solution

Hey, Mohamed, hope you're doing fine.

Checking JSON reference about elastic pools and firewall rules,  at line 17, when you specify the "type", is not just "firewallrules", instead you must use this one: "Microsoft.Sql/servers/firewallRules".

At line 29, the same applies to Virtual Network Rules which is: "Microsoft.Sql/servers/virtualNetworkRules". Then, our whole template would be like this:
"resources": [
{
"name": "[variables('AzureSqlServerName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"apiVersion": "2015-05-01-preview",
"dependsOn": [],
"properties": {
"administratorLogin": "[parameters('sqlserverAdminLogin')]",
"administratorLoginPassword": "[parameters('sqlserverAdminLoginPassword')]"
},
"resources": [
{
name": "AllowAllWindowsAzureIps",
"type": "Microsoft.Sql/servers/firewallRules",
"location": "[resourceGroup().location]"
"apiVersion": "2015-05-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"name": "AllowVnet",
"type": "Microsoft.Sql/servers/virtualNetworkRules",
"apiVersion": "2015-05-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
],
"properties": {
"virtualNetworkSubnetId": "[variables('VMSqlVnetID')]"
}
},
{
"name": "[variables('FWRuleName')]",
"type": "Microsoft.Sql/servers/firewallRules",
"location": "[resourceGroup().location]",
"apiVersion": "2015-05-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('AzureSqlServerName'))]"
],
"properties": {
"startIpAddress": "[variables('FWRuleIP')]",
"endIpAddress": "[variables('FWRuleIP')]"
}
}
]
Please, try this adjustments and let us know if it worked.
Best Regards,
Carlos