Add-AzureRmServiceEndpointPolicyDefinition

Adds a service endpoint policy definition to a specified policy.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Add-AzureRmServiceEndpointPolicyDefinition
   -Name <String>
   -ServiceEndpointPolicy <PSServiceEndpointPolicy>
   [-Description <String>]
   [-ServiceResource <System.Collections.Generic.List`1[System.String]>]
   [-Service <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Add-AzureRmServiceEndpointPolicyDefinition cmdlet add a service endpoint policy definition to the policy.

Examples

Example 1: Updates a service endpoint policy definition in a service endpoint policy

$policydef= New-AzureRmServiceEndpointPolicyDefinition -Name "ServiceEndpointPolicyDefinition1" -ResourceGroupName "ResourceGroup01" -Service "Microsoft.Storage" -ServiceResources "subscriptions/sub1" -Description "New Definition"

This command updated 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.

Parameters

-DefaultProfile

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

Type:IAzureContextContainer
Aliases: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 definition

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

-ServiceEndpointPolicy

The ServiceEndpointPolicy

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

-ServiceResource

List of service resources

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

Inputs

PSServiceEndpointPolicy

Outputs

PSServiceEndpointPolicy