How to install IIS Role at Azure automatically - iis

I want to install "IIS 6 Metabase Compatibility" at Azure Startup Task
<Task commandLine="installSomething.cmd" executionContext="elevated" taskType="simple" />
Could you please tell me the command that can install IIS Role, thanks

Related

Azure Deployment Pool Agent Fails to install IIS

Goal
I'm trying to install IIS on remote server using azure devops. I have done this on other vm servers without issue.
Problem
When running this stage the Agent Errors with very little details
Agent Errors when installing IIS
Error
2020-08-11T19:06:19.1822182Z ##[section]Starting: IIS Web App Manage
2020-08-11T19:06:19.1984662Z ==============================================================================
2020-08-11T19:06:19.1985052Z Task : IIS web app manage
2020-08-11T19:06:19.1985379Z Description : Create or update websites, web apps, virtual directories, or application pools
2020-08-11T19:06:19.1985671Z Version : 0.5.15
2020-08-11T19:06:19.1985908Z Author : Microsoft Corporation
2020-08-11T19:06:19.1986227Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/iis-web-app-management-on-machine-group
2020-08-11T19:06:19.1986625Z ==============================================================================
2020-08-11T19:06:21.2180244Z Installing IIS. This may take few minutes.
2020-08-11T19:06:46.1602426Z ##[error]The request to add or remove features on the specified server failed.
Installation of one or more roles, role services, or features failed.
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f081f
2020-08-11T19:06:46.1908491Z ##[section]Finishing: IIS Web App Manage
Stage Settings
steps:
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Manage IISWebsite'
inputs:
EnableIIS: true
WebsiteName: 'Default Web Site'
AddBinding: true
Bindings: '{"bindings":[{"protocol":"http","ipAddress":"All Unassigned","port":"80","hostname":"","sslThumbprint":"","sniFlag":false}]}'
CreateOrUpdateAppPoolForWebsite: true
AppPoolNameForWebsite: default
I solved this by stop trying to use the prebuilt IIS web app manage tool and ended up just installing iis via power shell command
Install-WindowsFeature -name Web-Server -IncludeManagementTools

Packaging SSIS (.ispac) into NuGet Feed (Azure Artifacts)

I have to connect Octopus-Deploy to an external feed located on a Azure Devops Artifact Feed. I've successfully connected to the feed, but seeing how I packaged my SSIS project (.ispac) and SSDB project (.dacpac) as .dacpac and .ispac, it won't find them as it expects them to be in .NuGet format.
I haven't been able to try much as I'm pretty stuck.
N/A
I'm constrained to put whatever type of package I make on this feed to connect to from Octopus and deploy from. I have to have either have all my packages be NuGet Packages or find and alternate way that Octopus Deploy can find my packages on the Azure External Feed w/out them being NuGet. I'm only deploying SSDT things: i.e. dacpac, ispac, sql-agents, sql scripts etc.
You can make a NuSpec file which contains the things you need to package into NuGet to use a NuGet external feed in Octopus with. In the case of SSIS, you will want to reference the .ispac file in your nuspec file like so:
{
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>SSIS.ODSToDW</id>
<version>2.0.0</version>
<authors>blah</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>ODSToDW ispac</description>
</metadata>
<files>
<file src="bin/Development/ODS-To-DW.ispac" target="ODS-To-DW.ispac" />
</files>
</package>
}
You'll then do a "build" pipeline in DevOps which builds your solution. In the case of ispac you will need to use SSIS Build (you can get it from the market place).
Upon building the solution so that the latest .ispac is formed, you then use NuGet pack pointed to your .nuspec file like so:
{
- task: NuGetCommand#2
inputs:
command: 'pack'
packagesToPack: '**/*.nuspec'
configuration: 'Release'
versioningScheme: 'byPrereleaseNumber'
majorVersion: '1'
minorVersion: '0'
patchVersion: '2'
packTimezone: 'local'
}
Then you can do a "NuGet push" to your Artifact feed in azure. From which Octopus will be able to connect using "external NuGet feed" which will allow you to using "Deploy Package" from the Octopus Process options from which you can point to your specific artifact using it's name and a post-deployment powershell script will allow you to deploy to your sql server.

HTTP Error 502.5 - Process Failure asp.net core 2.0

