Azure: Create resource with PowerShell using parameterized JSON definition file

chrisw 81 Reputation points
2021-09-03T14:19:40.723+00:00

I want to do something like what's shown below, but it's not working. How does one parameterize values inside a JSON configuration file and then pass in the parameter values on the PowerShell command line? Is it possible??

New-AzDataFactoryV2Pipeline -ResourceGroupName "rg-datafactory-dev" -Name "pipeline_outer" -DataFactoryName "df-datafactory-dev" -DefinitionFile "./pipeline_outer.json" -Parameter activityName="Run Notebook" activityType="DatabricksNotebook"

= pipeline_outer.json (parameterized)
{
"name": "pipeline_outer",
"properties": {
"activities": [
{
"name": "$activityName",
"type": "$activityType",
"dependsOn": [],
"policy": {
.
.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,149 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 59,246 Reputation points Microsoft Employee
    2021-09-06T11:46:07.347+00:00

    Hello @chrisw ,

    Thanks for the question and using MS Q&A platform.

    Unfortunately, the PowerShell cmdlet doesn't allow you to pass the parameters.

    Reason: The PowerShell cmdlet (New-AzDataFactoryV2Pipeline) or (Set-AzDataFactoryV2Pipeline) syntax doesn't have parameter option in the syntax.

    Set-AzDataFactoryV2Pipeline  
       [-Name] <String>  
       [-DefinitionFile] <String>  
       [-ResourceGroupName] <String>  
       [-DataFactoryName] <String>  
       [-Force]  
       [-DefaultProfile <IAzureContextContainer>]  
       [-WhatIf]  
       [-Confirm]  
       [<CommonParameters>]  
    

    129603-image.png

    For more details, refer to Azure Data Factory - Create a pipeline.

    Hope this helps. Do let us know if you any further queries.

    ---------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful