POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps?api-version=2024-02-01
URI 매개 변수
Name
In(다음 안에)
필수
형식
Description
customDomainName
path
True
string
엔드포인트 내의 사용자 지정 도메인 이름입니다.
endpointName
path
True
string
전역적으로 고유한 프로필 아래의 엔드포인트 이름입니다.
profileName
path
True
string
리소스 그룹 내에서 고유한 CDN 프로필의 이름입니다.
resourceGroupName
path
True
string
Azure 구독 내의 리소스 그룹 이름입니다.
regex 패턴: ^[-\w\._\(\)]+$
subscriptionId
path
True
string
Azure 구독 ID입니다.
api-version
query
True
string
클라이언트 요청과 함께 사용할 API의 버전입니다. 현재 버전은 2024-02-01입니다.
POST https://management.azure.com/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customDomains/www-someDomain-net/enableCustomHttps?api-version=2024-02-01
/**
* Samples for CustomDomains EnableCustomHttps.
*/
public final class Main {
/*
* x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/
* CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json
*/
/**
* Sample code: CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
customDomainsEnableCustomHttpsUsingCDNManagedCertificate(com.azure.resourcemanager.AzureResourceManager azure) {
azure.cdnProfiles().manager().serviceClient().getCustomDomains().enableCustomHttps("RG", "profile1",
"endpoint1", "www-someDomain-net", null, com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.cdn import CdnManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cdn
# USAGE
python custom_domains_enable_custom_https_using_cdn_managed_certificate.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CdnManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.custom_domains.begin_enable_custom_https(
resource_group_name="RG",
profile_name="profile1",
endpoint_name="endpoint1",
custom_domain_name="www-someDomain-net",
).result()
print(response)
# x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json
if __name__ == "__main__":
main()
package armcdn_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json
func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingCdnManagedCertificate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcdn.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CustomDomain = armcdn.CustomDomain{
// Name: to.Ptr("www-someDomain-net"),
// Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"),
// ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"),
// Properties: &armcdn.CustomDomainProperties{
// CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled),
// CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed),
// HostName: to.Ptr("www.someDomain.net"),
// ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")),
// ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive),
// ValidationData: to.Ptr("validationdata"),
// },
// }
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Cdn.Models;
using Azure.ResourceManager.Cdn;
// Generated from example definition: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json
// this example is just showing the usage of "CdnCustomDomains_EnableCustomHttps" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CdnCustomDomainResource created on azure
// for more information of creating CdnCustomDomainResource, please refer to the document of CdnCustomDomainResource
string subscriptionId = "subid";
string resourceGroupName = "RG";
string profileName = "profile1";
string endpointName = "endpoint1";
string customDomainName = "www-someDomain-net";
ResourceIdentifier cdnCustomDomainResourceId = CdnCustomDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName, endpointName, customDomainName);
CdnCustomDomainResource cdnCustomDomain = client.GetCdnCustomDomainResource(cdnCustomDomainResourceId);
// invoke the operation
ArmOperation<CdnCustomDomainResource> lro = await cdnCustomDomain.EnableCustomHttpsAsync(WaitUntil.Completed);
CdnCustomDomainResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CdnCustomDomainData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
POST https://management.azure.com/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customDomains/www-someDomain-net/enableCustomHttps?api-version=2024-02-01
/**
* Samples for CustomDomains EnableCustomHttps.
*/
public final class Main {
/*
* x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/
* CustomDomains_EnableCustomHttpsUsingBYOC.json
*/
/**
* Sample code: CustomDomains_EnableCustomHttpsUsingYourOwnCertificate.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
customDomainsEnableCustomHttpsUsingYourOwnCertificate(com.azure.resourcemanager.AzureResourceManager azure) {
azure.cdnProfiles().manager().serviceClient().getCustomDomains().enableCustomHttps("RG", "profile1",
"endpoint1", "www-someDomain-net", null, com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.cdn import CdnManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cdn
# USAGE
python custom_domains_enable_custom_https_using_byoc.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CdnManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.custom_domains.begin_enable_custom_https(
resource_group_name="RG",
profile_name="profile1",
endpoint_name="endpoint1",
custom_domain_name="www-someDomain-net",
).result()
print(response)
# x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json
if __name__ == "__main__":
main()
package armcdn_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json
func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingYourOwnCertificate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcdn.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CustomDomain = armcdn.CustomDomain{
// Name: to.Ptr("www-someDomain-net"),
// Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"),
// ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"),
// Properties: &armcdn.CustomDomainProperties{
// CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled),
// CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed),
// HostName: to.Ptr("www.someDomain.net"),
// ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")),
// ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive),
// ValidationData: to.Ptr("validationdata"),
// },
// }
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Cdn.Models;
using Azure.ResourceManager.Cdn;
// Generated from example definition: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json
// this example is just showing the usage of "CdnCustomDomains_EnableCustomHttps" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CdnCustomDomainResource created on azure
// for more information of creating CdnCustomDomainResource, please refer to the document of CdnCustomDomainResource
string subscriptionId = "subid";
string resourceGroupName = "RG";
string profileName = "profile1";
string endpointName = "endpoint1";
string customDomainName = "www-someDomain-net";
ResourceIdentifier cdnCustomDomainResourceId = CdnCustomDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName, endpointName, customDomainName);
CdnCustomDomainResource cdnCustomDomain = client.GetCdnCustomDomainResource(cdnCustomDomainResourceId);
// invoke the operation
ArmOperation<CdnCustomDomainResource> lro = await cdnCustomDomain.EnableCustomHttpsAsync(WaitUntil.Completed);
CdnCustomDomainResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CdnCustomDomainData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");