Install .NET agent on AWS Elastic Beanstalk
One of the two options listed below can be used to install APM Insight agent onto a .NET web application hosted in Elastic Beanstalk environment via ebextensions.
Deployment through AWS tool kit for Visual Studio
Prerequisites:
- AWS tool kit for Visual Studio.
- AWS Developer access keys.
Steps:
- Open the project in visual studio, and add a folder with the name .ebextensions (if not present already).
- Under the .ebextensions folder add a file named apminsightExtn.config.
- Paste the following content in the file. Update your device key in the parameter license.key=<YOUR_LICENSE_KEY>. You can obtain the license key from the Site24x7 console after creating your account.
files:
"C:\\ProgramData\\install.ps1":
content: |
Invoke-WebRequest -Uri https://staticdownloads.site24x7.com/apminsight/agents/apminsight-dotnetagent.msi -OutFile C:\\ProgramData\\Site24x7APMInsightAgent.msi
"use.app.filters=false" | Set-Content C:\\ProgramData\\appfilter.conf
msiexec.exe /i "C:\\ProgramData\\Site24x7APMInsightAgent.msi" /qb license.key=<YOUR_LICENSE_KEY> editconfig=false APPFILTERCONFIGFILE=C:\\ProgramData\\appfilter.conf
commands:
install_agent:
command: powershell -NoProfile -ExecutionPolicy Bypass -file C:\\ProgramData\\install.ps1 - To customize your application name:
- Open web.config in your application
<configuration>
<app settings>
<add key="apminsight.name" value="Your_application_name" />
- Open web.config in your application
- Publish the web app using "Publish to AWS" option, and follow the wizard
- Once the deployment is successful, generate some traffic to view data in Site24x7 Console.
Deployment via uploading packages to AWS S3
Steps:
- In the web application to be published, add a folder named .ebextensions (if not present already).
- Under the .ebextensions folder add a file named apminsightExtn.config.
- Paste the following content in the file and Update your device key in the parameter license.key=<YOUR_LICENSE_KEY>. You can obtain the license key from the Site24x7 console after creating your account.
files:
"C:\\ProgramData\\install.ps1":
content: |
Invoke-WebRequest -Uri https://staticdownloads.site24x7.com/apminsight/agents/apminsight-dotnetagent.msi -OutFile C:\\ProgramData\\Site24x7APMInsightAgent.msi
"use.app.filters=false" | Set-Content C:\\ProgramData\\appfilter.conf
msiexec.exe /i "C:\\ProgramData\\Site24x7APMInsightAgent.msi" /qb license.key=<YOUR_LICENSE_KEY> editconfig=false APPFILTERCONFIGFILE=C:\\ProgramData\\appfilter.conf
commands:
install_agent:
command: powershell -NoProfile -ExecutionPolicy Bypass -file C:\\ProgramData\\install.ps1 - To customize your application name:
- Open web.config in your application
<configuration>
<app settings>
<add key="apminsight.name" value="Your_application_name" />
- Open web.config in your application
- Include this .ebextensions folder when creating application zip for publishing.
- If publishing is done for the first time.
- Create an application in the Elastic Beanstalk.
- Create an environment with platform type as IIS.
- Configure the required settings for the application and select Application source as 'Upload your own'.
- Select the zip file with .ebextensions folder.
- Launch the environment after giving the required parameters.
- If publishing to an existing environment.
- Select the Elastic Beanstalk application and choose the environment for deployment.
- Click on 'Upload and Deploy'.
- In the prompt to upload, select the zip file with .ebextensions folder.
- Label the deployment and click 'Upload'.
- Once the deployment is successful, generate some traffic to view the application in Site24x7 Console.