Implantando o ASP.NET na nuvem do Windows Azure, o aplicativo dá erro ao executar na nuvem
Estou tentando implantar um aplicativo ASP.NET na nuvem do Windows Azure. Estou usando a API do Google para uma das chamadas no aplicativo. Quando faço isso, recebo o seguinte erro:
System.UnauthorizedAccessException: o acesso ao caminho 'Google.Apis.Auth' foi negado.
O ASP.NET não está autorizado a acessar o recurso solicitado. Considere a concessão de direitos de acesso ao recurso para a identidade de solicitação do ASP.NET. O ASP.NET tem uma identidade de processo base (geralmente {MACHINE} \ ASPNET no IIS 5 ou Serviço de Rede no IIS 6 e IIS 7 e a identidade do conjunto de aplicativos configurado no IIS 7.5) que é usada se o aplicativo não estiver representando. Se o aplicativo estiver representando, a identidade será o usuário anônimo (normalmente IUSR_MACHINENAME) ou o usuário da solicitação autenticada.
Para conceder acesso ASP.NET a um arquivo, clique com o botão direito do mouse no arquivo no Explorador de Arquivos, escolha "Propriedades" e selecione a guia Segurança. Clique em "Adicionar" para adicionar o usuário ou grupo apropriado. Realce a conta do ASP.NET e marque as caixas para o acesso desejado.
Eu tentei pesquisar isso, mas todas as sugestões falam sobre como alterar as configurações do servidor IIS, que eu não acredito que eu tenha acesso desde que isso está sendo executado na nuvem. Alguém pode ajudar?
EDIT: aqui está o código para a função que está dando o erro:
Async Function SpecialTest() As Task(Of String)
Dim credential As UserCredential
Dim clientSecretsPath As String = Server.MapPath("~/App_Data/client_secret.json")
Dim scopes As IList(Of String) = New List(Of String)()
scopes.Add(CalendarService.Scope.Calendar)
Dim stream As FileStream = New FileStream(clientSecretsPath, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Using stream
credential = Await GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets, scopes, "user3", CancellationToken.None)
End Using
Dim baseInitializer = New BaseClientService.Initializer()
With baseInitializer
.HttpClientInitializer = credential
.ApplicationName = "P1"
End With
Dim service = New CalendarService(baseInitializer)
Dim Calendars = (Await service.CalendarList.List().ExecuteAsync()).Items()
Dim toReturn As String = "{""items"": ["
For Each firstCalendar As CalendarListEntry In Calendars
If firstCalendar IsNot Nothing Then
' Get all events from the first calendar.
Dim calEvents = Await service.Events.List(firstCalendar.Id).ExecuteAsync()
' DO SOMETHING
Dim items = calEvents.Items
'Return JsonConvert.SerializeObject(calEvents)
For Each ite As Google.Apis.Calendar.v3.Data.Event In items
If Not (ite.Location Is Nothing) And Not (ite.Start Is Nothing) Then
Dim tst = ite.Start.DateTime
toReturn = toReturn + " [""" + Date.Parse(ite.Start.DateTime).ToShortDateString + """" + "," + """" + ite.Location + """" + "," + """" + ite.Start.DateTime + """" + "," + """" + ite.Start.DateTime + """" + "," + """""],"
End If
Next
End If
Next
toReturn = toReturn.Substring(0, toReturn.Length - 1)
Return toReturn + "]}"
End Function`