小编ZZZ*_*int的帖子

Azure Synapse studio 的访问问题

我在 Azure 门户中创建了一个 Synapse 工作区,并尝试打开 Synapse 工作室,但收到以下错误:

由于无法访问,无法加载一项或多项资源,错误代码 403。

credential    
linkedService      
dataset   
pipeline   
trigger  
sqlscript
notebook
sparkjobdefinition 
dataflow
Run Code Online (Sandbox Code Playgroud)

可能是什么原因。我相信我需要访问资源组

azure azure-synapse

5
推荐指数
1
解决办法
2万
查看次数

在 C# 中使用多个 Powershell 命令

在此处显示的方法中,我想使用多个 PowerShell cmdlet。我怎样才能做到这一点?就像在 PowerShell 窗口中一样,我执行导入模块,然后运行命令Start-Db。我怎样才能在这种方法中做同样的事情?我能够Import-module成功运行命令,但是如何添加另一个命令?

[Fact]
public void TestGetRecordings()
{
    PowerShell ps = PowerShell.Create();
    ps.AddCommand( "Import-Module" ).AddArgument( "C:\\ProgramFiles\\Azure Cosmos DB Emulator\\PSModules\\Microsoft.Azure.CosmosDB.Emulator" );
    ps.Invoke();
    ps.Commands.Clear();
}
Run Code Online (Sandbox Code Playgroud)

c# powershell

2
推荐指数
1
解决办法
46
查看次数

如何重构这个 if-else 条件,使其更简洁、更高效?

我有这段代码作为 Azure 函数应用程序,我想知道如何最好地处理这if else部分。

有像 100 个不同客户名称的项目。

最好的方法是什么?

如果有人可以给我举个例子。

string customerName = string.Empty;
foreach( var doc in result )
{
    var data =(JObject)JsonConvert.DeserializeObject( doc.ToString() );
    if( (string)data["Project"] == "HPD_Oid" )
    {
        customerName = "OPPO";
    }
    else if( (string)data["Project"] == "HPD_Oreal" )
    {
        customerName = "RealMe";
    }
    else
    {
        customerName = "OnePlus";
    }
    string partitionkeyValue = string.Concat( (string)data["class"], "|", (string)data["Project"], "|", customerName );
    data.Add( new JProperty( "PartitionKey", partitionkeyValue ) );
Run Code Online (Sandbox Code Playgroud)

读取客户价值:

CustomerSection customer = GetConfiguration( context.FunctionAppDirectory, "CustomerSection.json" );
Run Code Online (Sandbox Code Playgroud)

获取配置值: …

c# refactoring if-statement

-1
推荐指数
1
解决办法
83
查看次数