The following code works without any error while I am trying to create a new action group to use with new Alert in Azure Monitor.
import-module Az.Monitor
#Setting up action group
$emailaddress = '[email protected]'
$phoneNumber = '1234567890'
$emailDBA = New-AzActionGroupReceiver -Name 'emailDBA' -EmailAddress $emailaddress
$smsDBA = New-AzActionGroupReceiver -Name 'smsDBA' -SmsReceiver -CountryCode '1' -PhoneNumber $phoneNumber
Set-AzActionGroup `
-Name 'notifydbadeadlock' `
-ResourceGroupName $resourceGroupName `
-ShortName 'deadlock' `
-Receiver $emailDBA,$smsDBA
As per the documentation, I should also be able to add voicemail by using the following code.
$phoneDBA = New-AzActionGroupReceiver -Name 'phoneDBA' -VoiceCountryCode '1' -VoicePhoneNumber $phoneNumber -VoiceReceiver
I get an error message.
New-AzActionGroupReceiver : A parameter cannot be found that matches parameter name 'VoiceCountryCode'. At line:1 char:56 + ... New-AzActionGroupReceiver -Name 'phoneDBA' -VoiceCountryCode '1' -Vo ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-AzActionGroupReceiver], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.Insights.ActionGroups.NewAzureRmActionGroupReceiverCommand
I did update the module Az.Monitor
.
How can I solve this?