2022-02-19

Tech Programing

程式人小天地

Possible to have 2 DeploymentMetadata.psd1 file(s) in SSIS deployment?

1 min read


My team is performing an upgrade of all SSIS jobs from DDC(On-premises) to Azure. Configuration is stored in Powershell files (specifically the DeploymentMetadata.psd1) see below for snippet. One of my duties is to verify that the former jobs on the DDC servers are disabled (if they exist). I know the code for that (included below). Question – Can I add this to a script? Can I have 2 deploymentmetadata files? The configuration for the service account (and proxy and DB server, etc is all stored in powershell file). I think I can do this in several ways. I believe I could include a Script task in 1 of the jobs and perform the disablement of the jobs on the DDC server this way. I believe I can do this via Powershell commands however I am not versed with PS. My last question is can I just add a script file to PostBuild that runs after SSIS deployment? Thanks for any advice.

**Code to disable job on old server (DDC)

'''

`IF EXISTS (SELECT job_id FROM .msdb.dbo.sysjobs_view WHERE name = N’JobName’)
EXEC .msdb.dbo.sp_update_job @job_name=” JobName “,@enabled = 0
GO

'''

**Code snippet in DeploymentMetaData.psd1 for Azure Deployment

'''

    Envioronment = @(
        @{
          JobPollingTimeoutInSeconds = "480";
          RunConcurrentDeployment = "TRUE";
            Name = "DV1";
            Subscription = "GZ-XX-XX-XX-XXX";
            CloudService = @(
                    @{
                        Name = "gze-xxxx-dv1-xxx-xxxx";
                        Servers = @(
                                        @{
                                          Name = "GZXXXXXXXXSQ1";
                                           DSCConfigurationFileName = 
                                           "NonProd.Azure.SSIS.ps1";
                                           DSCConfigurationDataFileName = 
                                            "ConfigDatata.Azure.DV1.Node1.psd1";
                                           DSCConfigurationName = "RMConfiguration";
                                           DSCConfigurationName = "RMConfiguration";
                                         }
                                   );
                       }
                    );
        }
'''



Source link

資料來源:Stackoverflow

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *