You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -159,7 +159,7 @@ az appservice plan list --query "[?id=='$appServicePlanId'].sku.tier" --output t
159
159
160
160
In the previous example replace `<RESOURCE_GROUP>` and `<FUNCTION_APP_NAME>` with the resource group and function app names, respective.
161
161
162
-
# [Azure PowerShell](#tab/azure-powershell)
162
+
###[Azure PowerShell](#tab/azure-powershell)
163
163
164
164
Run the following Azure PowerShell command to get your hosting plan type:
165
165
@@ -176,7 +176,7 @@ In the previous example replace `<RESOURCE_GROUP>` and `<FUNCTION_APP_NAME>` wit
176
176
177
177
## Plan migration
178
178
179
-
You can use either the Azure portal or Azure CLI commands to migrate a function app between a Consumption plan and a Premium plan on Windows. When migrating between plans, keep in mind the following considerations:
179
+
You can migrate a function app between a Consumption plan and a Premium plan on Windows. When migrating between plans, keep in mind the following considerations:
180
180
181
181
+ Direct migration to a Dedicated (App Service) plan isn't currently supported.
182
182
+ Migration isn't supported on Linux.
@@ -185,15 +185,45 @@ You can use either the Azure portal or Azure CLI commands to migrate a function
185
185
+ Downtime in your function executions occurs as the function app is migrated between plans.
186
186
+ State and other app-specific content is maintained, since the same Azure Files share is used by the app both before and after migration.
187
187
188
-
### Migration in the portal
188
+
You can migrate your plan using these tools:
189
+
190
+
### [Portal](#tab/portal)
191
+
192
+
You can use the [Azure portal](https://portal.azure.com) to switch to a different plan.
193
+
194
+
### [Azure CLI](#tab/azure-cli)
195
+
196
+
You can use the Azure CLI commands to manually create a new plan, switch your app to use the new plan, and delete the original plan.
197
+
198
+
### [Azure PowerShell](#tab/azure-powershell)
199
+
200
+
You can use Azure PowerShell commands to manually create a new plan, switch your app to use the new plan, and delete the original plan.
201
+
202
+
---
203
+
204
+
Choose the direction of the migration for your app on Windows.
In the Azure portal, navigate to your Consumption or Premium plan app and choose **Change App Service plan** under **App Service plan**. Select the other **Plan type**, create a new App Service plan of the new type, and select **OK**. For more information, see [Move an app to another App Service plan](../app-service/app-service-plan-manage.md#move-an-app-to-another-app-service-plan).
208
+
1.In the Azure portal, navigate to your Consumption plan app and choose **Change App Service plan** under **App Service plan**.
191
209
192
-
### Consumption to Premium
210
+
1. Select **Premium** under **Plan type**, create a new Premium plan, and select **OK**.
211
+
212
+
For more information, see [Move an app to another App Service plan](../app-service/app-service-plan-manage.md#move-an-app-to-another-app-service-plan).
1. In the Azure portal, navigate to your Premium plan app and choose **Change App Service plan** under **App Service plan**.
217
+
218
+
1. Select **Consumption** under **Plan type**, create a new Consumption plan, and select **OK**.
219
+
220
+
For more information, see [Move an app to another App Service plan](../app-service/app-service-plan-manage.md#move-an-app-to-another-app-service-plan).
Use the following procedure to migrate from a Consumption plan to a Premium plan on Windows:
195
225
196
-
1. Run the [az functionapp plan create](/cli/azure/functionapp/plan#az-functionapp-plan-create) command as follows to create a new App Service plan (Elastic Premium) in the same region and resource group as your existing function app:
226
+
1. Run the [az functionapp create](/cli/azure/functionapp/plan#az-functionapp-plan-create) command as follows to create a new App Service plan (Elastic Premium) in the same region and resource group as your existing function app:
197
227
198
228
```azurecli-interactive
199
229
az functionapp plan create --name <NEW_PREMIUM_PLAN_NAME> --resource-group <MY_RESOURCE_GROUP> --location <REGION> --sku EP1
@@ -205,7 +235,7 @@ Use the following procedure to migrate from a Consumption plan to a Premium plan
205
235
az functionapp update --name <MY_APP_NAME> --resource-group <MY_RESOURCE_GROUP> --plan <NEW_PREMIUM_PLAN>
206
236
```
207
237
208
-
1. If you no longer need your previous Consumption function app plan, delete your original function app plan after confirming you have successfully migrated to the new one. Run the [az functionapp plan list](/cli/azure/functionapp/plan#az-functionapp-plan-list) command as follows to get a list of all Consumption plans in your resource group:
238
+
1. When you no longer need the Consumption plan originally used by the app, delete your original plan after confirming you have successfully migrated to the new one. Run the [az functionapp plan list](/cli/azure/functionapp/plan#az-functionapp-plan-list) command as follows to get a list of all Consumption plans in your resource group:
209
239
210
240
```azurecli-interactive
211
241
az functionapp plan list --resource-group <MY_RESOURCE_GROUP> --query "[?sku.family=='Y'].{PlanName:name,Sites:numberOfSites}" -o table
@@ -219,45 +249,102 @@ Use the following procedure to migrate from a Consumption plan to a Premium plan
219
249
az functionapp plan delete --name <CONSUMPTION_PLAN_NAME> --resource-group <MY_RESOURCE_GROUP>
Use the following procedure to migrate from a Premium plan to a Consumption plan on Windows:
225
255
226
-
1. Run the [az functionapp plan create](/cli/azure/functionapp/plan#az-functionapp-plan-create) command as follows to create a new function app (Consumption) in the same region and resource group as your existing function app. This command also creates a new Consumption plan in which the function app runs.
256
+
1. Run the [az functionapp create](/cli/azure/functionapp#az-functionapp-create) command as follows to create a new function app (Consumption) in the same region and resource group as your existing function app. This command also creates a new Consumption plan in which the function app runs:
1. Run the [az functionapp show](/cli/azure/functionapp#az-functionapp-show) command as follows to get the name of the Consumption plan created with the new function app:
231
263
232
-
1. Run the [az functionapp update](/cli/azure/functionapp#az-functionapp-update) command as follows to migrate the existing function app to the new Consumption plan.
264
+
```azurecli-interactive
265
+
az functionapp show --resource-group <MY_RESOURCE_GROUP> --name <NEW_CONSUMPTION_APP_NAME> --query "{appServicePlanId}" -o tsv
266
+
```
267
+
The Consumption plan name is the final segment of the fully-qualified resource ID that's returned.
268
+
269
+
1. Run the [az functionapp update](/cli/azure/functionapp#az-functionapp-update) command as follows to migrate the existing function app to the new Consumption plan:
233
270
234
271
```azurecli-interactive
235
272
az functionapp update --name <MY_APP_NAME> --resource-group <MY_RESOURCE_GROUP> --plan <NEW_CONSUMPTION_PLAN> --force
236
273
```
237
274
238
-
1. Run the [az functionapp delete](/cli/azure/functionapp#az-functionapp-delete) command as follows to delete the function app you created in step 1, since you only need the plan that was created to run the existing function app.
275
+
1. Run the [az functionapp delete](/cli/azure/functionapp#az-functionapp-delete) command as follows to delete the function app you created in step 1, since you only need the plan that was created to run the existing function app:
239
276
240
277
```azurecli-interactive
241
278
az functionapp delete --name <NEW_CONSUMPTION_APP_NAME> --resource-group <MY_RESOURCE_GROUP>
242
279
```
243
280
244
-
1. If you no longer need your previous Premium function app plan, delete your original function app plan after confirming you have successfully migrated to the new one. Until the Premium plan is deleted, you continue to be charged for it. Run the [az functionapp plan list](/cli/azure/functionapp/plan#az-functionapp-plan-list) command as follows to get a list of all Premium plans in your resource group.
281
+
1. When you no longer need the Premium plan originally used by the app, delete your original plan after confirming you have successfully migrated to the new one. Until the Premium plan is deleted, you continue to be charged for it. Run the [az functionapp plan list](/cli/azure/functionapp/plan#az-functionapp-plan-list) command as follows to get a list of all Premium plans in your resource group:
245
282
246
283
```azurecli-interactive
247
284
az functionapp plan list --resource-group <MY_RESOURCE_GROUP> --query "[?sku.family=='EP'].{PlanName:name,Sites:numberOfSites}" -o table
248
285
```
249
286
250
-
1. Run the [az functionapp plan delete](/cli/azure/functionapp/plan#az-functionapp-plan-delete) command as follows to delete the Premium plan you migrated from.
287
+
1. Run the [az functionapp plan delete](/cli/azure/functionapp/plan#az-functionapp-plan-delete) command as follows to delete the Premium plan you migrated from:
251
288
252
289
```azurecli-interactive
253
290
az functionapp plan delete --name <PREMIUM_PLAN> --resource-group <MY_RESOURCE_GROUP>
Use the following procedure to migrate from a Consumption plan to a Premium plan on Windows:
295
+
296
+
1. Run the [New-AzFunctionAppPlan](/powershell/module/az.functions/new-azfunctionappplan) command as follows to create a new App Service plan (Elastic Premium) in the same region and resource group as your existing function app:
1. Run the [Update-AzFunctionApp](/powershell/module/az.functions/update-azfunctionapp) command as follows to migrate the existing function app to the new Premium plan:
1. When you no longer need the Consumption plan originally used by the app, you can run the [Remove-AzFunctionAppPlan](/powershell/module/az.functions/remove-azfunctionappplan) command as follows to delete the Consumption plan you migrated from:
Use the following procedure to migrate from a Premium plan to a Consumption plan on Windows:
317
+
318
+
1. Run the [New-AzFunctionApp](/powershell/module/az.functions/new-azfunctionapp) command as follows to create a new function app (Consumption) in the same region and resource group as your existing function app. This command also creates a new Consumption plan in which the function app runs:
1. Run the [Get-AzFunctionApp](/powershell/module/az.functions/get-azfunctionapp) command as follows to get the name of the Consumption plan created with the new function app:
1. Run the [Update-AzFunctionApp](/powershell/module/az.functions/update-azfunctionapp) command as follows to migrate the existing function app to the new Consumption plan:
1. When you no longer need the Consumption plan originally used by the app, you can run the [Remove-AzFunctionAppPlan](/powershell/module/az.functions/remove-azfunctionappplan) command as follows to delete the Consumption plan you migrated from:
HTTP triggered functions can generally be called by using a URL in the format: `https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>`. When the authorization to your function is set a value other than `anonymous`, you must also provide an access key in your request. The access key can either be provided in the URL using the `?code=` query string or in the request header. To learn more, see [Function access keys](functions-bindings-http-webhook-trigger.md#authorization-keys). There are several ways to get your access keys.
259
346
260
-
# [Portal](#tab/portal)
347
+
### [Portal](#tab/portal)
261
348
262
349
1. Sign in to the Azure portal, then search for and select **Function App**.
263
350
@@ -269,7 +356,7 @@ HTTP triggered functions can generally be called by using a URL in the format: `
269
356
270
357
You can also practice least privilege by using the key just for the specific function key by selecting **Function keys** under **Developer** in your HTTP triggered function.
271
358
272
-
# [Azure CLI](#tab/azure-cli)
359
+
### [Azure CLI](#tab/azure-cli)
273
360
274
361
Run the following script in Azure Cloud Shell, the output of which is the [default (host) key](functions-bindings-http-webhook-trigger.md#authorization-scopes-function-level) that can be used to access any HTTP triggered function in the function app.
275
362
@@ -283,7 +370,7 @@ az rest --method POST --uri $path --query functionKeys.default --output tsv
283
370
284
371
In this script, replace `<SUBSCRIPTION_ID>` and `<APP_NAME>` with the ID of your subscription and your function app name, respective. This script runs on Bash in Cloud Shell. It must be modified to run in a Windows command prompt.
285
372
286
-
# [Azure PowerShell](#tab/azure-powershell)
373
+
###[Azure PowerShell](#tab/azure-powershell)
287
374
288
375
Run the following script, the output of which is the [default (host) key](functions-bindings-http-webhook-trigger.md#authorization-scopes-function-level) that can be used to access any HTTP triggered function in the function app.
289
376
@@ -395,14 +482,16 @@ When you use a source control solution to develop and maintain your functions co
395
482
396
483
To prevent malicious code execution on the client, modern browsers block requests from web applications to resources running in a separate domain. [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/docs/Web/HTTP/CORS) lets an `Access-Control-Allow-Origin` header declare which origins are allowed to call endpoints on your function app.
397
484
398
-
#### Portal
485
+
#### [Portal](#tab/portal)
399
486
400
487
When you configure the **Allowed origins** list for your function app, the `Access-Control-Allow-Origin` header is automatically added to all responses from HTTP endpoints in your function app.
401
488
402
489

403
490
404
491
The wildcard (\*) is ignored if there's another domain entry.
405
492
493
+
#### [Azure CLI](#tab/azure-cli)
494
+
406
495
Use the [`az functionapp cors add`](/cli/azure/functionapp/cors#az-functionapp-cors-add) command to add a domain to the allowed origins list. The following example adds the contoso.com domain:
407
496
408
497
```azurecli-interactive
@@ -413,6 +502,12 @@ az functionapp cors add --name <FUNCTION_APP_NAME> \
413
502
414
503
Use the [`az functionapp cors show`](/cli/azure/functionapp/cors#az-functionapp-cors-show) command to list the current allowed origins.
415
504
505
+
#### [Azure PowerShell](#tab/azure-powershell)
506
+
507
+
You can't currently update CORS settings using Azure PowerShell.
508
+
509
+
---
510
+
416
511
### <a name="auth"></a>Authentication
417
512
418
513

0 commit comments