New-​Azure​Rm​Resource

Creates a resource.

Syntax

New-AzureRmResource
   [-Location <String>]
   [-ApiVersion <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-ResourceGroupName <String>]
   -ResourceType <String>
   [-Confirm]
   [-ExtensionResourceName <String>]
   [-ExtensionResourceType <String>]
   [-IsFullObject]
   [-Kind <String>]
   [-ODataQuery <String>]
   [-Plan <Hashtable>]
   [-Pre]
   [-Properties <PSObject>]
   -ResourceName <String>
   [-Sku <Hashtable>]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResource
   [-Location <String>]
   [-ApiVersion <String>]
   [-Tag <Hashtable>]
   [-Force]
   -ResourceType <String>
   [-Confirm]
   [-ExtensionResourceName <String>]
   [-ExtensionResourceType <String>]
   [-IsFullObject]
   [-Kind <String>]
   [-ODataQuery <String>]
   [-Plan <Hashtable>]
   [-Pre]
   [-Properties <PSObject>]
   -ResourceName <String>
   [-Sku <Hashtable>]
   [-TenantLevel]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResource
   [-Location <String>]
   [-ApiVersion <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-Confirm]
   [-IsFullObject]
   [-Kind <String>]
   [-ODataQuery <String>]
   [-Plan <Hashtable>]
   [-Pre]
   [-Properties <PSObject>]
   -ResourceId <String>
   [-Sku <Hashtable>]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-AzureRmResource cmdlet creates an Azure resource, such as a website, Azure SQL Database server, or Azure SQL Database, in a resource group.

Examples

Example 1: Create a resource

PS C:\>New-AzureRmResource -Location "West US" -Properties @{"test"="test"} -ResourceName "TestSite06" -ResourceType "microsoft.web/sites" -ResourceGroupName "ResourceGroup11" -Force

This command creates a resource that is a website in ResourceGroup11.

Required Parameters

-ResourceId

Specifies the fully qualified resource ID, including the subscription, as in the following example: /subscriptions/subscription ID/providers/Microsoft.Sql/servers/ContosoServer/databases/ContosoDatabase

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

Specifies the name of the resource. For instance, to specify a database, use the following format: ContosoServer/ContosoDatabase

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

Specifies the type of the resource. For instance, for a database, the resource type is as follows: Microsoft.Sql/Servers/Databases

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

Indicates that this cmdlet operates at the tenant level.

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

Optional Parameters

-ApiVersion

Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.

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

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-ExtensionResourceName

Specifies the name of an extension resource for the resource. For instance, to specify a database, use the following format: server name/database name

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

Specifies the resource type for an extension resource. For instance, if the extension resource is a database, specify the following type: Microsoft.Sql/Servers/Databases

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

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsFullObject

Indicates that the object that the Properties parameter specifies is the full object.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Kind

Specifies the resource kind for the resource.

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

Specifies the location of the resource. Specify data center location, such as Central US or Southeast Asia.You can place a resource in any location that supports resources of that type. Resource groups can contain resources from different locations. To determine which locations support each resource type, use the Get-AzureLocation cmdlet.

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

Specifies an Open Data Protocol (OData) style filter. This cmdlet appends this value to the request in addition to any other filters.

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

A hash table that represents resource plan properties.

Type:Hashtable
Aliases:PlanObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Properties

Specifies resource properties for the resource. Use this parameter to specify the values of properties that are specific to a resource type.

Type:PSObject
Aliases:PropertyObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group where this cmdlet creates the resource.

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

A hash table that represents sku properties.

Type:Hashtable
Aliases:SkuObject
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Specifies resource tags as an array of hash tables.

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
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:False
Accept pipeline input:False
Accept wildcard characters:False