microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
382 stars 243 forks source link

Command "Setup-BcContainerTestUsers" throws an error. #3574

Open jrieraserra opened 3 months ago

jrieraserra commented 3 months ago

Describe the issue The command "Setup-BcContainerTestUsers" throws the following error:

Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (409) Conflict."
Public access is not permitted on this storage account.

From an Azure machine. Docker BC version: public 24.2 US BcContainerHelper version: 6.0.18

Scripts used to cause the issue

$defaultPassword = (ConvertTo-SecureString -String '########' -AsPlainText -Force);
$credential = New-Object pscredential '########', $defaultPassword
$containerName = "us242Cloud"

Setup-BcContainerTestUsers -containerName $containerName -Password $defaultPassword -credential $credential

Full output of script

Skipping app 'C:\Applications.US\Microsoft_Permissions Mock_24.2.20227.20579.app' as it is already installed
Skipping app 'C:\Applications.US\Microsoft_Test Runner_24.2.20227.20579.app' as it is already installed
Skipping app 'C:\Applications.US\Microsoft_Any_24.2.20227.20579.app' as it is already installed
Skipping app 'C:\Applications.US\Microsoft_Library Assert_24.2.20227.20579.app' as it is already installed
Skipping app 'C:\Applications.US\Microsoft_Permissions Mock_24.2.20227.20579.app' as it is already installed
Skipping app 'C:\Applications.US\Microsoft_Library Variable Storage_24.2.20227.20579.app' as it is already installed
TestToolkit successfully imported
Downloading C:\Users\administrador\AppData\Local\Temp\8\6465f440-5e98-47fd-9d01-5ff0bd787bd6\Microsoft_CreateTestUsers_22.0.22.0.app
Downloading using WebClient
Error downloading..., retrying in 5 seconds...
Downloading using WebClient
Publish-BcContainerApp Telemetry Correlation Id: 83ecab7f-fe29-463b-8279-bb2962d7b7f3
Setup-BcContainerTestUsers Telemetry Correlation Id: 6f4516d2-768f-44c4-8014-46e95ed7d45f
Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (409) Conflict."
Public access is not permitted on this storage account.
<?xml version="1.0" encoding="utf-8"?><Error><Code>PublicAccessNotPermitted</Code><Message>Public access is not
permitted on this storage account.
RequestId:433f70ab-001e-0059-13a4-bc1ab5000000
Time:2024-06-12T08:44:59.8941076Z</Message></Error>
At C:\Program Files\WindowsPowerShell\Modules\bccontainerhelper\6.0.11\Common\Download-File.ps1:110 char:17
+                 throw (GetExtendedErrorMessage $_)
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Exception calli...essage></Error>:String) [], RuntimeException
    + FullyQualifiedErrorId : Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an er
   ror: (409) Conflict."
Public access is not permitted on this storage account.
    <?xml version="1.0" encoding="utf-8"?><Error><Code>PublicAccessNotPermitted</Code><Message>Public access is not pe
   rmitted on this storage account.
RequestId:433f70ab-001e-0059-13a4-bc1ab5000000
Time:2024-06-12T08:44:59.8941076Z</Message></Error>

Additional context

Are we missing something?

fvet commented 3 months ago

Encountered the same issue on my local machine

Exception: C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.15\Common\Download-File.ps1:97:17
Line |
  97 |                  throw (GetExtendedErrorMessage $_)
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "GetResult" with "0" argument(s): "Response status code does not indicate        
     | success: 409 (Public access is not permitted on this storage account.)." Response status code does 
     | not indicate success: 409 (Public access is not permitted on this storage account.).
freddydk commented 3 months ago

This is fixed in 6.0.19 (currently in prerelease)