Skip to content

Commit 6c516e5

Browse files
committed
fix tag error
1 parent dc8fec6 commit 6c516e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/webapp/AzureWebAppMvpModel.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ public WebApp createWebAppOnLinux(WebAppOnLinuxDeployModel model)
235235
*/
236236
public WebApp updateWebAppOnLinux(String sid, String webAppId, ImageSetting imageSetting) throws IOException {
237237
WebApp app = AzureWebAppMvpModel.getInstance().getWebAppById(sid, webAppId);
238+
clearTags(app);
238239
if (imageSetting instanceof PrivateRegistryImageSetting) {
239240
PrivateRegistryImageSetting pr = (PrivateRegistryImageSetting) imageSetting;
240241
app.update().withPrivateRegistryImage(pr.getImageNameWithTag(), pr.getServerUrl())
@@ -390,4 +391,15 @@ public void cleanWebAppsOnLinux() {
390391
private static final class SingletonHolder {
391392
private static final AzureWebAppMvpModel INSTANCE = new AzureWebAppMvpModel();
392393
}
394+
395+
/**
396+
* Work Around:
397+
* When a web app is created from Azure Portal, there are hidden tags associated with the app.
398+
* It will be messed up when calling "update" API.
399+
* An issue is logged at https://github.com/Azure/azure-sdk-for-java/issues/1755 .
400+
* Remove all tags here to make it work.
401+
*/
402+
private void clearTags(@NotNull final WebApp app) {
403+
app.inner().withTags(null);
404+
}
393405
}

0 commit comments

Comments
 (0)