Azure Service Fabric (local cluster) - can't get access to image store

senglory 1 Reputation point
2020-06-13T07:35:25.293+00:00

Hi,

I installed Service Fabric Local Cluster and now trying to get access to its image store. Per this link

I'm trying to call

Get-ServiceFabricImageStoreContent -ImageStoreConnectionString "fabric:/ImageStore"  

but get this message:

Get-ServiceFabricImageStoreContent : One or more errors occurred.
At line:1 char:1

  • Get-ServiceFabricImageStoreContent -ImageStoreConnectionString "fabri ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Get-ServiceFabricImageStoreContent], AggregateException
  • FullyQualifiedErrorId : System.AggregateException,Microsoft.ServiceFabric.Powershell.GetImageStoreContent

Ok, trying to use

Get-ServiceFabricImageStoreContent   

Getting:

Using ImageStoreConnectionString='file:C:\SfDevCluster\Data\ImageStoreShare'

StoreRelativePath Type


Store Folder [9831 files]

but when I call this:

Get-ServiceFabricImageStoreContent -ImageStoreConnectionString='file:C:\SfDevCluster\Data\ImageStoreShare'  

I get this weird message:

Get-ServiceFabricImageStoreContent : A positional parameter cannot be found that accepts argument '-ImageStoreConnectionString=file:C:\SfDevCluster\Data\ImageStoreShare'.
At line:1 char:1

  • Get-ServiceFabricImageStoreContent -ImageStoreConnectionString='file: ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidArgument: (:) [Get-ServiceFabricImageStoreContent], ParameterBindingException
  • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ServiceFabric.Powershell.GetImageStoreContent

How should I use Get-ServiceFabricImageStoreContent and ImageStoreConnectionString to get access to it?

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
252 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. BhargaviAnnadevara-MSFT 5,446 Reputation points
    2020-07-20T04:00:55.587+00:00

    Hello @senglory ,

    Powershell works by either the -param:value or -param(space)value syntax. So either of the following should work:

    Get-ServiceFabricImageStoreContent -ImageStoreConnectionString:"file:C:\SfDevCluster\Data\ImageStoreShare"
    or
    Get-ServiceFabricImageStoreContent -ImageStoreConnectionString "file:C:\SfDevCluster\Data\ImageStoreShare"

    The connection string is the above as this is a dev cluster. Azure clusters always have this set to "fabric:ImageStore".
    Although when in doubt, you can always verify the value of ImageStoreConnectionString by retrieving the Service Fabric cluster manifest for the current connection with the Get-ServiceFabricClusterManifest cmdlet.

    This should simplify it all even further:

    Get-ServiceFabricImageStoreContent -ImageStoreConnectionString (Get-ImageStoreConnectionStringFromClusterManifest(Get-ServiceFabricClusterManifest))

    Note:

    The Get-ImageStoreConnectionStringFromClusterManifest cmdlet, which is part of the Service Fabric SDK PowerShell module, is used to get the image store connection string. To import the SDK module, run:

    Import-Module "$ENV:ProgramFiles\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1"

    For additional reading, please check:

    0 comments No comments