Closed filcole closed 2 years ago
It looks like there's maybe a requirement to supply the Code, Name and Symbol parameters, as per the PowerShell documents, but it's unclear what syntax is required when used with pac, or if it's a bug with pac.
A fiddler trace of pac shows only the code parameter being sent
POST https://api.bap.microsoft.com//providers/Microsoft.BusinessAppPlatform/environments/046d00c3-XXXX-XXXX-XXXX-f0f4a56dfb08/reset?api-version=2020-08-01 HTTP/1.1
Authorization: Bearer XXXXX
User-Agent: pac/1.0 (win; Microsoft PowerPlatform CLI; 1.14.2+g7205df7)
Content-Type: application/json; charset=utf-8
Host: api.bap.microsoft.com
Content-Length: 130
Expect: 100-continue
{"BaseLanguageCode":1033,"Currency":{"Code":"GBP"},"DomainName":null,"FriendlyName":null,"Purpose":null,"Templates":[]}
Using Reset-PowerAppEnvironment via Powershell https://docs.microsoft.com/en-us/powershell/module/microsoft.powerapps.administration.powershell/reset-powerappenvironment?view=pa-ps-latest is sending the currency as follows (with Code, Name & Symbol).
POST https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/046d00c3-XXXX-XXXX-XXXX-XXXXXXXXXXXX/reset?api-version=2019-05-01 HTTP/1.1
Authorization: Bearer [...snip...]
User-Agent: PowerShell cmdlets 1.0
Content-Type: application/json; charset=utf-8
Host: api.bap.microsoft.com
Content-Length: 437
{
"FriendlyName": "My Friendly Name",
"DomainName": "mydomainname",
"Purpose": "My purpopse",
"BaseLanguageCode": "1033",
"Currency": {
"Code": "GBP",
"Name": "GBP",
"Symbol": "£"
},
"Templates": []
}
@filcole thanks for both reporting and analyzing! We're figuring out if there's an API change that has caused this to regress :-( ? There's a similar error when specifying --language
Our internal tracking error: AB#2691378
The fix has been rolled out with PAC v1.16.6 / powerplatform-vscode v1.0.16 in #216
When the
--currency
property is specified for thepac admin reset
command an error is output, e.g.it also occurs when the default USD currency is used
Resetting the environment without the --currency flag works, but the currency in the reset environment is always USD.