New-AzureWebsite
Create a new website to run in Azure.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
New-AzureWebsite
[-Location <String>]
[-Hostname <String>]
[-PublishingUsername <String>]
[-Git]
[-GitHub]
[-GitHubCredentials <PSCredential>]
[-GitHubRepository <String>]
[-Name <String>]
[-Slot <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module.
To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version
.
The cmdlet creates a new website to run in Azure and prepares for deployment through GitHub.
Examples
Example 1: Create a new website with Git
PS C:\> New-AzureWebsite mySite -Git
This example creates a new website in Azure and a local Git repository to use for deploying files to the new website.
Example 2: Create website integrated with GitHub
PS C:\> New-AzureWebsite mysite -GitHub -GitHubRepository myaccount/myrepo
This example creates a new website linked to a GitHub repository named myaccount/myrepo. Commits to the GitHub repository are pushed to the website in Azure.
Parameters
-Git
Sets up a local Git repository and links it to the website. If specified, this parameter sets up a Git repository in the local directory and add a remote repository named 'azure' that links to the website in Azure.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-GitHub
Indicates that this cmdlet links the new website to an existing GitHub repository. Commits to the Giuthub repository are pushed to the website in Azure.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-GitHubCredentials
Specifies the user name and password credentials to connect to GitHub.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-GitHubRepository
Specifies the full name of the GitHub repository to link to this website.
For example, myaccount/myrepo
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Hostname
Specifies an alternative host name for the new website.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Location
Specifies the location of the data center where you want to deploy the website.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies a name for the website.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Profile
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublishingUsername
Specifies the user name you have specified in the Azure Portal for Git deployment.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Slot
Specifies a slot name for the website.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |