2017-06-06 12 views
0

fluent Azure Management LibraryでWebアプリケーションを作成しようとしています。Azure管理ライブラリでWebアプリケーションを作成できません

私は現在DreamSparkに登録しています。

は、ここで私はまた、azureauth.propertiesのセットアップを行っている私のProgram.cs

static void Main(string[] args) 
     { 
      // Set some variables... 
      string rgName = "numbers1102rg"; 
      string appName = SdkContext.RandomResourceName("WebApp", 20); 

      // Authenticate 
      var credentials = SdkContext.AzureCredentialsFactory 
       .FromFile(Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION")); 

      var azure = Azure 
       .Configure() 
       .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic) 
       .Authenticate(credentials) 
       .WithDefaultSubscription(); 

      // Create the web app 
      Console.WriteLine("Creating Web App..."); 
      var app = azure.WebApps.Define(appName) 
       .WithRegion(Region.USEast) 
       .WithNewResourceGroup(rgName) 
       .WithNewFreeAppServicePlan() 
       .DefineSourceControl() 
       .WithPublicGitRepository("https://github.com/Azure-Samples/app-service-web-dotnet-get-started") 
       .WithBranch("master") 
       .Attach() 
       .Create(); 
      Console.WriteLine("Your web app is live at: https://{0}", app.HostNames.First()); 

      // Wait for the user 
      Console.WriteLine("Press enter to continue..."); 
      Console.ReadLine(); 
     } 

です。 enter image description here

を私もここから貢献する手順を実行した:

https://docs.microsoft.com/en-us/dotnet/azure/dotnet-sdk-azure-get-started?view=azure-dotnet

とアプリがそのリソースへの貢献である。ここ

を作成しながら、スローエラーは、次のとおりです。 enter image description here

答えて

0

アクセストークンがフェッチされたユーザーにはpermiがないため、このエラーが発生していますssionを使用して、使用しているリソースグループにリソース(自分の場合はWebApp)を作成します。

このエラーを修正するには、使用しているリソースグループ内のそのユーザーに役割(たとえば、Contributor)を割り当ててください。

Azure Portalを使用してユーザーに役割を割り当てる方法については、このリンクを参照してください。https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-configure

+0

私が話しているアプリはすでに貢献者です。 [Here](http://imgur.com/a/FhcU1) – User1911

関連する問題