Skip to content

Commit a24d172

Browse files
committed
edit
1 parent 71c0af1 commit a24d172

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

articles/static-web-apps/deploy-bicep.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Deploy Azure Static Web Apps using Bicep including resource creatio
44
services: static-web-apps
55
ms.custom:
66
author: craigshoemaker
7-
ms.service: static-web-apps
7+
ms.service: azure-static-web-apps
88
ms.topic: how-to
99
ms.date: 08/13/2024
1010
ms.author: cshoe
@@ -101,11 +101,9 @@ To create a static web app with a linked backend function app, you need to use a
101101

102102
* [Create the Azure Function app](/azure/azure-functions/functions-create-first-function-bicep). You need the resourceId for the Function app, which looks like: `/subscriptions/<SUBSCRIPTION-ID>/resourcegroups/<RESOURCE-GROUP-NAME>/providers/Microsoft.Web/sites/<FUNCTION-APP-NAME>`.
103103
* Create the static web app using the [bicep in the previous section](#create-a-static-web-app-resource).
104-
* Configure the static web app. Configuration includes:
105-
* CORS: The Azure Function app needs to know the defaultHostname of the static web app.
106-
* Link: The static web app needs to know about the Azure Function app in order to link to it.
104+
* Link the static web app to the function app.
107105

108-
Create a `config.bicep` file, which creates a static web app and [links to an existing Azure Functions app](functions-bring-your-own#link-an-existing-azure-functions-app).
106+
Create a `config.bicep` file to link the static web app to the function app.
109107

110108
```bicep
111109
targetScope = 'resourceGroup'
@@ -122,9 +120,6 @@ param resourceGroup string = '<RESOURCE-GROUP-NAME>'
122120
@description('Azure Statoc web app name')
123121
param staticWebAppName string = '<STATIC-WEB-APP-NAME>'
124122
125-
@description('Azure Static web app origin - value from swa.outputs.defaultHostname')
126-
param staticWebAppOrigin string = 'https://...'
127-
128123
@description('Azure Function App name')
129124
param functionAppName string = '<FUNCTION-APP-NAME>'
130125
@@ -133,11 +128,6 @@ resource staticWebApp 'Microsoft.Web/staticSites@2023-12-01' existing = {
133128
name: staticWebAppName
134129
}
135130
136-
@description('Get reference to function app')
137-
resource functionApp 'Microsoft.Web/sites@2021-02-01' existing = {
138-
name: functionAppName
139-
}
140-
141131
param functionAppResourceId string = '/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Web/sites/${functionAppName}'
142132
143133
@description('Link backend to static web app')
@@ -149,22 +139,6 @@ resource linkedStaticWebAppBackend 'Microsoft.Web/staticSites/linkedBackends@202
149139
region: location
150140
}
151141
}
152-
153-
@description('The app settings to be applied to the app service')
154-
param appSettings object = {
155-
cors: {
156-
allowedOrigins: [
157-
staticWebAppOrigin
158-
]
159-
}
160-
}
161-
162-
@description('Function App settings for CORS')
163-
resource functionAppSettings 'Microsoft.Web/sites/config@2022-03-01' = {
164-
name: 'appsettings'
165-
parent: functionApp
166-
properties: appSettings
167-
}
168142
```
169143
Learn more from a full end-to-end application, which provides resource creation and application deployment:
170144

0 commit comments

Comments
 (0)