Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Azure SDK上载Azure web应用程序的SSL证书文件(.fpx)_Azure_Ssl_Ssl Certificate_Azure Sdk .net - Fatal编程技术网

使用Azure SDK上载Azure web应用程序的SSL证书文件(.fpx)

使用Azure SDK上载Azure web应用程序的SSL证书文件(.fpx),azure,ssl,ssl-certificate,azure-sdk-.net,Azure,Ssl,Ssl Certificate,Azure Sdk .net,如何使用Azure SDK为Azure应用程序服务上载“.pfx”文件(SSL证书) 中有一个命令,但我想知道Azure SDK中是否有任何功能。我想(不是很确定)就是这个 如果要使用c#SDK创建SSL证书,请参考以下STPE 创建服务负责人并将贡献者分配给sp 代码 string clientId=“”; 字符串clientSecret=“”; 字符串tenantDomain=“”; 字符串“”; var creds=SdkContext.AzureCredentialsFactory.Fr

如何使用Azure SDK为Azure应用程序服务上载“.pfx”文件(SSL证书)

中有一个命令,但我想知道Azure SDK中是否有任何功能。

我想(不是很确定)就是这个

如果要使用c#SDK创建SSL证书,请参考以下STPE

  • 创建服务负责人并将
    贡献者
    分配给sp
  • 代码
  • string clientId=“”;
    字符串clientSecret=“”;
    字符串tenantDomain=“”;
    字符串“”;
    var creds=SdkContext.AzureCredentialsFactory.FromServicePrincipal(clientId、clientSecret、tenantDomain、AzureEnvironment.AzureGlobalCloud);
    var azure=azure.Configure()
    .WithLogLevel(HttpLoggingDelegatingHandler.Level.Body和Header)
    .认证(creds)
    .认购(认购);
    var res=azure.AppServices.AppServiceCertificates.Define(“测试”)
    .WithRegion(Region.AsiaEast)
    .使用现有资源组(“”)
    .WithPfxFile(@“”)
    .WithPfxPassword(“密码”)
    .Create();
    

    az login
    
    az ad sp create-for-rbac -n "MyApp" --role contributor \
        --scopes /subscriptions/{SubID} \
        --sdk-auth
    
    string clientId = "<sp appid>";
                string clientSecret = "<sp password>";
                string tenantDomain = "<sp tenant>";
                string subscription = "";
                var creds= SdkContext.AzureCredentialsFactory.FromServicePrincipal(clientId, clientSecret, tenantDomain, AzureEnvironment.AzureGlobalCloud);
    
                var azure= Azure.Configure()
                    .WithLogLevel(HttpLoggingDelegatingHandler.Level.BodyAndHeaders)
                    .Authenticate(creds)
                    .WithSubscription(subscription);
    
               var res= azure.AppServices.AppServiceCertificates.Define("test")
                    .WithRegion(Region.AsiaEast)
                    .WithExistingResourceGroup("<group name>")
                    .WithPfxFile(@"<pfx file path>")
                    .WithPfxPassword("password")
                    .Create();