farmer icon indicating copy to clipboard operation
farmer copied to clipboard

staticWebApp - support Azure DevOps repositories

Open gursharan001 opened this issue 11 months ago • 3 comments

We deploy from a Azure DevOps repository to a static web app. Following ArmResource creates such a web app (Azure DevOps pipeline does the deployment).

$"""{{
        "apiVersion": "2021-01-01",
        "location": "East Asia",
        "name": "app-name",
        "type": "Microsoft.Web/staticSites",
        "sku": {{
            "tier": "Standard",
            "name": "Standard"
        }},
        "properties": {{
            "provider": "DevOps",
            "repositoryUrl": "https://dev.azure.com/<org>/_git/<repo>",
            "branch": "main",
            "repositoryToken": null,
            "buildProperties": {{
                "appLocation": "/",
                "apiLocation": "",
                "appArtifactLocation": ""
            }}
        }}
    }}"""

Can this support be added to staticWebApp? I am happy to attempt a PR.

gursharan001 avatar Jul 11 '23 04:07 gursharan001

Hi @gursharan001 . So am I right in saying that the arm template example you have given deployed the web app correctly?

You can of course add the "provider" key of "DevOps" to the app_settings parameter in Farmer currently from what I can see.

martinbryant avatar Jul 21 '23 11:07 martinbryant

Hi @martinbryant , yes I was able to deploy using the ArmResource definition with farmer instead of staticWebApp builder.

I tried specifying DevOps in app_settings as you suggested and it works

  1. is there a way to specify resource location at staticWebApp level. I had to change resource group locations to one of the acceptable ones to Azure static sites
  2. I had to pass in a empty repository token even though it's not required
  3. is there a way to specify sku and tier as well

Many thanks for your reply!

gursharan001 avatar Jul 21 '23 20:07 gursharan001

Hi @gursharan001 from what I can see in Farmer staticWebApp builder, all 3 points you have mentioned would need adding to the dsl.

Happy to look at your PR if you would like to.

martinbryant avatar Aug 11 '23 09:08 martinbryant