使用Azure SDK上载Azure web应用程序的SSL证书文件(.fpx)
如何使用Azure SDK为Azure应用程序服务上载“.pfx”文件(SSL证书) 中有一个命令,但我想知道Azure SDK中是否有任何功能。我想(不是很确定)就是这个 如果要使用c#SDK创建SSL证书,请参考以下STPE使用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
贡献者分配给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();