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
# Publish an add-in developed with Visual Studio Code
9
+
# Publish an Office Add-in from Visual Studio Code to Azure
10
10
11
-
This article describes how to publish an Office Add-in that you created using the Yeoman generator and developed with [Visual Studio Code (VS Code)](https://code.visualstudio.com) or any other editor.
11
+
One way to publish your Office Add-in is by deploying its web app to Azure. This article shows the end-to-end flow for add-ins that use the add-in only manifest and that were created with the Yeoman Generator for Office Add-ins.
12
12
13
13
> [!NOTE]
14
14
>
15
15
> - For information about publishing an Office Add-in that you created using Visual Studio, see [Publish your add-in using Visual Studio](package-your-add-in-using-visual-studio.md).
16
16
> - The process described in this article doesn't apply to add-ins that use the [unified manifest for Microsoft 365](../develop/unified-manifest-overview.md). Add-ins created using Microsoft 365 Agents Toolkit use the unified manifest. For information about publishing an add-in that you created using Agents Toolkit, see [Deploy Teams app to the cloud](/microsoftteams/platform/toolkit/deploy?pivots=visual-studio-code) and [Deploy your first Teams app](/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode). The latter article is about Teams tab apps, but it is applicable to Office Add-ins created with Agents Toolkit.
17
17
18
-
## Publishing an add-in for other users to access
18
+
## Publish for other users
19
19
20
-
The simplest Office Add-in is made up of a manifest file and an HTML page. The manifest file describes the add-in's characteristics, such as its name, what Office applications it can run in, and the URL for the add-in's HTML page. The HTML page is contained in a web app that users interact with when they install and run your add-in within an Office application. You can host the web app of an Office Add-in on any web hosting platform, including Azure.
20
+
An Office Add-in includes a manifest file and a web app. The manifest defines key details, such as the Office apps that support your add-in and the web app URL.
21
21
22
-
While you're developing, you can run the add-in on your local web server (`localhost`). When you're ready to publish it for other users to access, you'll need to deploy the web application and update the manifest to specify the URL of the deployed application.
22
+
During development, you run the add-in on localhost. To publish it for other users, deploy the web app and update the manifest to use the deployed URL.
23
23
24
-
When your add-in is working as desired, you can publish it directly through Visual Studio Code using the Azure Storage extension.
24
+
You can complete this process directly in Visual Studio Code by using the Azure Storage extension.
25
+
26
+
## Prerequisites
27
+
28
+
- An Office Add-in project created with the Yeoman generator for Office Add-ins that uses the add-in only manifest.
29
+
-[Visual Studio Code](https://code.visualstudio.com).
30
+
- An Azure account and permission to create Azure Storage accounts.
25
31
26
32
## Using Visual Studio Code to publish
27
33
28
-
>[!NOTE]
29
-
> These steps only work for projects created with the Yeoman generator, and that use the add-in only manifest. They don't apply if you created the add-in using Agents Toolkit or created it with the Yeoman generator and it uses the unified manifest for Microsoft 365.
34
+
>[!NOTE]
35
+
> These steps only work for projects created with the Yeoman generator for Office Add-ins, and that use the add-in only manifest. They don't apply if you created the add-in using Agents Toolkit or created it with the Yeoman generator and it uses the unified manifest for Microsoft 365.
30
36
31
37
1. Open your project from its root folder in Visual Studio Code (VS Code).
32
38
1. Select **View** > **Extensions** (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd>) to open the Extensions view.
@@ -36,7 +42,7 @@ When your add-in is working as desired, you can publish it directly through Visu
36
42
37
43
:::image type="content" source="../images/azure-extension-sign-in.png" alt-text="Sign in to Azure button selected in the Azure extension.":::
38
44
39
-
1. Once you're signed in, you'll see your Azure storage accounts appear in the extension. If you don't already have a storage account, create one using the **Create Storage Account**option in the command palette. Name your storage account a globally unique name, using only 'a-z' and '0-9'. Note that by default, this creates a storage account and a resource group with the same name. It automatically puts the storage account in West US. This can be adjusted online through [your Azure account](https://portal.azure.com/).
45
+
1. Once you're signed in, your Azure Storage accounts appear in the extension. If you don't already have one, create one by using the **Create Storage Account** command. Use a globally unique account name with only `a-z` and `0-9`. By default, this creates a storage account and a resource group with the same namein West US. You can change these settings in [Azure portal](https://portal.azure.com/).
40
46
41
47
:::image type="content" source="../images/azure-extension-create-storage-account.png" alt-text="Selecting Storage accounts > Create Storage Account in the Azure extension.":::
42
48
@@ -45,7 +51,7 @@ When your add-in is working as desired, you can publish it directly through Visu
45
51
1. Open your project's manifest file and change all references to your localhost URL (such as `https://localhost:3000`) to the URL you've copied. This endpoint is the static website URL for your newly created storage account. Save the changes to your manifest file.
46
52
1. Open a command line prompt or terminal window and go to the root directory of your add-in project. Run the following command to prepare all files for production deployment.
47
53
48
-
```command line
54
+
```bash
49
55
npm run build
50
56
```
51
57
@@ -55,9 +61,9 @@ When your add-in is working as desired, you can publish it directly through Visu
55
61
56
62
:::image type="content" source="../images/deploy-to-static-website.png" alt-text="Select the dist folder, right-click (or select and hold), and select Deploy to Static Website via Azure Storage.":::
57
63
58
-
1. When deployment is complete, right-click (or select and hold) the storage account that you created previously and select **Browse Static Website**. This opens the static web site and displays the task pane.
64
+
1. When deployment is complete, right-click (or select and hold) the storage account that you created previously and select **Browse Static Website**. This opens the static website and displays the task pane.
59
65
60
-
1. Finally, [sideload the manifest file](../testing/sideload-office-add-ins-for-testing.md) and the add-in will load from the static web site you just deployed.
66
+
1. Finally, [sideload the manifest file](../testing/sideload-office-add-ins-for-testing.md). The add-in then loads from the static website you deployed.
61
67
62
68
## Deploy custom functions for Excel
63
69
@@ -67,13 +73,13 @@ If your add-in has custom functions, there are a few more steps to enable them o
67
73
1. In the Settings group, select **Resource sharing (CORS)**. You can also use the search box to find this.
68
74
1. Create a new CORS rule for the **Blob service** with the following settings.
69
75
70
-
|Property |Value |
71
-
|----------------|-----------------------------|
72
-
|Allowed origins | \* |
73
-
|Allowed methods | GET |
74
-
|Allowed headers | \* |
75
-
|Exposed headers | Access-Control-Allow-Origin |
76
-
|Max age | 200 |
76
+
|Property | Value |
77
+
|--|--|
78
+
|Allowed origins | \* |
79
+
|Allowed methods | GET |
80
+
|Allowed headers | \* |
81
+
|Exposed headers | Access-Control-Allow-Origin |
82
+
|Max age | 200 |
77
83
78
84
1. Select **Save**.
79
85
@@ -82,7 +88,7 @@ If your add-in has custom functions, there are a few more steps to enable them o
82
88
83
89
Next, add a MIME type for JSON files.
84
90
85
-
1. Create a new file in the /src folder named **web.config**.
91
+
1. Create a new file in the `src` folder named **web.config**.
86
92
1. Insert the following XML and save the file.
87
93
88
94
```xml
@@ -110,13 +116,13 @@ Next, add a MIME type for JSON files.
110
116
}),
111
117
```
112
118
113
-
1. Open a command line prompt and go to the root directory of your add-in project. Then, run the following command to prepare all files for deployment.
119
+
1. Open a command line prompt and go to the root directory of your add-in project. Then run the following command to prepare all files for deployment.
114
120
115
-
```command line
121
+
```bash
116
122
npm run build
117
123
```
118
124
119
-
When the build completes, the **dist** folder in the root directory of your add-in project will contain the files that you'll deploy.
125
+
When the build completes, the **dist** folder in the root directory of your add-in project will contain the files that you'll deploy.
120
126
121
127
1. To deploy, in the VS Code **Explorer**, right-click (or selectand hold) the **dist** folder and select**Deploy to Static Website via Azure Storage**. When prompted, selectthe storage account you created previously. If you already deployed the **dist** folder, you'll be prompted if you want to overwrite the files in the Azure storage with the latest changes.
Copy file name to clipboardExpand all lines: docs/testing/clear-cache.md
+28-29Lines changed: 28 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Clear the Office cache
3
3
description: Learn how to clear the Office cache on your computer.
4
-
ms.date: 12/02/2025
4
+
ms.date: 06/12/2026
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -36,21 +36,21 @@ The following table outlines which Office cache types can be cleared on differen
36
36
37
37
| Platform | Types of caches to clear | Options to clear the cache |
38
38
| ----- | ----- | ----- |
39
-
| Windows | Both the web and Wef caches. There's currently no option to clear one cache without clearing the other. | <ul><li>[Automatically clear the cache](#automatically-clear-the-cache)</li><li>[Manually clear the cache](#manually-clear-the-cache)</li><li>[Use the Microsoft Edge developer tools on Windows 10](#use-the-microsoft-edge-developer-tools-on-windows-10)</li></ul> |
39
+
| Windows | Both the web and Wef caches. There's currently no option to clear one cache without clearing the other. | <ul><li>[Automatically clear the cache](#automatically-clear-the-cache)</li><li>[Use the office-addin-cacche tool](#use-the-office-addin-cache-tool)</li><li>[Manually clear the cache](#manually-clear-the-cache)</li></ul> |
40
40
| Mac | <ul><li>Web</li><li>Both web and Wef caches</li></ul> | <ul><li>**Web**: [Use the personality menu to clear the web cache](#clear-the-web-cache)</li><li>**Web and Wef**: [Clear the web and Wef caches on Mac](#clear-the-web-and-wef-caches)</li></ul> |
41
41
| iOS | <ul><li>Web</li></ul> | <ul><li>[Use JavaScript to clear the cache on iOS](#clear-the-office-cache-on-ios)</li></ul> |
42
42
43
43
## Clear the Office cache on Windows
44
44
45
-
Depending on your Office host and operating system, you can automatically or manually clear both the web and Wef caches on a Windows computer.
45
+
Depending on the Office applications that your add-in supports, you may be able to configure Office on Windows to automatically clear both the web and Wef caches whenever it starts. Alternatively, clear the cache with the [office-addin-cache](https://www.npmjs.com/package/office-addin-cache) tool or manually.
46
46
47
47
> [!IMPORTANT]
48
48
> On Windows, the automatic and manual options clear both the web and Wef caches. There's currently no option to clear one cache without clearing the other.
49
49
50
50
### Automatically clear the cache
51
51
52
52
> [!NOTE]
53
-
> The automatic option is only supported for Excel, PowerPoint, and Word. Outlook only supports the [manual option](#manually-clear-the-cache-in-outlook).
53
+
> The automatic option is only supported for Excel, PowerPoint, and Word. Outlook only supports the [tool](#use-the-office-addin-cache-tool) and [manual](#manually-clear-the-cache-in-outlook) options.
54
54
55
55
This method is recommended for add-in development computers. If your Office on Windows version is 2108 or later, the following steps configure the Office cache to be cleared the next time Office is reopened.
56
56
@@ -59,6 +59,16 @@ This method is recommended for add-in development computers. If your Office on W
59
59
1. Select **OK**.
60
60
1. Restart Excel, PowerPoint, or Word.
61
61
62
+
### Use the office-addin-cache tool
63
+
64
+
To programmatically clear the cache, open a Command Prompt and run the following command.
65
+
66
+
```bash
67
+
npx office-addin-cache clear
68
+
```
69
+
70
+
For information about options you can use with the command, see [office-addin-cache](https://www.npmjs.com/package/office-addin-cache).
71
+
62
72
### Manually clear the cache
63
73
64
74
#### Manually clear the cache in Excel, Word, and PowerPoint
@@ -108,31 +118,6 @@ To clear the cache in [new Outlook on Windows](https://support.microsoft.com/off
108
118
109
119
:::image type="content" source="../images/devtools-clear-cache.png" alt-text="The 'Clear browser cache' option is selected in Microsoft Edge DevTools.":::
110
120
111
-
### Use the Microsoft Edge developer tools on Windows 10
112
-
113
-
To clear the Office cache on Windows 10 when the add-in is running in Microsoft Edge, use the Microsoft Edge DevTools.
114
-
115
-
> [!NOTE]
116
-
> To clear the Office cache using the following steps, your add-in must have a task pane. If your add-in is a UI-less add-in -- for example, one that uses the [on-send](../outlook/outlook-on-send-addins.md) feature -- you'll need to add a task pane to your add-in that uses the same domain for [SourceLocation](/javascript/api/manifest/sourcelocation), before you can use the following steps to clear the cache.
117
-
118
-
1. Install the [Microsoft Edge DevTools](https://apps.microsoft.com/detail/9mzbfrmz0mnj).
119
-
120
-
2. Open your add-in in the Office client.
121
-
122
-
3. Run the Microsoft Edge DevTools.
123
-
124
-
4. In the Microsoft Edge DevTools, open the **Local** tab. Your add-in will be listed by its name.
125
-
126
-
5. Select the add-in name to attach the debugger to your add-in. A new Microsoft Edge DevTools window will open when the debugger attaches to your add-in.
127
-
128
-
6. On the **Network** tab of the new window, select **Clear cache**.
129
-
130
-
:::image type="content" source="../images/edge-devtools-clear-cache.png" alt-text="Microsoft Edge DevTools with the Clear cache button highlighted.":::
131
-
132
-
7. If completing these steps doesn't produce the desired result, try selecting **Always refresh from server**.
133
-
134
-
:::image type="content" source="../images/edge-devtools-refresh-from-server.png" alt-text="Microsoft Edge DevTools with the Always refresh from server button highlighted.":::
135
-
136
121
## Clear the Office cache on Mac
137
122
138
123
You can choose to clear the web or both the web and Wef caches on Mac.
@@ -154,6 +139,20 @@ From the add-in's task pane, choose the personality menu. Then, choose **Clear W
154
139
155
140
### Clear the web and Wef caches
156
141
142
+
Clear both the caches either manually or by using the office-addin-cache tool.
143
+
144
+
#### Clear the Office cache on Mac by using the office-addin-cache tool
145
+
146
+
To programmatically clear the cache, open **Terminal** and run the following command.
147
+
148
+
```bash
149
+
npx office-addin-cache clear
150
+
```
151
+
152
+
For information about options you can use with the command, see [office-addin-cache](https://www.npmjs.com/package/office-addin-cache).
153
+
154
+
#### Clear the Office cache on Mac manually
155
+
157
156
To clear both the web and Wef caches on Mac, delete the contents of the `~/Library/Containers/com.Microsoft.OsfWebHost/Data/` and `~/Library/Containers/com.microsoft.{host}/Data/Documents/wef` folders. Replace `{host}` with the Office application, such as `Excel`.
0 commit comments