Error While uploading to windows Azure using powershell Script - asp.net

I am uploading the application to windows Azure using the powershell Script
New-AzureDeployment -ServiceName $servicename -Label MySite
-Slot "Staging" -Package "C:\Users\ronak\Documents\Visual Studio 2012\Projects\samplewebrole\samplewebrole\bin\Release\app.publish\samplewebrole.cspkg"
-Configuration "C:\Users\ronak\Documents\Visual Studio 2012\Projects\samplewebrole\samplewebrole\bin\Release\app.publish\ServiceConfiguration.Cloud.cscfg"
When I run this I receive an error as follows
New-AzureDeployment : Unable to write data to the transport connection: An
existing connection was forcibly closed by the remote host.
At line:14 char:1
+ New-AzureDeployment -ServiceName $servicename -Label MySite -Slot "Staging" -Pac...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureDeployment], StorageException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.NewAzureDeploymentCommand
To resolve this i found some suggestion to increase the size the asp.net can upload. Is there any other reason this is happening?
Also I am able to create cloud service and storage but cant upload my package to it.

I moved my script to the virtual machine which is hosted on azure and this error is no more so i think this error was due to my firewall or due to the slow internet connection.the script is running as desired on the virtual machine and i am able to automate my deployment process.

Related

add newly VMSS to existing backendpool of ApplicationGateway in Azure ARM

