Tabular Analysis Service Azure connect and process via c#

本秂侑毒 提交于 2019-12-11 05:56:48

问题


I have a rather strange problem. First of all I want to mention that the following code works with no problems on-premise i.e. in the local intranet.

We pushed some Cubes to Azure and I tried to do following in my application:

using (Server s = new Server())
{
   s.Connect(cubeConnectionString);
   Database db = s.Databases.FindByName(cubeName);
   db.Model.RequestRefresh(RefreshType.Full);
   db.Model.SaveChanges();
}

So i tried it by using the Azure connection string. It failed with:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: user_realm_discovery_failed: User realm discovery failed 
---> System.Net.WebException: The operation has timed out
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.IdentityModel.Clients.ActiveDirectory.HttpWebRequestWrapper.<GetResponseSyncOrAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

I learned through googling that it has to do with a proxy my company uses. Ok fine. I added to app config:

<system.net>
        <defaultProxy enabled="true" useDefaultCredentials="true">
            <proxy
            usesystemdefault="true"
            proxyaddress="http://proxy:8080"
            bypassonlocal="true"
            />
        </defaultProxy>
</system.net>

So what happens was it worked, the Cube processed but the problem is now that the call of

db.Model.SaveChanges()

does not return anymore and just hangs, eventually throws a timeout exception.

The thing is when I look on Analysis Service the cube finished processing successfully. So I guess it has to do with the proxy involved.

On a test setup at home without proxy involved everything works and the function does return normally.

So do you have any ideas how to handle this?

来源:https://stackoverflow.com/questions/44082659/tabular-analysis-service-azure-connect-and-process-via-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!