skip to Main Content

I have a task to add an extension to Webapp as in the picture below, but I want it will be auto-add, I found it can’t not auto by CI/CD but I will be running on Azure ARM Template, so I viewed the template of a web app and see the config Extensions, Can I put that config to Azure ARM Template when we deploy? Because another team will handle deploying Azure ARM Template so I need to make sure about technical before requesting them to do that.
enter image description here

enter image description here

Thanks for your advice!

2

Answers


  1. Chosen as BEST ANSWER

    Many thank Harshitha! It's awesome. I have finished setup on CI/CD that's can add an extension to the list web app:

    enter image description here

    enter image description here


  2. Use the below ARM template to Install Contrast .NET Core Site Extension in to Webapp

    Thanks @Mark LaCasse for the ARM Template code.

    {
      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "sites_name": {
          "defaultValue": "harshitha2Oct22",
          "type": "String"
        }
      },
      "variables": {
      },
    
      "resources": [
        {
          "type": "Microsoft.Web/sites",
          "apiVersion": "2018-11-01",
          "name": "[parameters('sites_name')]",
          "location": "East US",
          "kind": "app",
          "properties": {
            "siteConfig": {
              "appSettings": [
                {
                  "name": "CONTRAST__API__API_KEY",
                  "value": "<CONTRAST__API__API_KEY>",
                  "slotSetting": false
                },
                {
                  "name": "CONTRAST__API__SERVICE_KEY",
                  "value": "<CONTRAST__API__SERVICE_KEY>",
                  "slotSetting": false
                },
                {
                  "name": "CONTRAST__API__URL",
                  "value": "<CONTRAST__API__URL>",
                  "slotSetting": false
                },
                {
                  "name": "CONTRAST__API__USER_NAME",
                  "value": "<CONTRAST__API__USER_NAME>",
                  "slotSetting": false
                },
                {
                  "name": "CORECLR_ENABLE_PROFILING",
                  "value": "1",
                  "slotSetting": false
                },
                {
                  "name": "CORECLR_PROFILER",
                  "value": "{8B2CE134-0948-48CA-A4B2-80DDAD9F5791}",
                  "slotSetting": false
                },
                {
                  "name": "CORECLR_PROFILER_PATH_32",
                  "value": "D:/home/SiteExtensions\Contrast.NetCore.Azure.SiteExtension\ContrastNetCoreAppService\contrast\runtimes\win-x86\native\ContrastProfiler.dll",
                  "slotSetting": false
    
                }
              ]
            }
    
          },
    
          "resources": [
            {
              "name": "Contrast.NetCore.Azure.SiteExtension",
              "type": "siteextensions",
              "apiVersion": "2018-02-01",
              "dependsOn": [
                "[resourceId('Microsoft.Web/Sites', parameters('sites_name'))]"
              ]
            }
          ]
        }
      ]
    }
    

    In Azure Portal => Create a resource => search for Template deployment (deploy using custom templates) => click on Create

    enter image description here

    • Click on the template shown below
      enter image description here

    • Copy paste the above given ARM Template ,click on Save.
      enter image description here

    • The details provided in the template will be displayed in the Instance details
      enter image description here

    • Provide the Subscription and Resource group details and click on Review +create to continue the steps.
      enter image description here

    • Navigate to your Resource Group, you can see the App service has been created with the given name.

    enter image description here

    • In Azure App Service => Under Development Tools select Extensions, you can see the Installed Contrast .NET Core Site Extension .
      enter image description here
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search