New-AzureRmApiManagementProperty

Creates a new Property.

Syntax

New-AzureRmApiManagementProperty
   -Context <PsApiManagementContext>
   [-PropertyId <String>]
   -Name <String>
   -Value <String>
   [-Secret]
   [-Tags <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmApiManagementProperty cmdlet creates an Azure API Management Property.

Examples

Example 1: Create a property that includes tags

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>$Tags = 'sdk', 'powershell'
PS C:\> New-AzureRmApiManagementProperty -Context $apimContext -PropertyId "Property11" -Name "Property Name" -Value "Property Value" -Tags $Tags

The first command assigns two values to the $Tags variable.

The second command creates a property and assigns the strings in $Tags as tags on the property.

Example 2: Create a property that has a secret value

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>New-AzureRmApiManagementProperty -Context $apimContext -PropertyId "Property12" -Name "Secret Property -Value "Secret Property Value" -Secret

This command creates a Property that has a value that is encrypted.

Required Parameters

-Context

Specifies a PsApiManagementContext object.

Type:Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the property that this cmdlet creates. Maximum length is 100 characters. Names contain only letters, digits, period, dash, and underscore characters.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Value

Specifies a value for the property. This value can contain policy expressions. Maximum length is 1000 characters. The value may not be empty or consist only of whitespace.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PropertyId

Specifies an ID for the property. Maximum length is 256 characters. If you do not specify an ID, this cmdlet generates one.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Secret

Indicates that the property value is a secret and should be encrypted.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tags

Specifies an array of tags that this cmdlet associates to the property. You can use tags to filter the property list.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProperty