【发布时间】:2019-08-31 09:15:57
【问题描述】:
我已在 Azure 中启动并运行服务结构。我也有两个项目的 Visual Studio 解决方案:Service Fabric 和 Web Service。 我想将服务部署到 azure 中的服务结构。 当我右键单击我的服务结构项目并单击“发布”时,服务会顺利部署到云结构。我想对 PowerShell 做同样的事情。
看来我需要运行这个脚本:
# Connect to the cluster using a client certificate.
Connect-ServiceFabricCluster -ConnectionEndpoint $endpoint `
-KeepAliveIntervalInSec 10 `
-X509Credential -ServerCertThumbprint $thumbprint `
-FindType FindByThumbprint -FindValue $thumbprint `
-StoreLocation CurrentUser -StoreName My
# Copy the application package to the cluster image store.
Copy-ServiceFabricApplicationPackage $packagepath -ImageStoreConnectionString fabric:ImageStore -ApplicationPackagePathInImageStore $packagename
# Register the application type.
Register-ServiceFabricApplicationType -ApplicationPathInImageStore $packagename
# Create the service instance.
$appName = <name that I see in fabric explorer under 'typeName' in azure>
New-ServiceFabricService -ApplicationName fabric:/$appName -ServiceName fabric:/$appName/MyApp -ServiceTypeName $serviceTypeName -Stateless -PartitionSchemeSingleton -InstanceCount -1
在运行脚本之前,我右键单击我的织物应用程序并选择“包”。
我的脚本的最后一个命令因“找不到应用程序”而失败
可能缺少什么?
【问题讨论】:
-
您是否首先使用
msbuild HelloWorld.sfproj /t:Package构建了一个包?
标签: powershell azure-service-fabric