我已经在Azure Portal中创建了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"
}
答案 0 :(得分:0)
我尝试了相同的代码,对我有用。仍然,如果您想交叉验证,可以通过调用下面的函数来做到这一点。
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
希望有帮助。
答案 1 :(得分:0)
您必须调整if语句:
if($null -eq $IR)