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/javascript/core/configure-local-development-environment.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
title: Configure your local JavaScript environment for Azure development
3
3
description: How to set up a local JavaScript dev environment for working with Azure, including an editor, the Azure SDK libraries, optional tools, and the necessary credentials for library authentication.
# Configure your JavaScript develop environment for Azure
10
10
11
-
When creating cloud applications, developers typically prefer to test code on their local workstations before deploying that code to a cloud environment like Azure. Local development gives you the advantage of a wider variety of tools along with a familiar environment.
11
+
When you create cloud applications, developers typically prefer to test code on their local workstations before deploying that code to a cloud environment like Azure. Local development gives you the advantage of a wider variety of tools along with a familiar environment.
12
12
13
13
This article provides setup instructions to create and validate a local development environment that's suitable for JavaScript with Azure.
14
14
@@ -38,24 +38,25 @@ This article provides setup instructions to create and validate a local developm
38
38
:::column-end:::
39
39
:::column span="2":::
40
40
If you already have a subscription, access your existing subscription with:
41
-
*[Azure portal](https://portal.azure.com)
42
-
*[Azure CLI](/cli/azure/install-azure-cli)
43
-
*[Azure client libraries for JavaScript](../azure-sdk-library-package-index.md)
44
-
*[Visual Studio Code extensions](https://marketplace.visualstudio.com/search?term=azure&target=VSCode&category=Azure&sortBy=Relevance)
41
+
42
+
* [Azure portal](https://portal.azure.com)
43
+
* [Azure CLI](/cli/azure/install-azure-cli)
44
+
* [Azure client libraries for JavaScript](../azure-sdk-library-package-index.md)
45
+
* [Visual Studio Code extensions](https://marketplace.visualstudio.com/search?term=azure&target=VSCode&category=Azure&sortBy=Relevance)
45
46
:::column-end:::
46
47
:::row-end:::
47
48
:::row:::
48
49
:::column span="1":::
49
50
Across multiple subscriptions
50
51
:::column-end:::
51
-
:::column span="2":::
52
+
:::column span="2":::
52
53
If you need to manage multiple subscriptions, [learn how](/azure/governance/management-groups/create-management-group-javascript) to create a management group with JavaScript.
53
54
:::column-end:::
54
55
:::row-end:::
55
56
56
57
## One-time software installation
57
58
58
-
Azure development with JavaScript on your local workstation, we suggest you install the following:
59
+
Azure development with JavaScript on your local workstation, we suggest you install the following tools:
59
60
60
61
|Name/Installer|Description|
61
62
|--|--|
@@ -136,7 +137,7 @@ set AZURE_CLIENT_SECRET="<REPLACE-WITH-YOUR-AZURE-CLIENT-SECRET>"
136
137
137
138
---
138
139
139
-
Replace the values shown in these commands with those of your specific environment variable.
140
+
Replace the values in `<>` brackets in these commands with those of your specific environment variable.
140
141
141
142
### Create `.env` file
142
143
@@ -158,9 +159,9 @@ For every project, we recommend that you always create a separate folder, and it
158
159
npm init -y
159
160
```
160
161
161
-
This creates the package.json file and initializes the minimum properties.
162
+
This command creates the package.json file and initializes the minimum properties.
162
163
163
-
1. Install the Azure cl libraries you need, such as this example:
164
+
1. Install the Azure client libraries you need, such as this authentication client library example:
164
165
165
166
```console
166
167
npm install @azure/identity
@@ -180,10 +181,10 @@ We recommend that you get into the habit of creating a source control repository
180
181
181
182
1. Create a new repository on [GitHub](https://github.com/new) and copy the repository URL for the next few step.
182
183
183
-
1. In the Visual Studio integrated terminal, use the following [git](https://git-scm.com/docs) command to add your remote repository to your local repository. Replace `YOUR-ALIAS` and `YOUR-REPOSITORY` with your own values.
184
+
1. In the Visual Studio integrated terminal, use the following [git](https://git-scm.com/docs) command to add your remote repository to your local repository. Replace `<YOUR-ACCOUNT>` and `<REPOSITORY>` with your own values.
Visual Studio Code includes many built-in git features. For more information, see [Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol).
@@ -57,7 +57,7 @@ Visual Studio Code uses Git authentication provided by the operating system (suc
57
57
58
58
## Open your local repository
59
59
60
-
If you have an existing repository on your local computer and want to open it in Visual Studio Code, just open the folder. Visual Studio Code recognizes the `.git` subfolder and display the relevant information.
60
+
If you have an existing repository on your local computer and want to open it in Visual Studio Code, just open the folder. Visual Studio Code recognizes the `.git` subfolder and displays the relevant information.
61
61
62
62
### [Activity bar](#tab/activity-bar)
63
63
@@ -170,7 +170,7 @@ Create a new branch to capture changes and isolate from the main or default bran
170
170
171
171
## Commit changes locally
172
172
173
-
Once you have made changes on your branch, commit the changes.
173
+
Once you make changes to files on your branch, commit the changes.
174
174
175
175
### [Activity bar](#tab/activity-bar)
176
176
@@ -220,7 +220,7 @@ This action isn't available from this feature. Select a different tab.
220
220
221
221
1. Open the command palette with the key combination of <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>.
222
222
1. In the command palette, filter with `Git` then select `Push`.
223
-
1. If you have multiple upstream remotes, select the remote then press <kbd>Enter</kbd>.
223
+
1. If you have multiple upstream remotes, select a remote name then press <kbd>Enter</kbd>.
Use a static web app to upload files directly to an Azure Storage blob using the @azure/storage-blob package. The API generates a SAS token following the [Valet Key pattern](/azure/architecture/patterns/valet-key), which lets you securely delegate limited access without exposing full credentials.
14
14
15
15
> [!CAUTION]
16
-
> This tutorial shows you how to host your function app in a Consumption Plan. When you plan to secure your connections by using Microsoft Entra ID with managed identities, you should instead consider hosting your app in the [Flex Consumption plan](/azure/azure-functions/flex-consumption-plan). The Flex Consumption plan has been designed to optimize security by supporting the use of managed identities without any of the tradeoffs required when running in a Consumption or Premium plan. Flex Consumption also fully supports virtual network integration.
16
+
> This tutorial shows you how to host your function app in a Consumption Plan. When you plan to secure your connections by using Microsoft Entra ID with managed identities, you should instead consider hosting your app in the [Flex Consumption plan](/azure/azure-functions/flex-consumption-plan). The **Flex Consumption** tier optimizes security by supporting the use of managed identities and virtual network integration.
17
17
18
18
## Prerequisites
19
19
@@ -126,10 +126,10 @@ The [Dev Containers extension](https://marketplace.visualstudio.com/items?itemNa
126
126
>
127
127
> :::image type="content" source="media/browser-file-upload-azure-storage-blob/open-terminal-option.png" lightbox="media/browser-file-upload-azure-storage-blob/open-terminal-option.png" alt-text="Screenshot of the menu option to open a new terminal.":::
128
128
129
-
1. Clone your fork into the current directory. Replace `YOUR-ACCOUNT`in the following command with your account name.
129
+
1. Clone your fork into the current directory. Replace `<YOUR-ACCOUNT>`in the following command with your account name.
## Create Storage resource with Visual Studio extension
191
+
## Create storage resource with Visual Studio extension
192
192
193
-
Create the Storage resource to use with the sample app. Storage is used for:
193
+
Create the Azure Storage resource to use with the sample app. Storage is used for:
194
194
195
195
* Triggers in the Azure Functions app
196
196
* Blob (file) storage
@@ -206,7 +206,7 @@ Create the Storage resource to use with the sample app. Storage is used for:
206
206
207
207
|Property|Value|
208
208
|--|--|
209
-
|Enter a globally unique name forthe new web app.| Enter a unique value such as `fileuploadstor`, for your Storage resource name.<br><br> This unique name is **your resource name** usedin the next section. Use only characters and numbers, up to 24in length. You need this **account name** to use later.|
209
+
|Enter a globally unique name forthe new web app.| Enter a unique value such as `fileuploadstor`, for your Storage resource name.<br><br> This unique name is **your resource name** usedin the next section. Use a maximum of 24 alphanumeric charactersin length. You need this **account name** to use later.|
210
210
|Select a location for new resources.|Use the recommended location.|
211
211
212
212
1. When the app creation process is complete, a notification appears with information about the new resource.
@@ -249,9 +249,9 @@ Create a private container which has publicly readable blobs.
249
249
250
250
## Grant yourself Blob Data access
251
251
252
-
While you created the resource, you don't have permission to view the contents of the container. That is reserved forspecific IAM roles. Add your account so you can view the blobsin the containers.
252
+
While you created the resource, you don't have permission to view the contents of the container. This authorization is reserved forspecific IAM roles. Add your account so you can view the blobsin the containers.
253
253
254
-
1. Still in the Azure portal storage account, select**Access Control (IAM)**.
254
+
1. In the Azure portal storage account, select**Access Control (IAM)**.
255
255
1. Select **Add role assignments**.
256
256
1. Search and select**Storage Blob Data Contributor**. Select **Next**.
257
257
1. Select **+ Select members**.
@@ -265,7 +265,7 @@ The Storage resource credentials are used in the Azure Functions API app to conn
265
265
266
266
1. While still in the Azure portal, in the **Security + networking** section, select**Access keys**.
267
267
1. Copy the `Key ` key.
268
-
1. In Visual Studio Code, in the `./workspaces/azure-typescript-e2e-apps/azure-upload-file-to-storage/api`folder, **rename** the file from `local.settings.json.sample` to `local.settings.json`. The file is ignored by Git so it won't be checked into source control.
268
+
1. In Visual Studio Code, in the `./workspaces/azure-typescript-e2e-apps/azure-upload-file-to-storage/api`folder, **rename** the file from `local.settings.json.sample` to `local.settings.json`. The file is ignored by Git so it isn't be checked into source control.
269
269
1. Update the settings for `local.settings.json` using the following table.
270
270
271
271
|Property|Value|Description|
@@ -274,7 +274,7 @@ The Storage resource credentials are used in the Azure Functions API app to conn
274
274
|Azure_Storage_AccountKey|Azure Storage account key|Used in source code to connect to Storage resource.|
275
275
|AzureWebJobsStorage|Azure Storage account connection string|Use by Azure Functions runtime to store state and logs.|
276
276
277
-
It may seem like you entered the same account credentials twice, once as a key and once as a connection string. You did, but specifically for this simple tutorial. Generally speaking, Azure Functions apps should have a separate Storage resource that isn't reused foranother purpose. When you create the Azure Function resource laterin the tutorial, you won't need to set the **AzureWebJobsStorage** value for the cloud resource. You'll only need to set the **Azure_Storage_AccountName** and **Azure_Storage_AccountKey** values which are used insource code.
277
+
It may seem like you entered the same account credentials twice, once as a key and once as a connection string. You did, but specifically for this simple tutorial. Generally speaking, Azure Functions apps should have a separate Storage resource that isn't reused foranother purpose. When you create the Azure Function resource laterin the tutorial, you won't need to set the **AzureWebJobsStorage** value for the cloud resource. You'll need to set the **Azure_Storage_AccountName** and **Azure_Storage_AccountKey** values which are used insource code.
278
278
279
279
## Run the API app
280
280
@@ -312,7 +312,7 @@ Run the Functions App to make sure it works correctly before deploying it to Azu
1. Copy the base of the API URL in the browser address bar (not the SAS token URL in the JSON object) to use in the next step. The base URL is everything before `/api/sas`. You will paste this into the client app environment variable file in the next section.
315
+
1. Copy the base of the API URL in the browser address bar (not the SAS token URL in the JSON object) to use in the next step. The base URL is everything before `/api/sas`. You'll paste this base URL into the client app environment variable file in the next section.
316
316
317
317
## Configure and run the client app
318
318
@@ -339,7 +339,7 @@ Run the Functions App to make sure it works correctly before deploying it to Azu
339
339
340
340
1. Select the **Ports** tab in the bottom pane then right-click the **5173** port and selectthe globe icon.
341
341
342
-
1. You should see the simple web app.
342
+
1. You should see the web app.
343
343
344
344
:::image type="content" source="media/browser-file-upload-azure-storage-blob/browser-app-select-file.png" alt-text="Screenshot of web browser showing web app with Select File button available.":::
345
345
@@ -360,7 +360,7 @@ Run the Functions App to make sure it works correctly before deploying it to Azu
360
360
361
361
## Deploy static web app to Azure
362
362
363
-
The Azure Functions app is using a preview feature, it must be deployed to **West US 2** to function properly.
363
+
The Azure Functions app is using a preview feature. It must be deployed to **West US 2** to functionproperly.
364
364
365
365
1. In Visual Studio Code, selectthe Azure explorer.
366
366
@@ -383,7 +383,7 @@ The Azure Functions app is using a preview feature, it must be deployed to **Wes
383
383
|*Choose build preset to configure default project structure.*|Select **Custom**.|
384
384
|*Select the location of your application code*|`azure-upload-file-to-storage/app`|
385
385
|*Select the location of your Azure Functions code*|`azure-upload-file-to-storage/api`|
386
-
|*Enter the path of your build output...*|`dist`<br><br>This is the path from your app to your static (generated) files.|
386
+
|*Enter the path of your build output...*|`dist`<br><br> value is the path from your app to your static (generated) files.|
387
387
|*Select a location for new resources.*|Select a region close to you.|
388
388
389
389
1. When the process is complete, a notification pop-up displays. Select **View/Edit Workflow**.
@@ -406,7 +406,7 @@ The Azure Functions app is using a preview feature, it must be deployed to **Wes
406
406
###### End of Repository/Build Configurations ######
407
407
```
408
408
409
-
1. Go to your GitHub fork of the sample, `https://github.com/YOUR-ACCOUNT/azure-typescript-e2e-apps/actions` to verify the build and deploy action, named `Azure Static Web Apps CI/CD`, completed successfully. This may take a few minutes to complete.
409
+
1. Go to your GitHub fork of the sample, `https://github.com/<YOUR-ACCOUNT>/azure-typescript-e2e-apps/actions` to verify the build and deploy action, named `Azure Static Web Apps CI/CD`, completed successfully. This action may take a few minutes to complete.
410
410
411
411
1. Go to your Azure portal for your app and view the **APIs** section of **Settings**. The **Backend Resource Name** in the production environment is `(managed)` indicating your APIs are successfully deployed.
412
412
1. Select **(managed)** to see the list of APIs loaded in the app:
@@ -446,13 +446,13 @@ Verify the deploy and configuration succeeded by using the web site.
446
446
447
447
## Clean up resources
448
448
449
-
In Visual Studio Code, use the Azure explorer for Resource Groups, right-click on your resource group thenselect**Delete**.
449
+
In Visual Studio Code, use the Azure explorer for Resource Groups. Right-click on your resource group then select **Delete**.
450
450
451
-
This deletes all resources in the group, including your Storage and Static Web app resources.
451
+
This action deletes all resources in the group, including your Storage and Static Web app resources.
452
452
453
453
## Troubleshooting
454
454
455
-
Report [issues](https://github.com/Azure-Samples/azure-typescript-e2e-apps/issues) with this sample in the GitHub repo noted below. Include the following with the issue:
455
+
Report [issues](https://github.com/Azure-Samples/azure-typescript-e2e-apps/issues) with this sample in the GitHub repo. Include the following with the issue:
456
456
457
457
* The URL of the article
458
458
* The step or context within the article that was problematic
0 commit comments