Thanks for reaching out to Microsoft Q&A.
The error you're encountering is related to the Key Vault, specifically the Key Vault key used for encryption during the MySQL flexible server provisioning. The message indicates that the key cannot be found, even though you've selected the only available key.
Here are some steps to troubleshoot and resolve this issue:
- Verify Key Vault Permissions: Ensure that the MI assigned to the MySQL Flexible Server has sufficient permissions to access the Key Vault. Specifically, the identity must have the Key Permissions of Get, Wrap Key, and Unwrap Key to use the encryption key. You can verify this by navigating to the Key Vault's Access Policies and checking the assigned permissions.
Check Key Name and Version: In your YAML error, the key version might be missing or incorrect. Confirm that the key name and version specified are accurate. If there’s only one version available, ensure it's properly referenced. You can try generating a new key version in the Key Vault to eliminate any issues with the current one.
Key Vault Network Restrictions: If your Key Vault has network restrictions (e.g., private endpoints or firewall rules), ensure that the MySQL Flexible Server is allowed access. You can temporarily disable network restrictions on the Key Vault for testing purposes.
- Managed Identity Setup: Confirm that the MI was assigned correctly. You can remove and reassign the Managed Identity for the MySQL Server to ensure it is properly linked.
- Correct Key URI Format: The key URI format in your YAML should be correct. It usually looks like:
Double-check the URI in your setup for typos or missing information, especially in thehttps://<keyvault-name>.vault.azure.net/keys/<key-name>/<key-version>
key-version
. Azure Portal Deployment: Try deploying the MySQL Flexible Server directly from the Azure Portal using the same settings. This could help identify if there’s an issue with your YAML configuration. - Error Logging: Review the deployment logs in Azure for more detailed information. Navigate to the Resource Group > Deployments and check the failure details to understand what might have gone wrong.
After performing these steps, attempt the deployment again. Let me know if you encounter further issues...
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.