As I am new to Azure ARM template, I would like to add newly created VMSS to existing backendpool of ApplicationGateway in Azure ARM; I am following this official link Add VMSS in backendpool of ApplicationGateway
but while doing that I am getting this below error:
New-AzResourceGroupDeployment : 07:17:14 PM - The deployment
'Test-APP' failed with error(s). Showing 1 out of 1 error(s).
Status Message: Cannot parse the request. (Code: InvalidRequestFormat)
Could not find member 'ApplicationGatewayBackendAddressPools' on object of type 'VMScaleSetNetworkInterfaceIPConfiguration'. Path
'Properties.UpdateGroups[0].NetworkProfile.networkI
nterfaceConfigurations[0].properties.ipConfigurations[0].ApplicationGatewayBackendAddressPools',
line 1, position 671. (Code:InvalidJson) CorrelationId:
1234576-7tt2-49r1-b4d4-517b345691aa At line:8 char:1
New-AzResourceGroupDeployment `
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzu
reResourceGroupDeploymentCmdlet
Any update on this will be highly appreciated.
You can use the below cmdlet's to add the new VMSS as backend address pool for existing application gateway using either PowerShell or Azure CLI.
Power shell cmdlet to add new VMSS as backend pool :
Add-AzApplicationGatewayBackendAddressPool
-ApplicationGateway <PSApplicationGateway>
-Name <String>
[-BackendIPAddresses <String[]>]
[-BackendFqdns <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Here is the reference document for the above power shell command
Azure CLI to add new VMSS as backend pool :
az network application-gateway address-pool create --gateway-name
--name
--resource-group
[--no-wait]
[--servers]
[--subscription]
Here is the reference document for the above AzureCLI command

unknown error in realm studio for windows

After downloading Realm browser, i tried to connect it with our linux server where Realm Object Server is installed (professional edition).
Initially it was showing Timeout error constantly after that i tried to run Realm Studio as administrator and it started working.
I was trying run EventBlank example provided by realm
i was able to create database and users too over realm and can see it on realm studio but after a while when i tried to reopen realm studio and connect with the same realm object server url it is throwing unknown error
here is the server log while unknown error occured
Timeout error
Following things i have tried
1) re install realm studio
2) while installing run it as admin
3) turning off the firewall on windows
but it still throwing unknown error and timeout error
I am running realm object server using
ros start --address <ipaddress> --port <port>
server start log
After inspecting , this is what i got ( i have updated realm studio to 1.4 )

Error when deploying .NET Core webapp to Azure

I am a complete beginner on the .NET world trying to get my first dummy .NET Core webapp to run on Azure App Service.
The code can be found here:
https://github.com/jordi-chacon/bcn_pollution
My development machine runs Ubuntu, so I am using Visual Studio Code.
I currently have my .NET Core webapp running on localhost:5000 just fine and now I want it to run on Azure App Service.
I have successfully configured Continuous Deployment on my App Service to fetch the code from Github.
Then Azure tried to deploy my webapp but it failed with the following error:
Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --aspNet5 "D:\home\site\repository\project.json" --aspNet5Version "1.0.0-rc1-final" --aspNet5Runtime "CLR" --aspNet5Architecture "x86"'.
Project file path: .\project.json
Generating deployment script for ASP.NET 5 Application
Generated deployment script files
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET 5 Web Application deployment.
Downloading dnx-clr-win-x86.1.0.0-rc1-final from https://www.nuget.org/api/v2
Unable to download package: An exception occurred during a WebClient request.
At C:\Program Files
(x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\dnvm.ps1:694 char:13
+ throw "Unable to download package: {0}" -f
$Global:downloadData.Erro ...
+
Failed exitCode=1, command=PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='"D:\local\UserProfile\.dnx\temp-set-envvars.cmd"';& 'C:\Program Files (x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\dnvm.ps1' " install 1.0.0-rc1-final -arch x86 -r CLR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to downl...Client requ
An error has occurred during web site deployment.
est.:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to download package: An exception occurred during a WebClient request.
Anyone knows what I am doing wrong?
Thanks!
I guess you are hitting not enough disk space issue.
https://github.com/projectkudu/kudu/issues/1682
I tried your code, and repro the deployment failure.
when navigate to https://{site name}.scm.azurewebsites.net, i see below message
Parser Error Message: There is not enough space on the disk.
by default free site has 1 GB of disk space, but seems like it is an known issue that asp.net 5 application kind of require a lots of dependency and easily go over the limit. And they (Asp.net 5 folks) are working on addressing the issue.
walk-around is to deploy to a Basic or Standard site

Publish to Azur fails with 500 internal Server Error

I have a cloud service on Windows Azure, I created a Asp.net WebAPI project and published to the cloud service, that was working fine from Visual Studio to publish before i updated visual studio to update 4 and azure SDK 2.2 to 2.6. But after updating when I publish, I got the following error messages. I tried several times, all failed. Can anyone help me?
even i am not able to publish a new created project on new azure service !
11:00:31 PM - Warning: There are package validation warnings.
11:00:31 PM - Checking for Remote Desktop certificate...
11:00:39 PM - Preparing deployment for TempAzure - 2/12/2014 10:58:23
PM with Subscription ID 'e94e9aeb-7003-4eae-be92-7b7ac0a1ba2c' using
Service Management URL 'https://management.core.windows.net/'...
11:00:39 PM - Connecting...
11:00:39 PM - Verifying storage account 'jasontest'...
11:00:41 PM - Uploading Package...
11:06:48 PM - Warning: The remote server returned an error: (500)
Internal Server Error.
11:11:50 PM - Warning: The remote server returned an error: (500)
Internal Server Error.
11:26:16 PM - Warning: The remote server returned an error: (500)
Internal Server Error.
12:00:27 AM - Warning: The remote server returned an error: (500)
Internal Server Error.
12:05:05 AM - Warning: The remote server returned an error: (500)
Internal Server Error.
12:27:54 AM - Unable to write data to the transport connection: An
existing connection was forcibly closed by the remote host.
After updating from Azure SDK2.5 to SDK 2.6, I had the same problem when trying publish to my Azure service from VS2013: Any deployment effort using Visual Studio fails after some minutes with 500 Internal server error.
As I found the reason is the very slow upload of the Azure package to the cloud - sometimes only between 30kB/s and 50kB/s. The deployment fails because of an timeout which also explains, that the Azure instance logs show no sign of any deployment...
Work around: Deploy from Azure storage
1: Package the Azure solution, either via VisualStudio or via command line:
MSBuild /t:Publish /p:TargetProfile=Cloud /P:Configuration=Release
2: Create an Azure storage container to upload your package to.
Continue using AzurePowerShell cmdlets:
3: Login
Add-AzureAccount
4: Upload the package to the your Azure storage container
$Ctx = New-AzureStorageContext -StorageAccountName "yourstoragename" -StorageAccountKey "yourkey"
Set-AzureStorageBlobContent -File "...\app.publish\yourservice.cspkg" -Container "yourazurestoragecontainer" -Blob "yourservice.cspkg" -Context $Ctx -Force
Determine the PackageURL of the uploaded package.
5: Deploy the cloud service referring to the package just uploaded to Azure cloud storage.
Set-AzureDeployment -Upgrade -Slot "Staging" -Package "PackageURL" -Configuration "PathToYourCloudConfiguration.cscfg" -label "SomeDeploymentInfo" -ServiceName "yourservicename" -Force
(Of course the entire process is scriptable. Kemp Brown wrote a great article: with a script you could adapt to explictly upload the package:
Continuous Delivery for Cloud Services in Azure)
Actually the problem was my network connection.
to identify this problem i created VM on azure with same windows 8.1 OS and same VS. i tried to deploy from there. deployment worked fine. latter I disconnected all other devices from my internet connection and i tried to publish from my machine. it worked !
so conclusion is slow internet connection or may be now we have less timeout time for publish from VS !

NuGet execution policy errors when installing MvcScaffolding package

I'm using Visual Web Developer Express 2010, Windows XP, and using ASP.NET MVC4 RC in a project. I have NuGet v2.0.30619.9119 installed.
I'm now trying to install the MvcScaffolding package via NuGet Package Manager Console. I get the following errors:
PM> Install-Package MvcScaffolding
Attempting to resolve dependency 'T4Scaffolding'.
Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 4.1.10715.0'.
Successfully installed 'T4Scaffolding 1.0.6'.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps
1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Successfully installed 'MvcScaffolding 1.0.7'.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.
ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Successfully added 'EntityFramework 4.1.10715.0' to MyProject.Web.
Successfully added 'T4Scaffolding 1.0.6' to MyProject.Web.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\inst
all.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
'InstallationDummyFile.txt' already exists. Skipping...
Successfully added 'MvcScaffolding 1.0.7' to MyProject.Web.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\in
stall.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Because the init scripts aren't being executed after the install, the MvcScaffolding package is not installed correctly and the scaffold command is not recognised.
I don't know what to do about these code signing issues. Here are the current security settings:
PM> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process RemoteSigned
CurrentUser Undefined
LocalMachine Unrestricted
Can I change the Process scope to be Unrestricted? If so, how? Running Set-ExecutionPolicy in the NuGet console does not work:
PM> Set-ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):Y
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will
retain its current effective execution policy of "RemoteSigned". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPol
icy."
At line:1 char:20
+ Set-ExecutionPolicy <<<< Unrestricted
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
+ FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
I've also tried doing all of this as an Administrator and that didn't help either.
Any advice or ideas would be much appreciated.
UPDATE
I can set the process execution policy in NuGet like this:
Set-ExecutionPolicy Unrestricted -Scope Process
But when I restart Visual Web Developer, the setting is forgotten and I still get an error as it keeps trying to execute the init.psl files
How can I change the execution policy permanently?
OK, I have MvcScaffolding installed correctly now.
I had to first bypass all security in NuGet:
Set-ExecutionPolicy Bypass -Scope Process
But when I restart Visual Web Developer I still get those same PowerShell errors todo with the NuGet running init.pls on startup.
I've worked out that it's because I was storing my project on a network drive. Apparently PowerShell won't execute scripts from the network drive by default.
I tried using CasPol to change the security settings, but couldn't get it to work. I gave up when I saw other people couldn't get VS to work with mapped drives as well:
CAS not working for VS2010 mapped drive
Anyway, I just have my project local now, and MvcScaffolding is installed and working.
You can set the policy for user scope and using a more secure policy like this:
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser
Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
Prompts you before running scripts from publishers that you have not yet classified as trusted or untrusted.
For exemple, installing a EntityFramework ask permission to run the script:
Executing script file 'c:\users\user\documents\visual studio 2015\Projects\zzz\packages\EntityFramework.6.1.3\tools\install.ps1'
Do you want to run software from this untrusted publisher?
File C:\users\user\documents\visual studio 2015\Projects\zzz\packages\EntityFramework.6.1.3\tools\install.ps1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):R

Resources