Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureWebsite

Get-AzureWebsite

microsoft.windowsazure.commands.dll

Synopsis

Gets Azure websites in the current subscription.

Syntax

Get-AzureWebsite [-Name] [-Slot] [<CommonParameters>]

Detailed Description

The Get-AzureWebsite cmdlet gets information about Azure websites in the current subscription.

By default, Get-AzureWebsite gets all Azure websites in the current subscription and returns an object that provides basic information about the sites. When you use the Name parameter, Get-AzureWebsite returns an object with extensive information, including configuration details.

The current subscription is the subscription that is designated as "current." To find the current subscription, use the Current parameter of the Get-AzureSubscription cmdlet. To change the current subscription, use the Select-AzureSubscription cmdlet.

This topic describes the cmdlet in the 0.8.2 version of the Microsoft Azure PowerShell module. To find the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.

Parameters

-Name <String>

Gets detailed configuration information about the specified website. Enter the name of one website in the subscription. By default, Get-AzureWebsite gets all websites in the current subscription. The Name value does not support wildcard characters.

Aliases

None

Required?

false

Position

1

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-Slot <String>

Gets the specified deployment slot of the website. Enter the slot name, such as "Staging" or "Production". For more information about deployment slots, see Staged Deployment on Microsoft Azure Web Sites. To add a deployment slot to an existing Azure website, use the Set-AzureWebsite cmdlet.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

Input Type

None

Return Type

Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.Site
Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.SiteWithConfig

Notes

None

Examples

Example 1: Get all websites in the subscription

This command gets all Azure websites in the current subscription.

PS C:\>Get-AzureWebsite

Example 2: Get a website by name

This command gets detailed information about the ContosoWeb Azure website, including configuration information. When you use the Name parameter, Get-AzureWebsite returns a SiteWithConfig object with extended information about the website.

PS C:\>Get-AzureWebsite -Name ContosoWeb

Example 3: Get detailed information about all websites

This command gets detailed information about all websites in the subscription. It uses a Get-AzureWebsite command to get all websites and then uses the ForEach-Object cmdlet to get each website by name.

PS C:\>Get-AzureWebsite | ForEach-Object {Get-AzureWebsite -Name $_.Name}

Example 4: Get information about a deployment slot

This command gets the Staging deployment slot of the ContosoWeb website. Deployment slots let you test different versions of your Azure website without releasing them to the public.

PS C:\>Get-AzureWebsite -Name ContosoWeb -Slot Staging

Example 5: Get website instances

The commands in this example use the Instances property of an Azure website to get information about currently running website instances. The Instances property was added to the SiteWithConfig object in version 0.8.3 of the Azure module.

The first command gets the instance IDs of all currently running instances of a website. The second command gets the number of running instances of the website. (You can use the Count property on any array.)

PS C:\>(Get-AzureWebsite -Name ContosoWeb).Instances

InstanceId
----------
2d8e712fb8f85d061c30fd793a534e6700a175f9a9ab12ca55cb3b0edfcc10ee
5834916b8cef49249b18187708223a33fbbc4352d33b48369f3166644bdd3445

PS C:\>(Get-AzureWebsite -Name ContosoWeb).Instances.Count
2

Online Version
New-AzureWebsite
Remove-AzureWebsite
Start-AzureWebsite
Stop-AzureWebsite
Show-AzureWebsite