/// <inheritdoc/> protected override void ProcessRecordInternal() { var applicationCapacityDescription = new ApplicationCapacityDescription( minimumNodes: this.MinimumNodes, maximumNodes: this.MaximumNodes, applicationMetrics: this.ApplicationMetrics); var managedApplicationIdentityDescription = new ManagedApplicationIdentityDescription( tokenServiceEndpoint: this.TokenServiceEndpoint, managedIdentities: this.ManagedIdentities); var applicationDescription = new ApplicationDescription( name: this.Name, typeName: this.TypeName, typeVersion: this.TypeVersion, parameters: this.Parameters?.ToDictionary <string, string>(), applicationCapacity: applicationCapacityDescription, managedApplicationIdentity: managedApplicationIdentityDescription); this.ServiceFabricClient.Applications.CreateApplicationAsync( applicationDescription: applicationDescription, serverTimeout: this.ServerTimeout, cancellationToken: this.CancellationToken).GetAwaiter().GetResult(); Console.WriteLine("Success!"); }
/// <summary> /// Serializes the object to JSON. /// </summary> /// <param name="writer">The <see cref="T: Newtonsoft.Json.JsonWriter" /> to write to.</param> /// <param name="obj">The object to serialize to JSON.</param> internal static void Serialize(JsonWriter writer, ManagedApplicationIdentityDescription obj) { // Required properties are always serialized, optional properties are serialized when not null. writer.WriteStartObject(); if (obj.TokenServiceEndpoint != null) { writer.WriteProperty(obj.TokenServiceEndpoint, "TokenServiceEndpoint", JsonWriterExtensions.WriteStringValue); } if (obj.ManagedIdentities != null) { writer.WriteEnumerableProperty(obj.ManagedIdentities, "ManagedIdentities", ManagedApplicationIdentityConverter.Serialize); } writer.WriteEndObject(); }