Skip to content

Commit

Permalink
mgmt, key on function app slot (#22198)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Jun 10, 2021
1 parent 79a8158 commit 73edd1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.azure.resourcemanager.appservice.implementation;

import com.azure.resourcemanager.appservice.fluent.models.HostKeysInner;
import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner;
import com.azure.resourcemanager.appservice.models.DeploymentSlotBase;
import com.azure.resourcemanager.appservice.models.FunctionApp;
Expand Down Expand Up @@ -80,4 +81,15 @@ Mono<SiteInner> submitSite(final SitePatchResourceInner siteUpdate) {
// PATCH does not work for function app slot
return submitSiteWithoutSiteConfig(this.innerModel());
}

@Override
public String getMasterKey() {
return this.getMasterKeyAsync().block();
}

@Override
public Mono<String> getMasterKeyAsync() {
return this.manager().serviceClient().getWebApps().listHostKeysSlotAsync(
this.resourceGroupName(), this.parent().name(), this.name()).map(HostKeysInner::masterKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource;
import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
import com.azure.resourcemanager.resources.fluentcore.model.Updatable;
import reactor.core.publisher.Mono;

/** An immutable client-side representation of an Azure Function App deployment slot. */
@Fluent
Expand All @@ -20,6 +21,12 @@ public interface FunctionDeploymentSlot
Updatable<DeploymentSlotBase.Update<FunctionDeploymentSlot>>,
HasParent<FunctionApp> {

/** @return the master key for the function app */
String getMasterKey();

/** @return the master key for the function app */
Mono<String> getMasterKeyAsync();

/**************************************************************
* Fluent interfaces to provision a function deployment slot
**************************************************************/
Expand Down

0 comments on commit 73edd1f

Please sign in to comment.