Skip to content

az mysql flexible-server create creates server that cannot connect into #30968

@hgjura

Description

@hgjura

Describe the bug

The command az mysql flexible-server create creates a server in a state that mysql client cannot connect into. This is done in a Azure DevOps pipeline.

Here is the full script:

az mysql flexible-server create --resource-group $resourcegroup \
                       --name $sername \
                       --location $location \
                       --admin-user $adminusername \
                       --admin-password $adminpassword \
                       --sku-name $sku \
                       --version $mysqlversion \
                       --yes \
                       --tags CreatedBy=AzDO

  az mysql flexible-server firewall-rule create --resource-group $resourcegroup \
                                      --name $sername \
                                      --rule-name AllowAllIPs \
                                      --start-ip-address 0.0.0.0 \
                                      --end-ip-address 255.255.255.255 

#THIS LINE WORKS. MEANING SERVER IS CREATED AND THIS COMMAND DOESN'T FAIL
 az mysql flexible-server connect -n $sername -u $adminusername -p $adminpassword -d flexibleserverdb

  #THIS FOLLOWING LINE FAILS WITH CONECTION REFUSED ERROR
  #IDENTICAL SETUP CREATED MANUALLY WORKS
#ANY MYSQL COMMAND FAILS

  mysql --host=$sername.mysql.database.azure.com \
        --user=$adminusername@$sername \
        --password=$adminpassword \
        --execute="DROP DATABASE IF EXISTS flexibleserverdb;"

  mysql --host=$sername.mysql.database.azure.com \
            --user=$adminusername@$sername \
            --password=$adminpassword \
            --ssl-mode=REQUIRED \
            --execute="CREATE DATABASE $dbname;"

Related command

az mysql flexible-server create

Errors

Connection refused or connection error

Issue script & Debug output

Connection refused or connection error

Expected behavior

mysql client should be able to connect and run commands

Environment Summary

azure-cli 2.70.0
mysql version 8.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botMySQLService AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions