Note that there are some explanatory texts on larger screens.

plurals
  1. PODeploying ASP.NET to Windows Azure cloud, application gives error when running on cloud
    primarykey
    data
    text
    <p>I am trying to deploy an ASP.NET application the Windows Azure cloud. I am using Google API for one of the calls in the application. When I do this, I get the following error:</p> <blockquote> <p>System.UnauthorizedAccessException: Access to the path 'Google.Apis.Auth' is denied.`</p> <p>ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.`</p> <p>To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.`</p> </blockquote> <p>I tried researching this, but all the suggestions talk about changing the IIS server settings, which I don't believe I have access to since this is running in the cloud. Can anyone help?</p> <p>EDIT: here is the code for the function that's giving the error:</p> <pre><code> 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` </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload