Skip to content

Add support for managed MySQL Flexible server#6411

Merged
zhoxing-ms merged 9 commits intoAzure:mainfrom
yash-nisar:mysql-flexible
Aug 28, 2023
Merged

Add support for managed MySQL Flexible server#6411
zhoxing-ms merged 9 commits intoAzure:mainfrom
yash-nisar:mysql-flexible

Conversation

@yash-nisar
Copy link
Copy Markdown
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @yash-nisar,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jun 15, 2023

Thank you for your contribution! We will review the pull request and get back to you soon.

@yash-nisar
Copy link
Copy Markdown
Contributor Author

It takes ~6mins to provision a flexible mysql server from the command line so I don't think it's feasible to add ITs:
image

@yash-nisar
Copy link
Copy Markdown
Contributor Author

Verified the binding works:
image

@yash-nisar
Copy link
Copy Markdown
Contributor Author

Also could see env vars on curling the app:

AZURE_MYSQL_DATABASE=XX
AZURE_MYSQL_HOST=XX
AZURE_MYSQL_PASSWORD=XX
AZURE_MYSQL_PORT=XX
AZURE_MYSQL_SSL=XX
AZURE_MYSQL_USERNAME=XX

Command to bind:

az containerapp update -n appName -g rgName --bind mysqlName:mysqlconnName,username=XX,password=XX,database=XX

return {"linker_name": binding_name, "parameters": parameters, "resource_id": resource_id}


class ManagedMySQLFlexibleUtils:
Copy link
Copy Markdown
Contributor

@Greedygre Greedygre Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for command
az containerapp create/update --bind to test the MySQL service binding.
Otherwise LGTM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test function added, thank you.

@zhoxing-ms
Copy link
Copy Markdown
Contributor

Could you please add some test case for this PR change?

@yash-nisar
Copy link
Copy Markdown
Contributor Author

yash-nisar commented Aug 21, 2023

@bgashirabake is working on the tests and will continue this PR.

Note: Since it takes ~6 mins to provision a flexible mysql server, the runtime of the test is expected to increase.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 22, 2023

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@scrappywyrm
Copy link
Copy Markdown
Contributor

Could you please add some test case for this PR change?

done. could you please take a look when you get the chance. thank you!!

…rapp_commands.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
@Greedygre
Copy link
Copy Markdown
Contributor

Hi @zhoxing-ms @yanzhudd
Could you help to review and merge this PR? Thanks.

@zhoxing-ms zhoxing-ms merged commit 94b2e14 into Azure:main Aug 28, 2023
scrappywyrm added a commit to scrappywyrm/azure-cli-extensions that referenced this pull request Aug 30, 2023
* Add support for managed MySQL Flexible server

* fix

* add change to history.rst

* test add

* fix duplicate env create cmd

* test rerun

* test update

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

---------

Co-authored-by: bgashirabake@gmail.com <bgashirabake@gmail.com>
Co-authored-by: bgashirabake <85650284+bgashirabake@users.noreply.github.com>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
scrappywyrm added a commit to scrappywyrm/azure-cli-extensions that referenced this pull request Aug 30, 2023
* Add support for managed MySQL Flexible server

* fix

* add change to history.rst

* test add

* fix duplicate env create cmd

* test rerun

* test update

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

---------

Co-authored-by: bgashirabake@gmail.com <bgashirabake@gmail.com>
Co-authored-by: bgashirabake <85650284+bgashirabake@users.noreply.github.com>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
scrappywyrm added a commit to scrappywyrm/azure-cli-extensions that referenced this pull request Aug 30, 2023
* Add support for managed MySQL Flexible server

* fix

* add change to history.rst

* test add

* fix duplicate env create cmd

* test rerun

* test update

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

---------

Co-authored-by: bgashirabake@gmail.com <bgashirabake@gmail.com>
Co-authored-by: bgashirabake <85650284+bgashirabake@users.noreply.github.com>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
@yash-nisar yash-nisar deleted the mysql-flexible branch September 6, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants