[英]Azure asp.net web app trying to connect to Oracle runtime integration linked service
[英]How to connect from .NET .dll file to Azure using Linked Service
我想編寫一個代碼,類似於此鏈接底部的代碼( https://azure.microsoft.com/en-us/blog/automating-azure-analysis-services-processing-with-azure-functions/ ),並生成DLL文件。 但是,我想使用我的Azure門戶中的現有鏈接服務,而不是使用連接字符串。
目標是創建一個刷新我的多維數據集的DLL,同時使用我的Azure門戶中已經存在的現有鏈接服務。
這可能嗎?
謝謝。
#r "Microsoft.AnalysisServices.Tabular.DLL"
#r "Microsoft.AnalysisServices.Core.DLL"
#r "System.Configuration"
using System;
using System.Configuration;
using Microsoft.AnalysisServices.Tabular;
public static void Run(TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function started at: {DateTime.Now}");
try
{
Microsoft.AnalysisServices.Tabular.Server asSrv = new Microsoft.AnalysisServices.Tabular.Server();
var connStr = ConfigurationManager.ConnectionStrings["AzureASConnString"].ConnectionString; // Change this to a Linked Service connection
asSrv.Connect(connStr);
Database db = asSrv.Databases["AWInternetSales2"];
Model m = db.Model;
db.Model.RequestRefresh(RefreshType.Full); // Mark the model for refresh
//m.RequestRefresh(RefreshType.Full); // Mark the model for refresh
m.Tables["Date"].RequestRefresh(RefreshType.Full); // Mark only one table for refresh
db.Model.SaveChanges(); //commit which will execute the refresh
asSrv.Disconnect();
}
catch (Exception e)
{
log.Info($"C# Timer trigger function exception: {e.ToString()}");
}
log.Info($"C# Timer trigger function finished at: {DateTime.Now}");
}
因此,我想您正在使用數據工廠,並且想從管道中處理分析服務模型。 我看不到您的問題實際上與Data Lake商店有什么關系。
要從數據工廠(僅限v2)觸發Azure功能,您必須使用Web活動。 可以將鏈接服務作為有效負載的一部分傳遞,如文檔所示。 看起來像這樣:
{
"body": {
"myMessage": "Sample",
"linkedServices": [{
"name": "MyService1",
"properties": {
...
}
}]
}
但是,數據工廠中沒有Analysis Services鏈接服務,至少,我沒有聽說過這種事情。 但是,從管道傳遞連接字符串似乎是個好主意。 您可以在webrequest主體中將其作為管道參數傳遞。
將其添加到您的網絡活動有效負載
{
"body": {
"AzureASConnString": "@pipeline().parameters.AzureASConnString"
}
您可以從此處描述的函數中檢索此值
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.