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
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-develop-vs-code.md
+65-11Lines changed: 65 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -302,15 +302,15 @@ The `@queue_output` decorator on the function is used to define a named binding
302
302
303
303
Before you can publish your Functions project to Azure, you must have a function app and related resources in your Azure subscription to run your code. The function app provides an execution context for your functions. When you publish from Visual Studio Code to a function app in Azure, the project is packaged and deployed to the selected function app in your Azure subscription.
304
304
305
-
When you create a function app in Azure, you can choose either a quick function app create path using defaults or an advanced path. This way, you have more control over creating the remote resources.
305
+
When you create a function app in Azure, you can choose either a quick function app create path using defaults or a path that gives you advanced options, such as using existing Azure resources. This way, you have more control over creating the remote resources.
###<aname="enable-publishing-with-advanced-create-options"></a>Publish a project to a new function app in Azure by using advancedoptions
311
+
#### [Advanced options](#tab/advanced-options)
312
312
313
-
The following steps publish your project to a new function app created with advanced create options:
313
+
You can't use the [quick create](#quick-function-app-create) if you want more control over the function app that gets created, such as using an existing resouce group, storage account, or Application Insights intance. These steps create a function app with the ability to use existing Azure resources:
314
314
315
315
1. In the command palette, enter **Azure Functions: Create function app in Azure...(Advanced)**.
316
316
@@ -324,31 +324,85 @@ The following steps publish your project to a new function app created with adva
324
324
| Select a runtime stack. | Choose the language version that you're locally running. |
325
325
| Select an OS. | Choose either Linux or Windows. Python apps must run on Linux. |
326
326
| Select a resource group for new resources. | Choose **Create new resource group**, and enter a resource group name such as **myResourceGroup**. You can also select an existing resource group. |
327
-
| Select a location for new resources. | Select a location in a [region](https://azure.microsoft.com/regions/) near you or near other services that your functions access. |
327
+
| Select a location for new resources. | Select a location in a [region](https://azure.microsoft.com/regions/) near you or near other services that your functions access. If you chose an existing resource group, that location is used and you don't see this prompt. |
328
328
| Select a hosting plan. | Choose **Consumption** for serverless [Consumption plan hosting](consumption-plan.md), where you're charged only when your functions run. |
329
329
| Select a storage account. | Choose **Create new storage account**, and at the prompt, enter a globally unique name for the new storage account used by your function app. Storage account names must be between 3 and 24 characters long and can contain only numbers and lowercase letters. You can also select an existing account. |
330
330
| Select an Application Insights resource for your app. | Choose **Create new Application Insights resource**, and at the prompt, enter a name for the instance used to store runtime data from your functions. |
331
331
332
332
A notification appears after your function app is created, and the deployment package is applied. To view the creation and deployment results, including the Azure resources that you created, select **View Output** in this notification.
333
333
334
-
### <aname="get-the-url-of-the-deployed-function"></a>Get the URL of an HTTP triggered function in Azure
334
+
---
335
335
336
-
To call an HTTP-triggered function from a client, you need the function's URL, which is available after deployment to your function app. This URL includes any required function keys. You can use the extension to get these URLs for your deployed functions. If you just want to run the remote function in Azure, [use the Execute function now](#run-functions-in-azure) functionality of the extension.
336
+
## Create an Azure Container Apps deployment
337
337
338
-
1. Select F1 to open the command palette, and then find and run the command **Azure Functions: Copy Function URL**.
338
+
You use Visual Studio Code to create Azure resources for a containerized code project. When the extension detects the presence of a Dockerfile during resource creation, it asks you if you want to deploy the container image instead of just the code. Visual Studio Code creates an Azure Container Apps environment for your containerized code project that's integrated with Azure Functions. For more information, see [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
339
339
340
-
1. Follow the prompts to select your function app in Azure and then the specific HTTP trigger that you want to invoke.
340
+
>[!NOTE]
341
+
>Container deployment requires the [Azure Container Apps extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurecontainerapps). This extension is currently in preview.
341
342
342
-
The function URL is copied to the clipboard, along with any required keys passed by the `code` query parameter. Use an HTTP tool to submit POST requests, or a browser to submit GET requests to the remote function.
343
+
The create process depends on whether you choose a quick create or you need to use advanced options:
343
344
344
-
When the extension gets the URL of a function in Azure, the extension uses your Azure account to automatically retrieve the keys needed to start the function. [Learn more about function access keys](security-concepts.md#function-access-keys). Starting non-HTTP triggered functions requires using the admin key.
345
+
#### [Quick create](#tab/quick-create)
346
+
347
+
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette and search for and run the command `Azure Functions: Create Function App in Azure...`.
348
+
349
+
1. When prompted choose **Container image**.
350
+
351
+
1. Provide the following information at the prompts:
352
+
353
+
|Prompt|Selection|
354
+
|--|--|
355
+
|**Select subscription**| Choose the subscription to use. You won't see this prompt when you have only one subscription visible under **Resources**. |
356
+
|**Enter a globally unique name for the function app**| Type a name that is valid in a URL path. The name you type is validated to make sure that it's unique in Azure Functions.|
357
+
|**Select a location for new resources**| For better performance, choose a [region](https://azure.microsoft.com/regions/) near you.|
358
+
359
+
The extension shows the status of individual resources as they're being created in Azure in the **Azure: Activity Log** panel.
360
+
361
+
#### [Advanced options](#tab/advanced-options)
362
+
363
+
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette and search for and run the command `Azure Functions: Create Function App in Azure...(Advanced)`.
364
+
365
+
1. When prompted choose **Container image**.
366
+
367
+
1. If you're not signed in, you're prompted to **Sign in to Azure**. You can also **Create a free Azure account**. After signing in from the browser, go back to Visual Studio Code.
368
+
369
+
1. Following the prompts, provide this information:
370
+
371
+
| Prompt | Selection |
372
+
| ------ | --------- |
373
+
| Enter a globally unique name for the new function app. | Type a globally unique name that identifies your new function app and then select Enter. Valid characters for a function app name are `a-z`, `0-9`, and `-`. |
374
+
| Select a resource group for new resources. | Choose **Create new resource group**, and enter a resource group name such as **myResourceGroup**. You can also select an existing resource group. |
375
+
| Select a location for new resources. | Select a location in a [region](https://azure.microsoft.com/regions/) near you or near other services that your functions access. If you chose an existing resource group, that location is used and you don't see this prompt. |
376
+
| Select a storage account. | Choose **Create new storage account**, and at the prompt, enter a globally unique name for the new storage account used by your function app. Storage account names must be between 3 and 24 characters long and can contain only numbers and lowercase letters. You can also select an existing account. |
377
+
| Select an Application Insights resource for your app. | Choose **Create new Application Insights resource**, and at the prompt, enter a name for the instance used to store runtime data from your functions. |
378
+
379
+
A notification appears after your function app is created, and the deployment package is applied. To view the creation and deployment results, including the Azure resources that you created, select **View Output** in this notification.
380
+
381
+
---
382
+
383
+
For more information about the resources required to run your containerized functions in Container Apps, see [Required resources](functions-infrastructure-as-code.md?pivots=container-apps#required-resources).
384
+
385
+
>[!NOTE]
386
+
>You can't currently deploy a containerized function app to an Azure Functions-integrated Container Apps environment. You must publish your container image to a container registry and then set that image in the registry as the deployment source for your Container Apps-hosted function app. For more information, see [Create your function app in a container](functions-how-to-custom-container.md#create-your-function-app-in-a-container) and [Update an image in the registry](functions-how-to-custom-container.md#update-an-image-in-the-registry).
We recommend setting up [continuous deployment](functions-continuous-deployment.md) so that your function app in Azure is updated when you update source files in the connected source location. You can also deploy your project files from Visual Studio Code. When you publish from Visual Studio Code, you can take advantage of the [Zip deploy technology](functions-deployment-technologies.md#zip-deploy).
## <aname="get-the-url-of-the-deployed-function"></a>Get the URL of an HTTP triggered function in Azure
395
+
396
+
To call an HTTP-triggered function from a client, you need the function's URL, which is available after deployment to your function app. This URL includes any required function keys. You can use the extension to get these URLs for your deployed functions. If you just want to run the remote function in Azure, [use the Execute function now](#run-functions-in-azure) functionality of the extension.
397
+
398
+
1. Select F1 to open the command palette, and then find and run the command **Azure Functions: Copy Function URL**.
399
+
400
+
1. Follow the prompts to select your function app in Azure and then the specific HTTP trigger that you want to invoke.
401
+
402
+
The function URL is copied to the clipboard, along with any required keys passed by the `code` query parameter. Use an HTTP tool to submit POST requests, or a browser to submit GET requests to the remote function.
403
+
404
+
When the extension gets the URL of a function in Azure, the extension uses your Azure account to automatically retrieve the keys needed to start the function. [Learn more about function access keys](security-concepts.md#function-access-keys). Starting non-HTTP triggered functions requires using the admin key.
405
+
352
406
## Run functions
353
407
354
408
The Azure Functions extension lets you run individual functions. You can run functions either in your project on your local development computer or in your Azure subscription.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-how-to-custom-container.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,13 +40,13 @@ Functions makes it easy to deploy and run your function apps as Linux containers
40
40
41
41
For a complete example of how to create the local containerized function app from the command line and publish the image to a container registry, see [Create a function app in a local container](functions-create-container-registry.md).
42
42
43
-
###Generate the Dockerfile
43
+
## Generate the Dockerfile
44
44
45
45
Functions tooling provides a Docker option that generates a Dockerfile with your functions code project. You can use this file with Docker to create your functions in a container that derives from the correct base image (language and version).
46
46
47
47
The way you create a Dockerfile depends on how you create your project.
48
48
49
-
####[Command line](#tab/core-tools)
49
+
### [Command line](#tab/core-tools)
50
50
51
51
+ When you create a Functions project using [Azure Functions Core Tools](./functions-run-local.md), include the `--docker` option when you run the [`func init`](./functions-core-tools-reference.md#func-init) command, as in the following example:
52
52
@@ -61,7 +61,7 @@ The way you create a Dockerfile depends on how you create your project.
61
61
62
62
For a complete example, see [Create a function app in a local container](functions-create-container-registry.md#create-and-test-the-local-functions-project).
63
63
64
-
#### [Visual Studio Code](#tab/vs-code)
64
+
### [Visual Studio Code](#tab/vs-code)
65
65
66
66
The Azure Functions extension for Visual Studio Code creates your Dockerfile when it creates your code project. To create a containerized code project:
67
67
@@ -71,7 +71,7 @@ The Azure Functions extension for Visual Studio Code creates your Dockerfile whe
71
71
72
72
1. After your project is created, you can open and review the Dockerfile in the root folder you chose for your project.
73
73
74
-
#### [Visual Studio](#tab/vs)
74
+
### [Visual Studio](#tab/vs)
75
75
76
76
+ When you create a Functions project, make sure to check the **Enable Docker** option on the **Additional Information** page of the new project dialog.
77
77
@@ -83,7 +83,7 @@ The Azure Functions extension for Visual Studio Code creates your Dockerfile whe
83
83
84
84
---
85
85
86
-
### Creating your function app in a container
86
+
## Create your function app in a container
87
87
88
88
With a Functions-generated Dockerfile in your code project, you can use Docker to create the containerized function app on your local computer. The following `docker build` command creates an image of your containerized functions from the project in the local directory:
89
89
@@ -278,7 +278,7 @@ You can add, edit, and delete profiles in your environment. For an example, see
278
278
When you create a containerized function app in an environment that has workload profiles enabled, you should also specify the profile in which to run. You do this by using the `--workload-profile-name` parameter of the [`az functionapp create`](/cli/azure/functionapp#az-functionapp-create) command, like in this example:
In the [`az functionapp create`](/cli/azure/functionapp#az-functionapp-create) command, the `--environment` parameter specifies the Container Apps environment and the `--image` parameter specifies the image to use for the function app. In this example, replace `<STORAGE_NAME>` with the name you used in the previous section for the storage account. Also, replace `<APP_NAME>` with a globally unique name appropriate to you.
Copy file name to clipboardExpand all lines: includes/functions-create-azure-resources-vs-code.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: glenga
7
7
ms.custom: devdivchpfy22
8
8
---
9
9
10
-
In this section, you create a function app and related resources in your Azure subscription.
10
+
In this section, you create a function app and related resources in your Azure subscription. Many of the resource creation decisions are made for you based on default behaviors.
11
11
12
12
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette and search for and run the command `Azure Functions: Create Function App in Azure...`.
0 commit comments