public ARMOrchestrationClient( OrchestrationWorkerClient orchestrationWorkerClient, IOptions <ARMOrchestrationOptions> options, IInfrastructure infrastructure) { this._OrchestrationWorkerClient = orchestrationWorkerClient; this._Options = options?.Value; this._Infrastructure = infrastructure; this._GetResourceListCommandString = string.Format("select * from {0} where deploymentId=@deploymentId", this._Options.Database.DeploymentOperationsTableName); this._GetAllResourceListCommandString = string.Format("select * from {0} where RootId=@RootId", this._Options.Database.DeploymentOperationsTableName); }
public ARMTemplateHelper( IOptions <ARMOrchestrationOptions> options, ARMFunctions functions, IInfrastructure infrastructure) { this.options = options?.Value; this.ARMfunctions = functions; this.infrastructure = infrastructure; this._saveDeploymentOperationCommandString = string.Format(@" MERGE {0} with (serializable) [Target] USING (VALUES (@InstanceId,@ExecutionId)) as [Source](InstanceId,ExecutionId) ON [Target].InstanceId = [Source].InstanceId AND [Target].ExecutionId = [Source].ExecutionId WHEN NOT MATCHED THEN INSERT ([InstanceId],[ExecutionId],[GroupId],[GroupType],[HierarchyId],[RootId],[DeploymentId],[CorrelationId],[ParentResourceId],[ResourceId],[Name],[Type],[Stage],[CreateTimeUtc],[UpdateTimeUtc],[SubscriptionId],[ManagementGroupId],[Input],[Result],[Comments],[CreateByUserId],[LastRunUserId]) VALUES (@InstanceId,@ExecutionId,@GroupId,@GroupType,@HierarchyId,@RootId,@DeploymentId,@CorrelationId,@ParentResourceId,@ResourceId,@Name,@Type,@Stage,GETUTCDATE(),GETUTCDATE(),@SubscriptionId,@ManagementGroupId,@Input,@Result,@Comments,@CreateByUserId,@LastRunUserId) WHEN MATCHED THEN UPDATE SET [Stage]=@Stage,[UpdateTimeUtc]=GETUTCDATE(),[Result]=isnull(cast(@Result AS NVARCHAR(MAX)),[Result]),[Comments]=isnull(@Comments,Comments),[LastRunUserId]=isnull(@LastRunUserId,LastRunUserId),[Input]=isnull(cast(@Input AS NVARCHAR(MAX)),[Input]); ", this.options.Database.DeploymentOperationsTableName); }