使用Powershell创建Service Fabric群集错误

时间:2019-06-06 19:38:13

标签: azure-service-fabric

我正在执行托盘操作以在Azure上创建服务结构集群,但是在执行时 下一个脚本:

   #Provide the subscription Id
   $subscriptionId = 'yourSubscriptionId'

   # Certificate variables.
   $certpwd="Password#1234" | ConvertTo-SecureString -AsPlainText -Force
   $certfolder="c:\mycertificates\"

   # Variables for VM admin.
   $adminuser="vmadmin"
   $adminpwd="Password#1234" | ConvertTo-SecureString -AsPlainText -Force 

   # Variables for common values
   $clusterloc="SouthCentralUS"
   $clustername = "mysfcluster"
   $groupname="mysfclustergroup"       
   $vmsku = "Standard_D2_v2"
   $vaultname = "mykeyvault"
   $subname="$clustername.$clusterloc.cloudapp.azure.com"

   # Set the number of cluster nodes. Possible values: 1, 3-99
   $clustersize=5 

   # Set the context to the subscription Id where the cluster will be created
   Select-AzSubscription -SubscriptionId $subscriptionId

   # Create the Service Fabric cluster.
   New-AzServiceFabricCluster -Name $clustername -ResourceGroupName $groupname -  Location $clusterloc `
-  ClusterSize $clustersize -VmUserName $adminuser -VmPassword $adminpwd 
-  CertificateSubjectName $subname `
-  CertificatePassword $certpwd -CertificateOutputFolder $certfolder `
-  OS WindowsServer2016DatacenterwithContainers -VmSku $vmsku -KeyVaultName                                       
   $vaultname

powershell控制台显示此错误:

ADVERTENCIA:未设置访问策略。没有用户或应用程序有权使用此保管库。请使用Set -AzKeyVaultAccessPolicy设置访问策略。

我正在遵循此指南:https://docs.microsoft.com/es-es/azure/service-fabric/service-fabric-quickstart-containers#feedback

# Create the Service Fabric cluster.
   New-AzServiceFabricCluster -Name $clustername -ResourceGroupName $groupname -  Location $clusterloc `
-  ClusterSize $clustersize -VmUserName $adminuser -VmPassword $adminpwd 
-  CertificateSubjectName $subname `
-  CertificatePassword $certpwd -CertificateOutputFolder $certfolder `
-  OS WindowsServer2016DatacenterwithContainers -VmSku $vmsku -KeyVaultName                                       
   $vaultname

ADVERTENCIA:未设置访问策略。没有用户或应用程序有权使用此保管库。请使用Set -AzKeyVaultAccessPolicy设置访问策略。

1 个答案:

答案 0 :(得分:1)

我相信您正在遇到现有的issue。 解决方法是手动定义Key Vault访问策略,以允许资源管理器在模板部署期间访问Key Vault。