public async virtual Task <Response <KeyInfo> > CreateOrUpdateFunctionSecretAsync(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 = await _webAppsRestClient.CreateOrUpdateFunctionSecretAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, keyName, key, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <KeyInfo> > CreateOrUpdateFunctionSecretAsync(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 = await _siteFunctionWebAppsRestClient.CreateOrUpdateFunctionSecretAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, keyName, key, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }