public virtual Response <KeyInfo> CreateOrUpdateFunctionSecret(string keyName, KeyInfo key, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(keyName, nameof(keyName)); Argument.AssertNotNull(key, nameof(key)); using var scope = _siteFunctionWebAppsClientDiagnostics.CreateScope("SiteFunctionResource.CreateOrUpdateFunctionSecret"); scope.Start(); try { var response = _siteFunctionWebAppsRestClient.CreateOrUpdateFunctionSecret(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, keyName, key, cancellationToken); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <KeyInfo> CreateOrUpdateFunctionSecret(string keyName, KeyInfo key, CancellationToken cancellationToken = default) { if (keyName == null) { throw new ArgumentNullException(nameof(keyName)); } if (key == null) { throw new ArgumentNullException(nameof(key)); } using var scope = _clientDiagnostics.CreateScope("SiteFunction.CreateOrUpdateFunctionSecret"); scope.Start(); try { var response = _webAppsRestClient.CreateOrUpdateFunctionSecret(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, keyName, key, cancellationToken); return(response); } catch (Exception e) { scope.Failed(e); throw; } }