Deploying Azure Static Web APP with multiple Subscription

Sateesh Kumar Sharma 21 Reputation points
2023-11-24T12:34:43.13+00:00

Hi Team,

We have deployed our React Application as Azure Static Web APP, and It is working fine .

In Static Web APP option selected as Other and manage the deployment token and copied it from SWA and store it in dev Azure repo.

Now We are planning to deploy it for 3 environments , Lets say System Testing , Pre Live and Production.

We have two Subscription - One Test Subscription and one Prod Subscription .

I have gone through multiple docs available on Internet and it is suggesting to have one static Web APP and deploy all your Stagging and Prod environment under one SWA.

Now the challenge is , Azure Static Web will be associated with one Subscription and we plan to deploy all env under one SWA then how we can plan for Stagging environments Test subscription can be used and for Prod , Production subscription can be used .

Basically we want to use two subscription , one for stagging(Test and Pre Prod) and one for Prod.

Is it possible to use two subscription under one Azure Static Web APP?

If not ,Can we have multiple Azure SWA per environment and deploy it from same repo and can handle Manage Deployment Token ?

Currently We are using this yaml File:

trigger:
  - master
  

pool:
  vmImage: ubuntu-latest
steps:
  - checkout: self
    submodules: true
  - task: AzureStaticWebApp@0
    inputs:
      app_location: '/'
      api_location: 'public'
      output_location: 'build'
      azure_static_web_apps_api_token: $(deployment_token)

Thank you in advance your suggestion and help :)

Regards,

Sateesh Sharma

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,153 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 27,946 Reputation points Microsoft Employee Moderator
    2023-12-11T15:37:29.9066667+00:00

    The setup will require configuration to properly configure deployment in your CI/CD to accomplish requirement.
    Azure Static Web Apps are tied to a single subscription, but the deployment token gives access to deploy ( managing token).

    You can have multiple Azure Static Web Apps for each environment, deploy them from the same repository, and manage the Deployment Tokens accordingly.

    Deployment token and Reset deployment tokens in Azure Static Web Apps

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.