Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
326 stars 56 forks source link

Just deploy it with ARM #687

Open paule96 opened 2 years ago

paule96 commented 2 years ago

It would be really nice to have a deploy from zip option in the ARM template. Or even better an option to deploy from a repo but without creating in the repo action or an azure pipeline.

So you can basically archive the ability to add the deploy to azure button, for your repo, and the user of the Application must just deploy it without bothering to connect a build system or something else to it. So it is easier to share done solutions that are for example codewise is hosted on github, and N customers just deploy it with a ARM template in there subscriptions. The ARM template would look like:

                "apiVersion": "2021-01-15",
                "name": "[parameters('name')]",
                "type": "Microsoft.Web/staticSites",
                "location": "[parameters('location')]",
                "tags": "[parameters('resourceTags')]",
                "properties": {
                    "repositoryUrl": "[parameters('repositoryUrl')]",
                    "branch": "[parameters('branch')]",
                    // This shouldn't be needed for this usecase.
                    //"repositoryToken": "[parameters('repositoryToken')]",
                    "buildProperties": {
                        "appLocation": "[parameters('appLocation')]",
                        "apiLocation": "[parameters('apiLocation')]",
                        "appArtifactLocation": "[parameters('appArtifactLocation')]"
                    }
                },
simonaco commented 2 years ago

Thank you for the feedback @paule96 . related to #7

paule96 commented 2 years ago

@simonaco I don't know if this is really related. This is a bit more diffrent I think. Maybe I must describe it a bit more. What I wish to have is something like the following scenario:

There is some git-repo somewhere. In this git-repo is the source code for an static web app. Now the owner of the git-repo is creating an ARM template to provide the "deploy to Azure" button. The goal of the owner is, that this template deploys the whole solution just with this single template. So this template needs the information where to find the source code and how to build it. The if the ARM template deploys, it should just give this information to the static website resource in Azure. And then some magic should be triggered inside Azure that pulls the source code, runs the Azure static website deploy container (that builds the application) and deploy the application from the repository into the static web app.

And the user who want just to use the application from the github repo, must only press a single button and needs only a Azure account. This would be really nice to see to have something like that. That would help even smaller projects, to have a really quick start for there customers on Azure, without trying to figure out how to publish a solution inside the Azure marketplace, what would be another way to reach the same goal.

What the git-repo owner currently must do is something like this:

To see a real life example you can look into this Readme. It describes how someone can deploy the solution into its own Azure account.

cjbadger commented 1 year ago

Hi there,

We have a similar use case, where we've developed an SWA with a linked Function App as a (bring your own function) API, and want to allow customers to deploy these resources, as well as the SWA's (pre-built) assets (just three files - an index.html, main.js and style.css), using an ARM template (compiled from a Bicep file). Is there any way to achieve this yet?

paule96 commented 1 year ago

There is another business need to deploy your application with your infrastructure. In Azure there are many components Azure Events. These events can fire to webhooks. But that is only allowed if the remote endpoint answers correctly to the validation request. This must happen while the deployment of the event happens. Because you deploy the Events also over ARM you have currently only the following option:

  1. Deploy your infrastructure (without events)
  2. Deploy your static webApp app into your static webApp resource
  3. Deploy your infrastructure (only events)