New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to deploy using an Azure DevOps Release Pipeline #510
Comments
We are working on a feature that'll allow you to deploy to named pre-production environments. Too early for an ETA but it should enable your scenario. |
I'd like to second this. I want to use it in our enterprise environment with DevOps. As much as I like GitHub, I feel like it's not really used that much in serious business environments when compared to DevOps. |
Same scenario as @stephajn.
Task details:
A task that's just for deployment would be great, I have the Skip app build toggled on too.
|
We have an update coming to the DevOps task that will improve the experience for release pipelines. It should be deployed in the next few weeks. microsoft/azure-pipelines-tasks#14807 It's important to note that the |
We have the same use case: deploy from a release pipeline. Today we deploy to Azure BLOB storage, linked to a CDN. It would be nice to replace that part. |
Hi all, We got this working quite ok for now. Not saying this is a long-term solution but it at least allowed us to use SWA in a way we like a bit more. Consider this inspiration 😎 So in our projects, we put these two steps in our azure-pipelines.yml. We do this after compiling the application. Please not that we leave the api as-is as the release pipeline always builds this and therefore needs source code.
We can then setup 2 release pipelines that both first download the artifacts created in the build pipeline (app and api). In a second step we run a bash script. This is quite a heavy beast but what it is basically doing is run the same docker image as the build pipeline step while providing configuration settings. As you can see below, with different settings you can create/update a staging slot or update your production slot. Please note that we did not find a way to detect closed pull requests so staging slots need to removed by hand. RELEASE to PRODUCTION
RELEASE to STAGING
|
We use Azure App Configuration to store our configuration externally. This allows us to use the AAC task https://marketplace.visualstudio.com/items?itemName=AzureAppConfiguration.azure-app-configuration-task to pull configuration into release pipeline variables. Next we use the variables in a File Transform task, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/file-transform?view=azure-devops, which updates the config file with the deployment settings. We have one build with artifacts and deploy via one release pipeline with different settings to 4 stages. This approach might replace your complex docker step. We haven't used the docker deployment trick to deploy any artifact to Azure Static Websites, thanks for the pointer! |
Any updates on this? |
There are a couple of updates coming in the next few months to address this.
|
We've just added support for named preview environments using Azure DevOps. Please give it a try and let us know if you have any feedback. |
Thanks @simonaco! Will do! |
Hey @simonaco I've taken named preview environments for a spin. Seems to work - I've a bunch of questions:
The repo I've been testing it on this (the blog post mentioned in the README is old - so ignore that): https://dev.azure.com/johnnyreilly/azure-static-web-apps/_git/azure-static-web-apps You don't need to look at it; I just share for context |
I've written up my experiences in this blog: https://blog.johnnyreilly.com/2022/05/07/static-web-apps-azure-devops-named-preview-environments Do let me know if there's any issues with it! |
Why is this called "preview" and not "staging" like normal terminology in release pipelines and Azure resources? |
The feature can now pick up a build artifact in a release pipeline. In a typical scenario you still want some config to be modified in the static website build artifact. Staging might need different back end URI's for instance. As I mentioned earlier we use Azure App Configuration to rewrite specific keys in a config.json file we use in the build artifact. Unfortunately the AAC release task can't deal with JSON values to replace keys even though AAC supports JSON values at runtime together with Microsoft.Extensions.Configuration perfectly. It would be nice to team up with the AAC task owners and create a smooth experience to deploy a reconfigured build artifact. |
I hope to see the update for this ticket soon. |
Static website builders in particular often use dynamic content and do other shenanigans with external dependencies during build and so have a more fragile build process. Hence separating build from release makes much more sense for static web apps than for regular ones. I need a separation here more than I need one for my .NET apps. |
This feature is much needed. Without this, the stages and approval flows have to be done in build pipelines (using yaml) and that doesn't scale if you have multiple build pipelines on multiple repos, working in tandem with a singular release pipeline. |
Hi @jtheisen , |
Ok, I didn't look too closely at that. Some minor question about that: |
Closing the issue. |
Is your feature request related to a problem? Please describe.
I cannot use Azure Static Web Sites because I have an application I'd like to run but have different environments to run it with. I would like to be able to deploy an application into Azure Static Web Sites in a DevOps Release Pipeline as opposed to a build pipeline so that I can modify certain files based upon the environment I am deploying to.
Describe the solution you'd like
I would like to have a task available to me in a release pipeline instead of a build pipeline that allows me to unzip a previously built artifact, do any work on it like modifying any files as part of the release pipeline, and then finally a step that allows me to upload a folder of files into Azure Static Web Sites.
Describe alternatives you've considered
I tried using the Azure DevOps Build Pipeline option, but it will not work for me as I need to be able to deploy to multiple environments like DEV, STAGING, and PROD.
Additional context
It feels odd to me that a build pipeline should be deploying bits somewhere as opposed to a release pipeline. This feature seems to rely heavily on the idea that you are using GitHub as your source control repository. Well, we are using a Git repository on Azure DevOps instead, and that makes this feel like it is only half baked when I can't do what I'd like using DevOps as opposed to a Github Action.
The text was updated successfully, but these errors were encountered: