According to the documentation https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/create-visual-studio-deployment-project, everything seems ok. The Azure resources are deployed. But at the last step, when the package.zip is uploaded to the web app, it failed. However, the package.zip is uploaded to the blob successfully. Looks like package.zip cannot be downloaded.
Struggled and tried many times but failed. Anyone can help?
The entire error is as below:
16:26:10 - New-AzureRmResourceGroupDeployment : 4:26:10 PM - Resource Microsoft.Web/sites/extensions
16:26:10 - 'webSiteqx6gdnwigzamg/MSDeploy' failed with message '{
16:26:10 - "status": "failed",
16:26:10 - "error": {
16:26:10 - "code": "ResourceDeploymentFailure",
16:26:10 - "message": "The resource operation completed with terminal provisioning state 'failed'.",
16:26:10 - "details": [
16:26:10 - {
16:26:10 - "code": "Failed",
16:26:10 - "message": "Failed to download package.\r\nARM-MSDeploy Deploy Failed: 'System.AggregateException: One or more
16:26:10 - errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n at
16:26:10 - System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at
16:26:10 - System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)\r\n at
16:26:10 - System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)\r\n --- End of inner exception stack trace
16:26:10 - ---\r\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at
16:26:10 - System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n at
16:26:10 - System.Threading.Tasks.Task.Wait(TimeSpan timeout)\r\n at
16:26:10 - Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__13.MoveNext()\r\n--- End of stack trace from
16:26:10 - previous location where exception was thrown ---\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at
16:26:10 - Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__11.MoveNext()\r\n--- End of stack trace from
16:26:10 - previous location where exception was thrown ---\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at
16:26:10 - Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadPackageAndSettings>d__26.MoveNext()\r\n--- End of
16:26:10 - stack trace from previous location where exception was thrown ---\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at
16:26:10 - System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at
16:26:10 - Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadAndDeployPackage>d__25.MoveNext()\r\n--->
16:26:10 - (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n at
16:26:10 - System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at
16:26:10 - System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)\r\n at
16:26:10 - System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---\r\n'"
16:26:10 - }
16:26:10 - ]
16:26:10 - }
16:26:10 - }'
16:26:10 - At D:\source\project\luxu_source\energysolution\DeepMCDeploy\bin\Debug\staging\DeepMCDeploy\Deploy-AzureResourceGroup.p
16:26:10 - s1:110 char:5
16:26:10 - + New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $Templat ...
16:26:10 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:26:10 - + CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
16:26:10 - + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
16:26:10 - loymentCmdlet
16:26:10 -
16:26:10 - New-AzureRmResourceGroupDeployment : 4:26:10 PM - Failed to download package.
16:26:10 - ARM-MSDeploy Deploy Failed: 'System.AggregateException: One or more errors occurred. ---> System.Net.WebException:
16:26:10 - The remote server returned an error: (404) Not Found.
16:26:10 - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
16:26:10 - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
16:26:10 - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
16:26:10 - --- End of inner exception stack trace ---
16:26:10 - at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
16:26:10 - at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
16:26:10 - at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
16:26:10 - at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__13.MoveNext()
16:26:10 - --- End of stack trace from previous location where exception was thrown ---
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:10 - at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__11.MoveNext()
16:26:10 - --- End of stack trace from previous location where exception was thrown ---
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:10 - at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadPackageAndSettings>d__26.MoveNext()
16:26:10 - --- End of stack trace from previous location where exception was thrown ---
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:10 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:10 - at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadAndDeployPackage>d__25.MoveNext()
16:26:10 - ---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.
16:26:10 - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
16:26:10 - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
16:26:10 - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---
16:26:10 - '
16:26:10 - At D:\source\project\luxu_source\energysolution\DeepMCDeploy\bin\Debug\staging\DeepMCDeploy\Deploy-AzureResourceGroup.p
16:26:10 - s1:110 char:5
16:26:10 - + New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $Templat ...
16:26:10 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:26:10 - + CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
16:26:10 - + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
16:26:10 - loymentCmdlet
16:26:10 -
16:26:10 - New-AzureRmResourceGroupDeployment : 4:26:10 PM - Template output evaluation skipped: at least one resource deployment
16:26:10 - operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage
16:26:10 - details.
16:26:10 - At D:\source\project\luxu_source\energysolution\DeepMCDeploy\bin\Debug\staging\DeepMCDeploy\Deploy-AzureResourceGroup.p
16:26:10 - s1:110 char:5
16:26:10 - + New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $Templat ...
16:26:10 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:26:10 - + CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
16:26:10 - + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
16:26:10 - loymentCmdlet
16:26:10 -
16:26:10 - New-AzureRmResourceGroupDeployment : 4:26:10 PM - Template output evaluation skipped: at least one resource deployment
16:26:10 - operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage
16:26:10 - details.
16:26:10 - At D:\source\project\luxu_source\energysolution\DeepMCDeploy\bin\Debug\staging\DeepMCDeploy\Deploy-AzureResourceGroup.p
16:26:10 - s1:110 char:5
16:26:10 - + New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $Templat ...
16:26:10 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:26:10 - + CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
16:26:10 - + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
16:26:10 - loymentCmdlet
16:26:10 -
16:26:11 -
16:26:11 - DeploymentName : website-0421-0824
16:26:11 - CorrelationId : 31181e33-d16c-48e6-8c14-3880ce240036
16:26:11 - ResourceGroupName : energysolutionRG
16:26:11 - ProvisioningState : Failed
16:26:11 - Timestamp : 4/21/2021 8:26:09 AM
16:26:11 - Mode : Incremental
16:26:11 - TemplateLink :
16:26:11 - TemplateLinkString :
16:26:11 - DeploymentDebugLogLevel :
16:26:11 - Parameters : {[hostingPlanName,
16:26:11 - Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.DeploymentVariable], [skuName,
16:26:11 - Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.DeploymentVariable],
16:26:11 - [skuCapacity,
16:26:11 - Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.DeploymentVariable], [energyType,
16:26:11 - Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.DeploymentVariable]...}
16:26:11 - ParametersString :
16:26:11 - Name Type Value
16:26:11 - =============== ========================= ==========
16:26:11 - hostingPlanName String DeepMCPlan
16:26:11 - skuName String S1
16:26:11 - skuCapacity Int 1
16:26:11 - energyType String Standard_LRS
16:26:11 - _artifactsLocation String
16:26:11 - https://energyqx6gdnwigzamg.blob.core.windows.net/energysolutionrg-stageartifacts/
16:26:11 - _artifactsLocationSasToken SecureString
16:26:11 - webApplication1PackageFolder String WebApplication1
16:26:11 - webApplication1PackageFileName String package.zip
16:26:11 -
16:26:11 - Outputs :
16:26:11 - OutputsString :
16:26:11 -
16:26:12 -
16:26:12 - Template deployment returned the following errors:
16:26:12 - 4:26:10 PM - Resource Microsoft.Web/sites/extensions 'webSiteqx6gdnwigzamg/MSDeploy' failed with message '{
16:26:12 - "status": "failed",
16:26:12 - "error": {
16:26:12 - "code": "ResourceDeploymentFailure",
16:26:12 - "message": "The resource operation completed with terminal provisioning state 'failed'.",
16:26:12 - "details": [
16:26:12 - {
16:26:12 - "code": "Failed",
16:26:12 - "message": "Failed to download package.\r\nARM-MSDeploy Deploy Failed: 'System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)\r\n at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)\r\n --- End of inner exception stack trace ---\r\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n at System.Threading.Tasks.Task.Wait(TimeSpan timeout)\r\n at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadPackageAndSettings>d__26.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadAndDeployPackage>d__25.MoveNext()\r\n---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)\r\n at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---\r\n'"
16:26:12 - }
16:26:12 - ]
16:26:12 - }
16:26:12 - }'
16:26:12 - 4:26:10 PM - Failed to download package.
16:26:12 - ARM-MSDeploy Deploy Failed: 'System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
16:26:12 - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
16:26:12 - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
16:26:12 - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
16:26:12 - --- End of inner exception stack trace ---
16:26:12 - at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
16:26:12 - at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
16:26:12 - at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
16:26:12 - at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__13.MoveNext()
16:26:12 - --- End of stack trace from previous location where exception was thrown ---
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:12 - at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.<Download>d__11.MoveNext()
16:26:12 - --- End of stack trace from previous location where exception was thrown ---
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:12 - at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadPackageAndSettings>d__26.MoveNext()
16:26:12 - --- End of stack trace from previous location where exception was thrown ---
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
16:26:12 - at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
16:26:12 - at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadAndDeployPackage>d__25.MoveNext()
16:26:12 - ---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.
16:26:12 - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
16:26:12 - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
16:26:12 - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---
16:26:12 - '
16:26:12 - 4:26:10 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
16:26:12 - 4:26:10 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
16:26:12 -
16:26:12 -
16:26:12 - Deploying template using PowerShell script failed.
16:26:12 - Tell us about your experience at https://go.microsoft.com/fwlink/?LinkId=691202
Related
I have enabled private endpoint for iot hub and azure storage account and restricted the public traffic, when i am uploading a file it gets uploaded successfully but when calling CompleteFileUploadAsync method of device client i am getting error 403 as forbidden. But when passing the IsSuccess = false its working with current configuration, i changed the Allow access from to "All networks" then its working.
I want to make sure that its notifying within private network when file uploaded successfully as its working when file upload fails.
Code:
private static async Task SendToBlobAsync(DeviceClient deviceClient, string fileName)
{
Console.WriteLine("Uploading file: {0}", fileName);
var watch = System.Diagnostics.Stopwatch.StartNew();
var sas = await deviceClient.GetFileUploadSasUriAsync(new FileUploadSasUriRequest { BlobName = fileName });
var blob = new CloudBlockBlob(sas.GetBlobUri());
await blob.UploadFromFileAsync(fileName);
await deviceClient.CompleteFileUploadAsync(new FileUploadCompletionNotification { CorrelationId = sas.CorrelationId, IsSuccess = true });
watch.Stop();
Console.WriteLine("Time to upload file: {0}ms\n", watch.ElapsedMilliseconds);
}
The method throwing the below error message :
{
"Message":"{\"errorCode\":400020,\"trackingId\":\"72f35ff2b08f4312bc0e9f9d36be1061-G:0-TimeStamp:02/23/2021 14:24:46\",\"message\":\"BadRequest\",\"timestampUtc\":\"2021-02-23T14:24:46.3420546Z\"}",
"ExceptionMessage":"ErrorCode: InvalidStorageEndpointOrBlob\r\nMessage: Storage endpoint '$default' or blob name device001/image.jpg is invalid\r\nTimestamp: 02/23/2021 14:24:46\r\nTracking ID: 72f35ff2b08f4312bc0e9f9d36be1061-G:0-TimeStamp:02/23/2021 14:24:46\r\nPublic Message: \r\nPublic Info: null\r\nException: Microsoft.Azure.Devices.Common.Core.Exceptions.IotHubException: Storage endpoint '$default' or blob name device001/image.jpg is invalid ---> Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.\r\n at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)\r\n at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass22.<FetchAttributesImpl>b__21(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)\r\n at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)\r\n --- End of inner exception stack trace ---\r\n at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)\r\n at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass7.<CreateCallbackVoid>b__5(IAsyncResult ar)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.FileUpload.IotHubFileUploadManager.<GenerateFileUploadNotificationAsync>d__10.MoveNext() in C:\\source\\gateway\\runtime\\FileUpload\\IotHubFileUploadManager.cs:line 153\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Azure.Devices.Gateway.Runtime.FileUpload.IotHubFileUploadManager.<GenerateFileUploadNotificationAsync>d__10.MoveNext() in C:\\source\\gateway\\runtime\\FileUpload\\IotHubFileUploadManager.cs:line 180\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.Http.HttpRuntimeProvider.<UpdateAndNotifyFileUploadStatusAsync>d__41.MoveNext() in C:\\source\\gateway\\runtime\\Http\\HttpRuntimeProvider.cs:line 1215\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.Http.HttpRuntimeActionResult`1.<ExecuteAsync>d__7.MoveNext() in C:\\source\\gateway\\mgmt\\Http\\HttpRuntimeActionResult.cs:line 153\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.ActionFilters.GlobalActionFilter.<ExecuteActionFilterAsync>d__0.MoveNext() in C:\\source\\gateway\\mgmt\\ActionFilters\\GlobalActionFilter.cs:line 42\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()",
"ExceptionType":"Microsoft.Azure.Devices.Common.Core.Exceptions.IotHubException",
"StackTrace":" at Microsoft.Azure.Devices.Gateway.Runtime.FileUpload.IotHubFileUploadManager.<GenerateFileUploadNotificationAsync>d__10.MoveNext() in C:\\source\\gateway\\runtime\\FileUpload\\IotHubFileUploadManager.cs:line 180\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.Http.HttpRuntimeProvider.<UpdateAndNotifyFileUploadStatusAsync>d__41.MoveNext() in C:\\source\\gateway\\runtime\\Http\\HttpRuntimeProvider.cs:line 1215\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.Http.HttpRuntimeActionResult`1.<ExecuteAsync>d__7.MoveNext() in C:\\source\\gateway\\mgmt\\Http\\HttpRuntimeActionResult.cs:line 153\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.ActionFilters.GlobalActionFilter.<ExecuteActionFilterAsync>d__0.MoveNext() in C:\\source\\gateway\\mgmt\\ActionFilters\\GlobalActionFilter.cs:line 42\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()",
"InnerException":{
"Message":"An error has occurred.",
"ExceptionMessage":"The remote server returned an error: (403) Forbidden.",
"ExceptionType":"Microsoft.WindowsAzure.Storage.StorageException",
"StackTrace":" at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)\r\n at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass7.<CreateCallbackVoid>b__5(IAsyncResult ar)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Runtime.FileUpload.IotHubFileUploadManager.<GenerateFileUploadNotificationAsync>d__10.MoveNext() in C:\\source\\gateway\\runtime\\FileUpload\\IotHubFileUploadManager.cs:line 153",
"InnerException":{
"Message":"An error has occurred.",
"ExceptionMessage":"The remote server returned an error: (403) Forbidden.",
"ExceptionType":"System.Net.WebException",
"StackTrace":" at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)\r\n at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass22.<FetchAttributesImpl>b__21(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)\r\n at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)"
}
}
}
I have already created the server and I am using the following code:
New-AzureRmSqlElasticPool -ResourceGroupName $resourcegroupname -ServerName $servername -ElasticPoolName "ElasticPool071" -VCore 1 -Edition "GeneralPurpose" -ComputeGeneration "Gen5" -InformationVariable ee -debug -ErrorVariable ErrorMessages
the ouput I am recieving is>>
Set-AzureRmSqlElasticPool : An unexpected error occured while processing the request. Tracking ID: 'a2936090-e7af-4203-be1c-9425932055f3'
At line:1 char:2
+ Set-AzureRmSqlElasticPool -ResourceGroupName $resourcegroupname -Se ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmSqlElasticPool], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.ElasticPool.Cmdlet.SetAzureSqlElasticPool
DEBUG: AzureQoSEvent: CommandName - Set-AzureRmSqlElasticPool; IsSuccess - False; Duration - 00:00:26.8490006; Exception - Microsoft.Rest.Azure.CloudException: An unexpected error occured while processing the request. Tracking ID: 'a2936090-e7af-
4203-be1c-9425932055f3'
at Microsoft.Azure.Management.Sql.ElasticPoolsOperations.<BeginUpdateWithHttpMessagesAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.ElasticPoolsOperations.<UpdateWithHttpMessagesAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.ElasticPoolsOperationsExtensions.<UpdateAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.ElasticPoolsOperationsExtensions.Update(IElasticPoolsOperations operations, String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdate parameters)
at Microsoft.Azure.Commands.Sql.ElasticPool.Services.AzureSqlElasticPoolAdapter.UpsertElasticPool(AzureSqlElasticPoolModel model)
at Microsoft.Azure.Commands.Sql.ElasticPool.Cmdlet.SetAzureSqlElasticPool.PersistChanges(IEnumerable`1 entity)
at Microsoft.Azure.Commands.Sql.Common.AzureSqlCmdletBase`2.<>c__DisplayClass16_0.<ExecuteCmdlet>b__0()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction(String processMessage, String target, Action action)
at Microsoft.Azure.Commands.Sql.Common.AzureSqlCmdletBase`2.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
Could you please help!?
For Gen 5 Compute Generation, you must allocate a minimum of 2 vCores. For Gen 4 you can allocate 1 vCore.
Azure SQL Database vCore-based purchasing model limits for elastic pools
SQL Database pricing options
I am using EventProcessorHost in webjob with multiple instances - giving exception Microsoft.ServiceBus.Messaging.LeaseLostException. Perticularly only one instance is giving this exception.
It is not giving any exception when I am running it as single instances
Microsoft.ServiceBus.Messaging.LeaseLostException: Exception of type 'Microsoft.ServiceBus.Messaging.LeaseLostException' was thrown. ---> Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (409) Conflict. ---> System.Net.WebException: The remote server returned an error: (409) Conflict.
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass33.<RenewLeaseImpl>b__32(RESTCommand1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 3186
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 299
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.EndRenewLease(IAsyncResult asyncResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 1982
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.b__3(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:line 114
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__23.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RoutingServiceWebJob.DataProcessorFactory.EventHubDataProcessor.d__37.MoveNext() in d:\a\1\s\RoutingServiceWebJob\DataProcessorFactory\EventHubDataProcessor.cs:line 163
I am reading messages one at a time. Please suggest.
I was able to avoid this by setting the Host name to be a unique string. For example
var eventProcessorHostName = Guid.NewGuid().ToString();
I got an exception of Microsoft.ServiceBus.Messaging.LeaseLostException, in my EventHub processor.
what does this exception mean? What is the possible root cause of this exception?
Following are stack track:
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__25.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at MyEventHub.EventProcessor`1.d__6.MoveNext()\r\n\r\nMicrosoft.WindowsAzure.Storage.StorageException : \"The remote server returned an error: (409) Conflict.\":
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 60\r\n
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.b__3(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:line 115\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\r\n\r\nSystem.Net.WebException : \"The remote server returned an error: (409) Conflict.\":
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase1 cmd, Exception ex) in c:\\Program Files (x86)\\Jenkins\\workspace\\release_dotnet_master\\Lib\\Common\\Shared\\Protocol\\HttpResponseParsers.Common.cs:line 50\r\n
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass33.<RenewLeaseImpl>b__32(RESTCommand1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 3186\r\n
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 306"
And the only internal exception in my own code is:
at MyEventHub.EventProcessor`1.<< CloseAsync >> d__6.MoveNext()\r\n\r\nMicrosoft.WindowsAzure.Storage.StorageException : \"The remote server returned an error: (409) Conflict.\":
...
And here is the code of CloseAsync:
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
try
{
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
catch (Exception ex)
{
this.HandleException(ex);
}
finally
{
this.configuration.DecrementOpenedPartitionCount?.Invoke();
}
}
MyEventHub is hosted in worker role which deployed 2 instance in Azure.
#Youxu , for your EventHub, how many receivers ( EventProcessorHost ) are configured?. As per my knowledge we can have only one active receiver with certain epoch. If we create a EventHub listener ( with default options) while one listener is already listing to a EventHub, newly created listener gets higher epoch and first listener gets disconnected due to LeaseLostException
Check if you are (accidentally) running more than one receiver for same EventHub concurrently.
I have an IdentityServer3 server setup and it's configured to use Entity Framework for getting client and scope information from the database.
When I add a new scope to the database (dbo.Scopes) if ShowInDiscoveryDocument = 0 then all is well and the well-known document loads correctly. However, if ShowInDiscoveryDocument = 1 then I get the following error:
Message: "An error has occurred.",
ExceptionMessage: "The type initializer for 'IdentityServer3.EntityFramework.Entities.EntitiesMap' threw an exception.",
ExceptionType: "System.TypeInitializationException",
StackTrace: " at IdentityServer3.EntityFramework.Entities.EntitiesMap.ToModel(Scope s) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at IdentityServer3.Core.Endpoints.DiscoveryEndpointController.d__11.MoveNext() in
c:\local\identity\server3\IdentityServer3\source\Core\Endpoints\Connect\DiscoveryEndpointController.cs:line 89 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.System.Web.Http908956.TaskHelpersExtensions.d__3`1.MoveNext() in c:\local\identity\server3\IdentityServer3\source\Core\Validation\ScopeValidator.cs:line 0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext() in c:\local\identity\server3\IdentityServer3\source\Core\Validation\ScopeValidator.cs:line 0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext() in c:\local\identity\server3\IdentityServer3\source\Core\Validation\ScopeValidator.cs:line 0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext() in c:\local\identity\server3\IdentityServer3\source\Core\Validation\ScopeValidator.cs:line 0",
InnerException: {
Message: "An error has occurred.",
ExceptionMessage: "Could not load type 'AutoMapper.IMapperConfiguration' from assembly 'AutoMapper, Version=5.0.2.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005'.",
ExceptionType: "System.TypeLoadException",
StackTrace: " at IdentityServer3.EntityFramework.Entities.EntitiesMap..cctor()"
this problem has been reported and I think fixed in the sources, I do not know if the nugget package has the fix yet.