Problem
I already developed my web app and published it to azure with asp.net core 1.1 and it was working fine until I upgraded my web application to Core 2.0 final release and now the app working locally but when I deploy it to Azure It gives me this issue .
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
</ItemGroup>
I just update .csproj file with this line of code
HTTP Error 502.5 - Process Failure
Common causes of this issue:
The application process failed to start The application process
started but then stopped The application process started but failed to
listen on the configured port
Troubleshooting steps:
Check the system event log for error messages Enable logging the
application process' stdout messages Attach a debugger to the
application process and inspect
With a bit of searching this worked for me.
Essentially clean out the wwwroot folder from a console on your Azure Portal. Make sure you get the top most wwwroot folder (I had a sub wwwroot folder for some reason.)
RD wwwroot /S /D
Should do the trick. Then just republish your site. It would appear that the publish process does NOT delete anything that already exists within the deploy folder. So you have 1.1 .dlls and 2.0 .dlls.
Hope that does the trick for you.
I had same problem publishing a simple spike app using VS2017 15.7.1
- File | New Project, ASP.NET Core Web App, MVC, ASP.NET Core 2.0
- Build and run on local host
- Publish to Azure WebApp
Browser displayed error: HTTP Error 502.5 - Process Failure
I had the issue HTTP Error 502.5 - Process Failure, mine was fix by installing the .net sdk
https://www.microsoft.com/net/download/visual-studio-sdks
After upgraded to ASP.NET Core 2.0, you need to add following configuration section to all the .csproj files in the solution.
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
You could create a new ASP.NET Core 2.0 application to check it. The DotNetCliToolReference configuration section is already in the new ASP.NET Core 2.0 application project file but missed in your upgraded application project file.
I was running 2.0.8, had to downgrade to 2.0.5 then it worked. The 2.0.8 didn't include a the Self-contained deployments (SCD) as supposed which 2.0.5 did.
I'm using VSTS to build and release

Logstash: How to keep the logstash running continuously on windows

Since the logstash process on windows gets closed immediately after the connection to the machine is lost or logged off from the machine, How to keep the logstash process running continuously and in back-end on windows?
Use Non-Sucking Service Manager to install logstash as a windows service. Services can be started at boot and run without an active user login.
You can use the Windows Service Wrapper (https://github.com/kohsuke/winsw).
Simple put the wsw.exe into the logstash bin directory, rename it to logstash.exe and do the same for the configuration xml file. So you have a logstash.exe and logstash.xml file in the bin directory of logstash.
Now you need to adjust the xml file a bit. Mine looks like this (tweak it to your needs):
<configuration>
<id>logstash</id>
<name>Logstash</name>
<description>Logstash from elastic.co</description>
<executable>D:\logstash\bin\logstash.bat</executable>
<arguments></arguments>
<serviceaccount>
<domain>local</domain>
<user>waffel</user>
<password>XXX</password>-->
</serviceaccount>
<onfailure action="restart" delay="10 sec"/>
<onfailure action="restart" delay="20 sec"/>
<onfailure action="none" />
<resetfailure>1 hour</resetfailure>
<priority>Normal</priority>
<stoptimeout>15 sec</stoptimeout>
<stopparentprocessfirst>false</stopparentprocessfirst>
<startmode>Automatic</startmode>
<waithint>15 sec</waithint>
<sleeptime>1 sec</sleeptime>
<logpath>D:\logstash\logs</logpath>
<log mode="append"/>
<env name="JAVA_HOME" value="D:\jdk8x64" />
</configuration>
Then you can simple hit from the cmd (as admin)
logstash.exe test
Or to install the service
logstash.exe install
and then you can run from cmd (or service management)
logstash.exe start
logstash.exe stop
You may whatch the logsfiles for potential errors. For me it works fine with logstash 5.5.1

Azure Role - Application startup task failed with exit code 1

I tried to include a Task as per MSDN article below:
http://msdn.microsoft.com/en-us/library/windowsazure/jj154098.aspx
However I'm getting the error below on one of the instance;
Recycling (Waiting for role to start... Application startup task failed with exit code 1. [2013-04-13T11:03:22Z])
Could someone please suggest what's really happening and what's the fix if any?
Below is my cmd:
#echo off
#echo Installing "IPv4 Address and Domain Restrictions" feature
%windir%\System32\ServerManagerCmd.exe -install Web-IP-Security
#echo Unlocking configuration for "IPv4 Address and Domain Restrictions" feature
%windir%\system32\inetsrv\AppCmd.exe unlock config -section:system.webServer/security
And CSDF:
<Startup>
<Task commandLine="Startup.cmd" executionContext="elevated"/>
<Task commandLine="startup\startup.cmd" executionContext="elevated"/>
</Startup>
Thank you
I had a similar problem once. I fixed it by adding the following to my start-up script:
exit /b 0
Without this the Azure Fabric didn't register the script as finished and it kept recycling the instance.
I see you use ServerManagerCmd.exe. This command is removed from Windows Server 2012. So make sure your role isn't deployed with the latest OS Family version.
<ServiceConfiguration ... osFamily="1" ...>
What you can do here is RDP into the instance and run the .CMD file manually to see if it's throwing any errors.
I received a similar error when deploying to Azure and it was caused by the startup command raising a dialogue box that required a user input. Essentially the alert box was confirming that a .dll had been registered, that's all, but it was enough to stop the deployment routine in it's tracks.
Here is the contents of my .cmd file:
chcp 1252>NUL
regsvr32 /s .\library\asppdf64.dll
regsvr32 /s .\library\aspjpeg64.dll
exit /b 0
The /s tells the service to run silently (i.e. with dialogues purged). The chcp 1252>NUL sets the code-page.

Resources