How can I upload a ".pfx" file (SSL Certificate) for an Azure app service using Azure SDK?
There is a command in Azure CLI (Certificates - Create Or Update), but I would like to know if there are any features in Azure SDK.
How can I upload a ".pfx" file (SSL Certificate) for an Azure app service using Azure SDK?
There is a command in Azure CLI (Certificates - Create Or Update), but I would like to know if there are any features in Azure SDK.
If you want to use c# SDK to create SSL certificate, please refer to the following stpes
Contributor
to the spaz 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();