[MetricsAdvisor] Merged MetricsAdvisorKeyCredential UpdateKey methods into single one#21947
[MetricsAdvisor] Merged MetricsAdvisorKeyCredential UpdateKey methods into single one#21947kinelski merged 4 commits intoAzure:mainfrom
Conversation
maririos
left a comment
There was a problem hiding this comment.
I imagine you already have a test for this updating the credentials, so approving. In case that is not true, can you please include a test?
Added three tests:
|
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them. In order to bootstrap pipelines for a new service, please perform following steps: For data-plane/track 2 SDKs Issue the following command as a pull request comment:
For track 1 management-plane SDKsPlease open a separate PR and to your service SDK path in this file. Once that PR has been merged, you can re-run the pipeline to trigger the verification. |
| string expectedSubscriptionKey = "newFakeSubscriptionKey"; | ||
| string expectedApiKey = "newFakeApiKey"; | ||
|
|
||
| credential.Update(expectedSubscriptionKey, expectedApiKey); |
There was a problem hiding this comment.
because of mocking, I believe that you are attached to the client you created. A user will use the update method in an already live client instead of creating one with the updated credentials.
Do you think it is worth adding a live test that reflects that behavior?
There was a problem hiding this comment.
We can move the Update call to the point after creating the client.
{AzureFrontdoor} fixes Azure/azure-cli#24758 fixing ActionType enum to include AnomalyScoring (Azure#21947)
fixes Azure/azure-cli#24758 fixing ActionType enum to include AnomalyScoring
Running the below command to override the managed rules with --action set to AnomalyScoring fails:
> az network front-door waf-policy managed-rules override add
```
az network front-door waf-policy managed-rules override add: 'AnomalyScoring' is not a valid value for '--action'. Allowed values: Allow, Block, Log, Redirect.
```
This is because currently only the `Allow, Block, Log, Redirect` enums are specified. `AnomalyScoring` value should also be included in the `ActionType` enums.
Merging
UpdateSubscriptionKeyandUpdateApiKeyinto a singleUpdatemethod to support atomic update. We already had something close to this in Core (AzureNamedKeyCredential), so we're following a similar implementation.