ARM template deployment does not work when Parameter property is used
See original GitHub issueAn unhandled exception of type ‘Microsoft.Rest.Azure.CloudException’ occurred in mscorlib.dll
Additional information: The request content was invalid and could not be deserialized: ‘Error converting value “http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#” to type ‘Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Definitions.DeploymentParameterDefinition’. Path ‘properties.parameters.$schema’, line 291, position 100.’.
var deployment = new Deployment(); deployment.Properties = new DeploymentProperties { Mode = DeploymentMode.Incremental, Template = templateFileContent, Parameters = parameterFileContent };
File contents are being read as follows: JObject parameterFileContent = GetJsonFileContents(pathToParameter); public static JObject GetJsonFileContents(string pathToJson) { JObject templatefileContent = new JObject(); using (StreamReader file = File.OpenText(pathToJson)) { using (JsonTextReader reader = new JsonTextReader(file)) { templatefileContent = (JObject)JToken.ReadFrom(reader); return templatefileContent; } }
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:11
Top GitHub Comments
OK, so that was it. The new Nuget (named
Microsoft.Azure.Management.ResourceManager
) introduces a breaking change: you now need to specify the entire template parameter file content including the$schema
andcontentVersion
field, as opposed to just the"paramters" : { }
node like in previous version of the nuget (Microsoft.Azure.Management.Resources
).@TianoMS I’m guessing you are referring to nuget Microsoft.Azure.Management.ResourceManager which I am also guessing is now replacing Microsoft.Azure.Management.Resources? I actually tried the latest version of this package (1.3.1) and got a weird error:
Is the Azure REST API now expecting a different format for the
Parameters
field?