【发布时间】:2019-07-05 10:28:42
【问题描述】:
我正在尝试以编程方式访问 Azure Data Fabric V2。
首先,我在 Azure 门户中创建了一个应用注册和一个客户端密码。然后我在整个订阅以及我的数据工厂所在的资源组中授予了 Contributor 对该应用程序注册的权限。 使用此凭据,我可以登录门户并创建 DataFactoryManagementClient
private void CreateAdfClient()
{
var authenticationContext = new AuthenticationContext($"https://login.windows.net/{tenantId}");
var credential = new ClientCredential(clientId: appRegistrationClientId, clientSecret: appRegistrationClientkey);
var result = authenticationContext.AcquireTokenAsync(resource: "https://management.core.windows.net/", clientCredential: credential).ConfigureAwait(false).GetAwaiter().GetResult();
if (result == null)
{
throw new InvalidOperationException("Failed to obtain the JWT token");
}
var token = result.AccessToken;
var tokenCloudCredentials = new TokenCloudCredentials(subscriptionId, token);
datafactoryClient = new DataFactoryManagementClient(tokenCloudCredentials);
}
但是,当我尝试使用管道时
var pipeline = datafactoryClient.Pipelines.Get(resourceGroup, dataFactory, pipelineName);
它会抛出一个错误:
System.Private.CoreLib:执行函数时出现异常: StartRawMeasuresSync。 Microsoft.Azure.Management.DataFactories: ResourceNotFound:资源 资源组下的“Microsoft.DataFactory/dataFactories/MyPipeline” 找不到“MyResGroup”。
我已验证资源组、数据工厂名称和管道名称正确,但一直抛出此错误。
【问题讨论】:
标签: azure azure-data-factory-2