你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzServiceEndpointPolicyDefinition

Creates a service endpoint policy definition.

Syntax

New-AzServiceEndpointPolicyDefinition
   -Name <String>
   [-Description <String>]
   [-ServiceResource <String[]>]
   [-Service <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzServiceEndpointPolicyDefinition cmdlet create a service endpoint policy definition.

Examples

Example 1: Creates a service endpoint policy

$policydef= New-AzServiceEndpointPolicyDefinition -Name "ServiceEndpointPolicyDefinition1" -Service "Microsoft.Storage" -ServiceResource "subscriptions/sub1" -Description "New Definition"

This command creates the service endpoint policy definition with name ServiceEndpointPolicyDefinition1, service Microsoft.Storage, service resources subscriptions/sub1 and description "New Definition" that belongs to the resource group named ResourceGroup01 and stores it in the $policydef variable.

Example 2

Creates a service endpoint policy definition. (autogenerated)

New-AzServiceEndpointPolicyDefinition -Description 'New Definition' -Name 'ServiceEndpointPolicyDefinition1' -Service 'Microsoft.Storage' -ServiceResource <String[]>

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

The description of the definition

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the service endpoint policy

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Service

Name of the service

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServiceResource

List of service resources

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSServiceEndpointPolicyDefinition