Skip to content

Commit ebac4b9

Browse files
committed
VS Code new stuff done
1 parent 3b4b52d commit ebac4b9

File tree

3 files changed

+72
-18
lines changed

3 files changed

+72
-18
lines changed

articles/azure-functions/functions-develop-vs-code.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ The `@queue_output` decorator on the function is used to define a named binding
302302

303303
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.
304304

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.
306306

307-
### Quick function app create
307+
#### [Quick create](#tab/quick-create)
308308

309309
[!INCLUDE [functions-create-azure-resources-vs-code](../../includes/functions-create-azure-resources-vs-code.md)]
310310

311-
### <a name="enable-publishing-with-advanced-create-options"></a>Publish a project to a new function app in Azure by using advanced options
311+
#### [Advanced options](#tab/advanced-options)
312312

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:
314314

315315
1. In the command palette, enter **Azure Functions: Create function app in Azure...(Advanced)**.
316316

@@ -324,31 +324,85 @@ The following steps publish your project to a new function app created with adva
324324
| Select a runtime stack. | Choose the language version that you're locally running. |
325325
| Select an OS. | Choose either Linux or Windows. Python apps must run on Linux. |
326326
| 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. |
328328
| Select a hosting plan. | Choose **Consumption** for serverless [Consumption plan hosting](consumption-plan.md), where you're charged only when your functions run. |
329329
| 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. |
330330
| 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. |
331331

332332
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.
333333

334-
### <a name="get-the-url-of-the-deployed-function"></a>Get the URL of an HTTP triggered function in Azure
334+
---
335335

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
337337

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).
339339

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.
341342
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:
343344

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).
345387
346388
## <a name="republish-project-files"></a>Deploy project files
347389

348390
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).
349391

350392
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
351393

394+
## <a name="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+
352406
## Run functions
353407

354408
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.

articles/azure-functions/functions-how-to-custom-container.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ Functions makes it easy to deploy and run your function apps as Linux containers
4040

4141
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).
4242

43-
### Generate the Dockerfile
43+
## Generate the Dockerfile
4444

4545
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).
4646

4747
The way you create a Dockerfile depends on how you create your project.
4848

49-
#### [Command line](#tab/core-tools)
49+
### [Command line](#tab/core-tools)
5050

5151
+ 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:
5252

@@ -61,7 +61,7 @@ The way you create a Dockerfile depends on how you create your project.
6161

6262
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).
6363

64-
#### [Visual Studio Code](#tab/vs-code)
64+
### [Visual Studio Code](#tab/vs-code)
6565

6666
The Azure Functions extension for Visual Studio Code creates your Dockerfile when it creates your code project. To create a containerized code project:
6767

@@ -71,7 +71,7 @@ The Azure Functions extension for Visual Studio Code creates your Dockerfile whe
7171

7272
1. After your project is created, you can open and review the Dockerfile in the root folder you chose for your project.
7373

74-
#### [Visual Studio](#tab/vs)
74+
### [Visual Studio](#tab/vs)
7575

7676
+ When you create a Functions project, make sure to check the **Enable Docker** option on the **Additional Information** page of the new project dialog.
7777

@@ -83,7 +83,7 @@ The Azure Functions extension for Visual Studio Code creates your Dockerfile whe
8383

8484
---
8585

86-
### Creating your function app in a container
86+
## Create your function app in a container
8787

8888
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:
8989

@@ -278,7 +278,7 @@ You can add, edit, and delete profiles in your environment. For an example, see
278278
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:
279279

280280
```azurecli
281-
az functionapp create --name <APP_NAME> --storage-account <STORAGE_NAME> --environment MyContainerappEnvironment --resource-group AzureFunctionsContainers-rg --functions-version 4 --runtime <LANGUAGE_STACK> --image <IMAGE_URI> --workload-profile-name <PROFILE_NAME> --cpu <CPU_COUNT> --memory <MEMORY_SIZE>
281+
az functionapp create --name <APP_NAME> --storage-account <STORAGE_NAME> --environment MyContainerappEnvironment --resource-group AzureFunctionsContainers-rg --functions-version 4 --runtime <LANGUAGE_STACK> --image <IMAGE_URI> --workload-profile-name <PROFILE_NAME> --cpu <CPU_COUNT> --memory <MEMORY_SIZE>
282282
```
283283

284284
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.

includes/functions-create-azure-resources-vs-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: glenga
77
ms.custom: devdivchpfy22
88
---
99

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.
1111

1212
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...`.
1313

0 commit comments

Comments
 (0)