in SamplesV1/ADFSecurePublish/AdfKeyVaultDeployment/AdfFileHelper.cs [48:94]
public async Task GetSchemas(IHttpClient httpClient)
{
// If publishing a second time, no need to get the schemas again
if (jsonLinkedServiceSchema == null)
{
var tasks = new List<Task>
{
httpClient.GetAsync(linkedServiceSchema).ContinueWith(x =>
{
jsonLinkedServiceSchema = JSchema.Parse(x.Result.Content.ReadAsStringAsync().Result,
new JSchemaUrlResolver());
}),
httpClient.GetAsync(configSchema).ContinueWith(x =>
{
jsonConfigSchema = JSchema.Parse(x.Result.Content.ReadAsStringAsync().Result,
new JSchemaUrlResolver());
})
};
await Task.WhenAll(tasks);
// Get schema for pipelines
var assembly = Assembly.GetExecutingAssembly();
var pipelineSchemaResource = "Microsoft.ADF.Deployment.AdfKeyVaultDeployment.EmbeddedResources.PipelineSchema.json";
var tableSchemaResource = "Microsoft.ADF.Deployment.AdfKeyVaultDeployment.EmbeddedResources.TableSchema.json";
using (Stream stream = assembly.GetManifestResourceStream(pipelineSchemaResource))
{
using (StreamReader reader = new StreamReader(stream))
{
string schemaText = reader.ReadToEnd();
jsonPipelineSchema = JSchema.Parse(schemaText, new JSchemaUrlResolver());
}
}
using (Stream stream = assembly.GetManifestResourceStream(tableSchemaResource))
{
using (StreamReader reader = new StreamReader(stream))
{
string schemaText = reader.ReadToEnd();
jsonTableSchema = JSchema.Parse(schemaText, new JSchemaUrlResolver());
}
}
httpClient.Dispose();
}
}