- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用 .NET API 监视现有的 Azure 数据工厂管道。我一直在引用Microsoft provided .NET API .
这是代码:
using System.Configuration;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.Azure.Management.DataFactories;
using Microsoft.Azure.Management.DataFactories.Models;
using Microsoft.Azure.Management.DataFactories.Common.Models;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
namespace ADFv1Tutorial
{
class Program
{
static void Main(string[] args)
{
// create data factory management client
//IMPORTANT: specify the name of Azure resource group here
string resourceGroupName = "<my_resourcegroup_name>";
//IMPORTANT: the name of the data factory must be globally unique.
// Therefore, update this value. For example:APITutorialFactory05122017
string dataFactoryName = "<my data_factory name>";
DateTime PipelineActivePeriodStartTime = new DateTime(2017, 8, 9, 0, 0, 0, 0, DateTimeKind.Utc);
DateTime PipelineActivePeriodEndTime = PipelineActivePeriodStartTime.AddYears(10);// AddMinutes(60);
string Dataset_Destination = "<my dataset_name>";
TokenCloudCredentials aadTokenCredentials = new TokenCloudCredentials(
ConfigurationManager.AppSettings["SubscriptionId"],
GetAuthorizationHeader().Result);
Uri resourceManagerUri = new Uri(ConfigurationManager.AppSettings["ResourceManagerEndpoint"]);
DataFactoryManagementClient client = new DataFactoryManagementClient(aadTokenCredentials, resourceManagerUri);
Console.WriteLine("Getting run details of a data slice");
// give it a few minutes for the output slice to be ready
Console.WriteLine("\nGive it a few minutes for the output slice to be ready and press any key.");
//Console.ReadKey();
var datasliceRunListResponse = client.DataSliceRuns.List(
resourceGroupName,
dataFactoryName,
Dataset_Destination,
new DataSliceRunListParameters()
{
DataSliceStartTime = PipelineActivePeriodStartTime.ConvertToISO8601DateTimeString()
});
foreach (DataSliceRun run in datasliceRunListResponse.DataSliceRuns)
{
Console.WriteLine("Status: \t\t{0}", run.Status);
Console.WriteLine("DataSliceStart: \t{0}", run.DataSliceStart);
Console.WriteLine("DataSliceEnd: \t\t{0}", run.DataSliceEnd);
Console.WriteLine("ActivityId: \t\t{0}", run.ActivityName);
Console.WriteLine("ProcessingStartTime: \t{0}", run.ProcessingStartTime);
Console.WriteLine("ProcessingEndTime: \t{0}", run.ProcessingEndTime);
Console.WriteLine("ErrorMessage: \t{0}", run.ErrorMessage);
//var r = run.Properties.Values;
//run.
//run.
}
Console.WriteLine("\nPress any key to exit.");
Console.ReadKey();
}
public static async Task<string> GetAuthorizationHeader()
{
AuthenticationContext context = new AuthenticationContext(ConfigurationManager.AppSettings["ActiveDirectoryEndpoint"] + ConfigurationManager.AppSettings["ActiveDirectoryTenantId"]);
ClientCredential credential = new ClientCredential(
ConfigurationManager.AppSettings["ApplicationId"],
ConfigurationManager.AppSettings["Password"]);
AuthenticationResult result = await context.AcquireTokenAsync(
resource: ConfigurationManager.AppSettings["WindowsManagementUri"],
clientCredential: credential);
if (result != null)
return result.AccessToken;
throw new InvalidOperationException("Failed to acquire token");
}
}
}
我在App.Config文件中使用了正确的tenantid、applicationid、applicationkey和subscriptionid。
我面临几个问题:
var datasliceRunListResponse = client.DataSliceRuns.List(
资源组名称,
数据工厂名称,
数据集_目标,
新的 DataSliceRunListParameters()
{
DataSliceStartTime = PipelineActivePeriodStartTime.ConvertToISO8601DateTimeString()
});
如果我使用datasliceRunListResponse.dataslices.count
然后我得到 0 作为数据切片计数。为什么?
请帮忙。
最佳答案
我之前已经尝试过此代码,现在我能够获得计数。只需检查开始时间和数据集名称。并且仅在切片附加到输出数据集时才提及输出数据集。
string dataFactoryName = "DataFactoryName";
DateTime PipelineActivePeriodStartTime = new DateTime(2017, 8, 29, 0, 0, 0, 0, DateTimeKind.Utc);
DateTime PipelineActivePeriodEndTime = DateTime(2017, 10, 13, 0, 0, 0, 0, DateTimeKind.Utc);
string Dataset_Destination = "Output Dataset Name";
Console.WriteLine("Getting run details of a data slice");
Console.WriteLine("\nGive it a few minutes for the output slice to be ready and press any key.");
//Console.ReadKey();
var datasliceRunListResponse = client.DataSliceRuns.List(
resourceGroupName,
dataFactoryName,
Dataset_Destination,
new DataSliceRunListParameters()
{
DataSliceStartTime = PipelineActivePeriodStartTime.ConvertToISO8601DateTimeString()
});
Console.WriteLine("count is {0}", datasliceRunListResponse.DataSliceRuns.Count()); Console.ReadKey();
foreach (DataSliceRun run in datasliceRunListResponse.DataSliceRuns)
{
Console.WriteLine("Status: \t\t{0}", run.Status);
Console.WriteLine("DataSliceStart: \t{0}", run.DataSliceStart);
Console.WriteLine("DataSliceEnd: \t\t{0}", run.DataSliceEnd);
Console.WriteLine("ActivityId: \t\t{0}", run.ActivityName);
Console.WriteLine("ProcessingStartTime: \t{0}", run.ProcessingStartTime);
Console.WriteLine("ProcessingEndTime: \t{0}", run.ProcessingEndTime);
Console.WriteLine("ErrorMessage: \t{0}", run.ErrorMessage);
//var r = run.Properties.Values;
//run.
//run.
}
关于azure - 尝试在 Azure 数据工厂 v1 中使用 .Net 监视数据切片时,数据切片计数为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46998502/
我正在用 python 中的 matplotlib 绘制条形图(数据存储在字典中): plt.bar(range(len(Data)), result3.values(), align='center
是否有一种快速/更简单的方法可以从 PSD 创建 iOS UI 主题(标准和 2x 分辨率)所需的图形文件,例如 http://graphicriver.net/theme_previews/2989
我想切断可折叠集中 jquery 移动 header 的左上角。 这是我的 HTML: Witness Content f
背景:我有一个 C99 例程,需要临时存储具有不同对齐要求的不同数据类型。目前,我多次调用 posix_memalign,这 a) 引入了大量开销,b) 不能保证我的临时对象具有良好的内存局部性。我无
给定的文件格式如下。 GGRPW,33332211,kr,P,SUCCESS,systemrenewal,REN,RAMS,SAA,0080527763,on:X,10.0,N,20120419,mi
这个问题在这里已经有了答案: Cut Corners using CSS (16 个答案) 关闭 7 年前。
我正在尝试剪掉设置了上边框的 span 元素的左上角。 一切正常,除了边框一直在白色 CSS 三 Angular 形上运行。这可以通过从 .contract span 中删除 overflow: hi
我目前正在执行一个相当复杂的数据预处理操作,这是: cat large_file.txt \ | ./reverb -q | cut --fields=16,17,18 | awk -F\\t -vq
这两个命令可以将文件的大小保存到一个变量中,因为我是linux新手,我无法理解那里的工作原理。请解释一下它们是如何工作的。 ls -l | grep testing.txt | cut -f6
我使用 pandas.cut() 将连续变量离散化为一个范围,然后按结果分组。 因为我无法弄清楚哪里出了问题而发了很多誓,我了解到,如果我不为 cut() 函数提供自定义标签,而是依赖默认值,那么输出
我有一个名为 log.log 的实时日志文件,我想在其中捕获一些匹配的模式和值: 例子:log.log 正在增长,我们正在搜索具有模式“ResponseTime = VALUE”的行,我们希望提取匹配
我是一名优秀的程序员,十分优秀!