Closed GaneshKumarPandithurai closed 6 months ago
I am trying to establish a connection with MS Partner Center using StoreBroker module. Here is my code:
$AzureADtenantId = "xxxxxxxxxxx" $ClientID = "yyyyyyyyyyyyyyyyyy" [ValidateNotNullOrEmpty()]$Key = 'zzzzzzzzzzzzzzzzzzzzz' $Key = ConvertTo-SecureString -String $Key -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential($ClientID,$Key) Set-StoreBrokerAuthentication -TenantId $AzureADtenantId -Credential $cred Try { Get-Applications -GetAll | Where-Object primaryName -like "*AAAAAAAA*" | Format-Application } catch { write-host "Error: $($_.Exception.Message)" -foregroundcolor Red }
I am using a valid client ID/secret however getting below as output so looking for your help to resolve this:
| Elapsed: 0 second(s) [Getting access token]/ Elapsed: 0 second(s) [Getting access token]- Elapsed: 0 second(s) [Getting access token]\ Elapsed: 0 second(s) [Getting access token]| Elapsed: 0 second(s) [Getting access token]/ Elapsed: 1 second(s) [Getting access token]- Elapsed: 1 second(s) [Getting access token]\ Elapsed: 1 second(s) [Getting access token]| Elapsed: 1 second(s) [Getting access token]/ Elapsed: 1 second(s) [Getting access token]DONE (FAILED) - Operation took 1 second(s) [Getting access token] Write-Log : 2024-01-04 15:39:40 : XXXX : Be sure to check that your client id/secret are valid. The remote server returned an error: (500) Internal Server Error. : At C:\Program Files\WindowsPowerShell\Modules\StoreBroker\1.21.0\StoreBroker\StoreIngestionApi.psm1:556 char:9 Write-Log -Message $newLineOutput -Level Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log_ Error: Be sure to check that your client id/secret are valid. The remote server returned an error: (500) Internal Server Error.
@GaneshKumarPandithurai - You need to make sure that:
It seems like if you've done 1, then maybe your issue is 2.
I am trying to establish a connection with MS Partner Center using StoreBroker module. Here is my code:
I am using a valid client ID/secret however getting below as output so looking for your help to resolve this: