Search in sources :

Example 1 with IAppServiceUpdater

use of com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater in project azure-tools-for-java by Microsoft.

the class WebAppPropertyViewPresenter method updateAppSettings.

@Override
protected void updateAppSettings(@NotNull final String sid, @NotNull final String webAppId, @Nullable final String name, final Map toUpdate, final Set toRemove) {
    final IWebApp webApp = getWebAppBase(sid, webAppId, name);
    final IAppServiceUpdater appServiceUpdater = webApp.update();
    appServiceUpdater.withAppSettings(toUpdate);
    toRemove.forEach(key -> appServiceUpdater.withoutAppSettings((String) key));
    appServiceUpdater.commit();
}
Also used : IAppServiceUpdater(com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater) IWebApp(com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)

Example 2 with IAppServiceUpdater

use of com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater in project azure-tools-for-java by Microsoft.

the class FunctionAppPropertyView method createPresenter.

@Override
protected WebAppBasePropertyViewPresenter createPresenter() {
    return new WebAppBasePropertyViewPresenter() {

        @Override
        protected IFunctionApp getWebAppBase(String subscriptionId, String functionAppId, String name) {
            return Azure.az(AzureAppService.class).subscription(subscriptionId).functionApp(functionAppId);
        }

        @Override
        protected void updateAppSettings(String subscriptionId, String functionAppId, String name, Map toUpdate, Set toRemove) {
            final IFunctionApp functionApp = getWebAppBase(subscriptionId, functionAppId, name);
            final IAppServiceUpdater appServiceUpdater = functionApp.update();
            appServiceUpdater.withAppSettings(toUpdate);
            toRemove.forEach(key -> appServiceUpdater.withoutAppSettings((String) key));
            appServiceUpdater.commit();
        }
    };
}
Also used : Set(java.util.Set) IAppServiceUpdater(com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater) IFunctionApp(com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp) Map(java.util.Map) WebAppBasePropertyViewPresenter(com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter)

Aggregations

IAppServiceUpdater (com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater)2 IFunctionApp (com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp)1 IWebApp (com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)1 WebAppBasePropertyViewPresenter (com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter)1 Map (java.util.Map)1 Set (java.util.Set)1