none
How to deploy ADF using Powershell and Generated Arm_Template.json (and parameters) files

    Question

  • Greetings, please help a novice and point to the right resource. I've been looking for a solution for several days.

    Basically, I have a Data Factory created on the Portal. I have generated the arm_template and arm_template_parameter pair of json files. PS script does the job of connecting to AzureAccount, selecting subscription, creating resource group and resource group deployment. The deployment template deploys fine, I can create an ADF, too, albeight an empty one. But I want to be able to deploy all the objects defined in the arm_deploy json file while creating an ADF using PS scripts.

    I guess my questions are:

    - In the auto-generated arm_template_parameters file, are all parameters already defined by default or I have to enter them?

    - How do I actually create objects defined in the arm_template json using PS file? The New-AzureRmResourceGroupDeployment command does use the templates location but it does not create the ADF, just deploys the template

    A simple script is below:

    connect-AzureRMAccount

    Select-AzureRmSubscription -SubscriptionName "SubcriptionName"

    Get-AzureRmResourceGroup -Name ResurceGroup -Location "East US"

    New-AzureRmResourceGroupDeployment -Name ADFPSDeployment -ResourceGroupName GSC-ARM -TemplateFile C:\deploy\arm_template.json -TemplateParameterFile C:\deploy\arm_template_parameters.json

    --Creating new empty ADF

    New-AzureRmDataFactory -ResourceGroupName ResurceGroup -Name ADFname -Location "East US" -Force -ErrorAction Stop

    Thanks!

     
    Thursday, November 1, 2018 6:15 PM

All replies

  • Hello,

    When exporting an ARM template from an existing factory, secrets such as your passwords and tokens in your linked services will not be exported.  You will have to supply all these as parameters to the new Data Factory you are attempting to create.  When you exported your Data Factory to ARM, was a parameter file created which had blank values for secrets?  For example:

            "AzureStorageLinkedService_connectionString": {
                "value": ""
            },
            "AzureDatabricks1_accessToken": {
                "value": ""
            },
            "FileServer1_password": {
                "value": ""
            },
            "EncryptedSqlServerLinkedService_password": {
                "value": ""
            },
            "AzureDataLakeAnalytics1_servicePrincipalKey": {
                "value": ""
            },
    If you store these values in your parameter file, make sure you keep the file in a secure place.  

    Friday, November 2, 2018 10:34 PM
    Moderator