< Back

New-AzureRmMediaService

Tue Jan 29, 2019 9:52 pm

NAME New-AzureRmMediaService



SYNOPSIS

Creates a media service if the media service already exists, all its properties are updated with the input provided.





SYNTAX

New-AzureRmMediaService [-ResourceGroupName] <String> [-AccountName] <String> [-Location] <String> [-StorageAccountId] <String> [-DefaultProfile

<IAzureContextContainer>] [-Tag <Hashtable>] [-Confirm] [-WhatIf] [<CommonParameters>]



New-AzureRmMediaService [-ResourceGroupName] <String> [-AccountName] <String> [-Location] <String> [-StorageAccounts] <PSStorageAccount[]>

[-DefaultProfile <IAzureContextContainer>] [-Tag <Hashtable>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The New-AzureRmMediaService cmdlet creates a media service. If the media service already exists, this cmdlet update its properties.





PARAMETERS

-AccountName <String>

Specifies the name of the media service that this cmdlet creates.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Location <String>

Specifies the region that this cmdlet creates the media service in.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group that the media service is assigned to.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountId <String>

Specifies the storage account associated with the media service account.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccounts <PSStorageAccount[]>

Specifies an array of storage accounts to associate with the media service.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tag <Hashtable>

The tags associated with the media service account.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Media.Models.PSMediaService







NOTES









Example1: Create a media service with the primary storage account only



PS C:\\># Variables

## Global

$ResourceGroupName = "ResourceGroup001"

$Location = "East US"



## Storage

$StorageName = "Storage1"

$StorageType = "Standard_GRS"



## Media Service

$Tags = @{"tag1" = "value1"; "tag2" = "value2"}

$MediaServiceName = "MediaService1"



# Resource Group

PS C:\\> New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location



# Storage

$StorageAccount = New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName -Location $Location -Type $StorageType



# Media Service

PS C:\\> New-AzureRmMediaService -ResourceGroupName $ResourceGroupName -AccountName $MediaServiceName -Location $Location -StorageAccountId

$StorageAccount.Id -Tags $Tags



This example shows how to create a media service with specifying primary storage account only. This script uses several other cmdlets.





Example 2: Create a media service with multiple storage



PS C:\\># Variables



## Global

$ResourceGroupName = "ResourceGroup001"

$Location = "East US"



## Storage

$StorageName1 = "storage1"

$StorageName2 = "storage2"

$StorageType = "Standard_GRS"



## Media Service

$Tags = @{"tag1" = "value1"; "tag2" = "value2"}

$MediaServiceName = "MediaService1"



# Resource Group

PS C:\\> New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location



# Storage

$StorageAccount1 = New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName1 -Location $Location -Type $StorageType





$StorageAccount2 = New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName2 -Location $Location -Type $StorageType



# Media Service



## Setup the storage configuration object.

PS C:\\> $PrimaryStorageAccount = New-AzureRmMediaServiceStorageConfig -StorageAccountId $StorageAccount1.Id -IsPrimary

PS C:\\> $SecondaryStorageAccount = New-AzureRmMediaServiceStorageConfig -StorageAccountId $StorageAccount2.Id

PS C:\\> $StorageAccounts = @($PrimaryStorageAccount, $SecondaryStorageAccount)



## Create a media service.New-AzureRmMediaService -ResourceGroupName $ResourceGroupName -AccountName $MediaServiceName -Location $Location

-StorageAccounts $StorageAccounts -Tags $Tags



This example shows how to create a media service with multiple storage accounts. This script uses several other cmdlets.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... diaservice

Get-AzureRmMediaService

Remove-AzureRmMediaService

Set-AzureRmMediaService