jhealy / awesome

My set of links I can't throw away. Slow migration from dfwiki. may be its own wiki again one day.
MIT License
52 stars 12 forks source link

teams config fails with parameter cannot be found that matches param access key #1

Closed jhealy closed 4 years ago

jhealy commented 4 years ago

Basic run as follows, crdentials modified....

Error output:

PS C:\dev\psbot> .\teamswolframconfig.ps1 Beginning config, good luck.... dumping config for visual check

Name                           Value
----                           -----
AccessKey                      System.Security.SecureString
AccessKeyName                  receive
Credential                     System.Management.Automation.PSCredential
TeamId                         19:43d265f6f9684d2bbb368ef7478cc864@thread.tacv
Name                           dfposhbot
QueueName                      messages
ServiceBusNamespace            dfposhbot.servicebus.windows.net
BotName                        dfposhbot

New-PoshBotConfiguration : A parameter cannot be found that matches parameter name 'AccessKey'.
At C:\dev\psbot\teamswolframconfig.ps1:55 char:37
+ $backend = New-PoshBotConfiguration @backendConfig
+                                     ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-PoshBotConfiguration], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-PoshBotConfiguration

The following code yields this. Can't quite seem to figure this one out. Any ideas? Better spot to post this?

$pbc = New-PoshBotConfiguration
$pbc.BotAdmins = @('jhealy@contoso.com')

$backendConfig = @{
    Name                = 'dfpshbot'
    BotName             = 'dfpshbot'
    TeamId              = '19:43d265bbb368ef7478cc864@thread.tacv'
    ServiceBusNamespace = 'dfpshbot.servicebus.windows.net'
    QueueName           = 'messages'
    AccessKeyName       = 'receive'
    AccessKey           = 'gBkaSP31RWZC4M+aMph5j3U05MvVaxaNz0=' | ConvertTo-SecureString -AsPlainText -Force
    Credential          = [pscredential]::new(
    '2f94917f-675b-4dc3fbf4ee6c1',
    ('FTf9@g.Oe01yDyTYD:c@l' | ConvertTo-SecureString -AsPlainText -Force))
}

Write-Host 'dumping config for visual check'
Write-Host ($backendConfig | Format-Table | Out-String)
$backend = New-PoshBotConfiguration @backendConfig

Thanks

Sam-Rowe commented 4 years ago

@jhealy I don't know about the teamswolfframconfig.ps1 but the error

New-PoshBotConfiguration : A parameter cannot be found that matches parameter name 'AccessKey'

would suggest to me it isn't expecting a config key called AccessKey.

https://github.com/poshbotio/PoshBot/blob/cc0d5116556d9abb1efd868a1a2f5d5d67603ae1/PoshBot/Classes/BotConfiguration.ps1 doesn't have Access Key in the hash table.

However I could be barking up the wrong tree?

jhealy commented 4 years ago

I think you're right, AccessKey isn't in there. But the instructions for configuring teams shows using an AccessKey at the "Create PoshBot Startup Script" section in https://poshbot.readthedocs.io/en/latest/guides/backends/setup-teams-backend/ .

I'm probably missing something on how to get it going with a teams backend.

jhealy commented 4 years ago

wrong repo, move to poshbotio repo.