Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure service fabric 使用powershell创建服务结构群集时出错_Azure Service Fabric - Fatal编程技术网

Azure service fabric 使用powershell创建服务结构群集时出错

Azure service fabric 使用powershell创建服务结构群集时出错,azure-service-fabric,Azure Service Fabric,我试图在azure上创建一个服务结构集群,但当我执行 下一个脚本: #Provide the subscription Id $subscriptionId = 'yourSubscriptionId' # Certificate variables. $certpwd="Password#1234" | ConvertTo-SecureString -AsPlainText -Force $certfolder="c:\mycertificates\"

我试图在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控制台显示此错误:

广告:未设置访问策略。没有用户或应用程序具有使用此vault的访问权限。请使用Set-AzKeyVaultAccessPolicy设置访问策略

我遵循这个指南:


广告:未设置访问策略。没有用户或应用程序具有使用此vault的访问权限。请使用Set-AzKeyVaultAccessPolicy设置访问策略。

我相信您遇到了一个现有的问题。
解决方法是手动定义密钥库访问策略,以允许资源管理器在模板部署期间访问密钥库

你能帮我吗?试试这个:设置AzKeyVaultAccessPolicy-VaultName$VaultName-EnabledForDeployment非常感谢!它起作用了。总是乐于助人
# 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