az cdn endpoint

Manage CDN endpoints.

Commands

az cdn endpoint create Create a named endpoint to connect to a CDN.
az cdn endpoint delete Delete a CDN endpoint.
az cdn endpoint list List available endpoints for a CDN.
az cdn endpoint load Pre-load content for a CDN endpoint.
az cdn endpoint purge Purge pre-loaded content for a CDN endpoint.
az cdn endpoint show Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.
az cdn endpoint start Start a CDN endpoint.
az cdn endpoint stop Stop a CDN endpoint.
az cdn endpoint update Update a CDN endpoint to manage how content is delivered.
az cdn endpoint validate-custom-domain Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.

az cdn endpoint create

Create a named endpoint to connect to a CDN.

az cdn endpoint create --name
--origin
--profile-name
--resource-group
[--content-types-to-compress]
[--enable-compression {false, true}]
[--location]
[--no-http {false, true}]
[--no-https {false, true}]
[--origin-host-header]
[--origin-path]
[--query-string-caching {BypassCaching, IgnoreQueryString, NotSet, UseQueryString}]
[--subscription]
[--tags]

Examples

Create an endpoint to service content for hostname over HTTP or HTTPS.

az cdn endpoint create -g group -n endpoint --profile-name profile \
                            --origin www.example.com

Create an endpoint with a custom domain origin with HTTP and HTTPS ports.

az cdn endpoint create -g group -n endpoint --profile-name profile \
                            --origin www.example.com 88 4444

Create an endpoint with a custom domain with compression and only HTTPS.

az cdn endpoint create -g group -n endpoint --profile-name profile \
                            --origin www.example.com --no-http --enable-compression

Required Parameters

--name -n

Name of the CDN endpoint.

--origin

Endpoint origin specified by the following space-delimited 3 tuple: www.example.com http_port https_port. The HTTP and HTTPsports are optional and will default to 80 and 443 respectively.

--profile-name

Name of the CDN profile which is unique within the resource group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--content-types-to-compress

List of content types on which compression applies. The value should be a valid MIME type.

--enable-compression

If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB.

accepted values: false, true
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-http

Indicates whether HTTP traffic is not allowed on the endpoint. Default is to allow HTTP traffic.

accepted values: false, true
--no-https

Indicates whether HTTPS traffic is not allowed on the endpoint. Default is to allow HTTPS traffic.

accepted values: false, true
--origin-host-header

The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default.

--origin-path

A directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath.

--query-string-caching

Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.

accepted values: BypassCaching, IgnoreQueryString, NotSet, UseQueryString
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

az cdn endpoint delete

Delete a CDN endpoint.

az cdn endpoint delete --profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Delete a CDN endpoint.

az cdn endpoint delete -g group -n endpoint --profile-name profile-name

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint list

List available endpoints for a CDN.

az cdn endpoint list --profile-name
--resource-group
[--subscription]

Examples

List all endpoints within a given CDN profile.

az cdn endpoint list -g group --profile-name profile-name

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint load

Pre-load content for a CDN endpoint.

az cdn endpoint load --content-paths
--profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Pre-load Javascript and CSS content for an endpoint.

az cdn endpoint load -g group -n endpoint --profile-name profile-name --content-paths \
                            '/scripts/app.js' '/styles/main.css'

Required Parameters

--content-paths

The path to the content to be loaded. Path should be a relative file URL of the origin.

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint purge

Purge pre-loaded content for a CDN endpoint.

az cdn endpoint purge --content-paths
--profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Purge pre-loaded Javascript and CSS content.

az cdn endpoint purge -g group -n endpoint --profile-name profile-name --content-paths \
                            '/scripts/app.js' '/styles/*'

Required Parameters

--content-paths

The path to the content to be purged. Can describe a file path or a wild card directory.

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint show

Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

az cdn endpoint show --profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint start

Start a CDN endpoint.

az cdn endpoint start --profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Start a CDN endpoint.

az cdn endpoint start -g group -n endpoint --profile-name profile-name

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint stop

Stop a CDN endpoint.

az cdn endpoint stop --profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Stop a CDN endpoint.

az cdn endpoint stop -g group -n endpoint --profile-name profile-name

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az cdn endpoint update

Update a CDN endpoint to manage how content is delivered.

az cdn endpoint update --profile-name
[--add]
[--content-types-to-compress]
[--enable-compression {false, true}]
[--force-string]
[--ids]
[--name]
[--no-http {false, true}]
[--no-https {false, true}]
[--origin-host-header]
[--origin-path]
[--query-string-caching {BypassCaching, IgnoreQueryString, NotSet, UseQueryString}]
[--remove]
[--resource-group]
[--set]
[--subscription]
[--tags]

Examples

Turn off HTTP traffic for an endpoint.

az cdn endpoint update -g group -n endpoint --profile-name profile --no-http

Enable content compression for an endpoint.

az cdn endpoint update -g group -n endpoint --profile-name profile \
                            --enable-compression

Required Parameters

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--content-types-to-compress

List of content types on which compression applies. The value should be a valid MIME type.

--enable-compression

If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB.

accepted values: false, true
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--no-http

Indicates whether HTTP traffic is not allowed on the endpoint. Default is to allow HTTP traffic.

accepted values: false, true
--no-https

Indicates whether HTTPS traffic is not allowed on the endpoint. Default is to allow HTTPS traffic.

accepted values: false, true
--origin-host-header

The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default.

--origin-path

A directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath.

--query-string-caching

Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.

accepted values: BypassCaching, IgnoreQueryString, NotSet, UseQueryString
--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

az cdn endpoint validate-custom-domain

Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.

az cdn endpoint validate-custom-domain --host-name
--profile-name
[--ids]
[--name]
[--resource-group]
[--subscription]

Required Parameters

--host-name

The host name of the custom domain. Must be a domain name.

--profile-name

Name of the CDN profile which is unique within the resource group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the CDN endpoint.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.