[release/9.2] Cosmos, Redis and Postgres show keyvault when using key access or passwords with emulator #8503
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #8406 to release/9.2
/cc @eerhardt @davidfowl
Fix #8364
Customer Impact
When using Azure Cosmos, Redis, or Postgres resources with secrets (WithAccessKeyAuthentication or WithPasswordAuthentication) and running as an emulator/container during F5 time, the KeyVault resource was being added to the model and being provisioned. This is unnecessary and can block people's apps because they didn't set up for Azure provisioning, since they are using the emulator.
Testing
Added new unit tests to ensure the KV resource is not in the app model. Also manual tested.
Risk
There's risk here that not keeping the KV resource in the model might uncover other problems. But I'm not currently aware of any problems this causes. It is the same approach used elsewhere - like in the case of Azure Functions and the Host Storage account.
Regression?
Yes, from 9.1 and previous versions.