繁体   English   中英

创建Azure数据工厂集成运行时(如果它不存在) - Azure PowerShell

[英]Create Azure Data Factory Integration Runtime if it does not exist - Azure PowerShell

我已经在Azure门户中创建了Azure Data Factory Integration Runtime ,现在想要通过PowerShell脚本创建

   $IR = Get-AzDataFactoryV2IntegrationRuntime -DataFactoryName "CappDashboardDataFactory" -ResourceGroupName "ADFResourceGroup" -Name "CappDashboardDataFactory-Selfhosted-IR"
if(-not $IR)
{
Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName "ADFResourceGroup" -DataFactoryName "CappDashboardDataFactory" -Name "CappDashboardDataFactory-Selfhosted-IR" -Type SelfHosted -Description "selfhosted IR description"
# created successfully
 Write-Output "Created Successfully"
}
else
{
 # already exists
 Write-Output "Already Exists"
}

当我运行脚本时,它不会显示来自else块的消息。 有谁可以帮忙 在此输入图像描述

我尝试了相同的代码,它对我有用。如果你想交叉验证,你可以通过调用下面的函数来做到这一点。

Get-AzDataFactoryV2IntegrationRuntime -ResourceGroupName rg-test-dfv2 -DataFactoryName test-df-eu2 -Name test-dedicated-ir

It will give you following result which you can verify later

    Location                     : West US
    NodeSize                     : Standard_D1_v2
    NodeCount                    : 1
    MaxParallelExecutionsPerNode : 1
    CatalogServerEndpoint        : test.database.windows.net
    CatalogAdminUserName         : test
    CatalogAdminPassword         : **********
    CatalogPricingTier           : S1
    VNetId                       : 
    Subnet                       : 
    State                        : Starting
    ResourceGroupName            : rg-test-dfv2
    DataFactoryName              : test-df-eu2
    Name                         : test-dedicated-ir
    Description                  : Reserved IR

希望能帮助到你。

你必须调整你的if语句:

if($null -eq $IR)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM