Update SampleApp.yaml #155
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Sample App deploy | |
# Controls when the workflow will run | |
env: | |
AZURE_WEBAPP_NAME: "azure.com" # set this to your application's name | |
LOAD_TEST_RESOURCE: "gh-action-test" | |
LOAD_TEST_RESOURCE_GROUP: "radhika-test" | |
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root | |
NODE_VERSION: '14.15.1' # set this to the node version to use | |
LOCATION: "West US" | |
APPINSIGHTLOCATION: "West US" | |
DATABASEACCOUNTLOCATION: "westus" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# build-and-deploy: | |
# # The type of runner that the job will run on | |
# runs-on: ubuntu-latest | |
# # Steps represent a sequence of tasks that will be executed as part of the job | |
# steps: | |
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
# - name: Checkout GitHub Actions | |
# uses: actions/checkout@v2 | |
# - name: Login to Azure | |
# uses: azure/login@v1 | |
# continue-on-error: false | |
# with: | |
# creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# # Deploy Arm template | |
# - name: Deploy ARM Template | |
# uses: azure/[email protected] | |
# continue-on-error: false | |
# with: | |
# inlineScript: | | |
# az group create --name "${{ env.AZURE_WEBAPP_NAME }}-rg" --location "${{ env.LOCATION }}" | |
# $deploymentOutputs = az deployment group create --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --mode Incremental --template-file ./windows-webapp-template.json --parameters webAppName="${{ env.AZURE_WEBAPP_NAME }}" --parameters hostingPlanName="${{ env.AZURE_WEBAPP_NAME }}-host" --parameters appInsightsLocation="${{ env.APPINSIGHTLOCATION }}" --parameters databaseAccountId="${{ env.AZURE_WEBAPP_NAME }}db" --parameters databaseAccountLocation="${{ env.DATABASEACCOUNTLOCATION }}" -o json | |
# $deploymentOutputs = $deploymentOutputs | ConvertFrom-Json | |
# $connectionString = [String]$deploymentOutputs.properties.outputs.azureCosmosDBAccountKeys.value | |
# $setConnectionString = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings CONNECTION_STRING="$connectionString" | |
# $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings MSDEPLOY_RENAME_LOCKED_FILES=1 | |
# $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true | |
# $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings HEADER_VALUE="${{ secrets.MY_SECRET }}" | |
# azPSVersion: "latest" | |
# - name: 'Deploy to Azure WebApp' | |
# uses: azure/webapps-deploy@v2 | |
# with: | |
# app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
# package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
loadTest: | |
name: Load Test | |
# needs: build-and-deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout GitHub Actions | |
uses: actions/checkout@v2 | |
- name: Login to Azure | |
uses: azure/login@v1 | |
continue-on-error: false | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# - name: Create Resource Group | |
# uses: azure/powershell@v1 | |
# continue-on-error: false | |
# with: | |
# inlineScript: | | |
# az group create --name "${{ env.LOAD_TEST_RESOURCE_GROUP }}" --location "${{ env.LOCATION }}" | |
# azPSVersion: "latest" | |
# - name: Create Azure Load Testing resource | |
# uses: azure/arm-deploy@v1 | |
# with: | |
# resourceGroupName: ${{ env.LOAD_TEST_RESOURCE_GROUP }} | |
# template: ./ARMTemplate/template.json | |
# parameters: ./ARMTemplate/parameters.json name=${{ env.LOAD_TEST_RESOURCE }} location="${{ env.LOCATION }}" | |
- name : 'Install dependencies' | |
run: | | |
npm install | |
- name: Install Node.js and npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
- name: 'Azure Load Testing' | |
uses: Himanshu49/load-testing@testing-renaming-models | |
with: | |
loadTestConfigFile: 'test/config.yml' | |
loadTestResource: ${{ env.LOAD_TEST_RESOURCE }} | |
resourceGroup: ${{ env.LOAD_TEST_RESOURCE_GROUP }} | |
env: | | |
[ | |
{ | |
"name": "webapp", | |
"value": "${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net" | |
} | |
] | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: loadTestResults | |
path: ${{ github.workspace }}/loadTest |