AppMaker error say "The instance must be a 2nd generation SQL database" but it is a 2nd gen - google-app-maker

AppMaker gives this error: "The default Google Cloud SQL instance is not setup properly. Please ask a G Suite administrator to check the Google Cloud SQL configuration for your domain. (Reason: App Maker is unable to verify the default Google Cloud SQL instance. The instance must be a 2nd generation SQL database.)"
But the SQL database is a 2nd generation
ALF-experiments instances:
Instance ID Type High availability Location Labels
sgialfmysql MySQL 2nd Gen 5.7 us-central1-a
Connected as the default in admin console
Google Cloud SQL instance setting
Enter the Google Cloud SQL instance connection name to use with App Maker:
alf-experiments:us-central1:sgialfmysql
I have made multiple Cloud instances under multiple project but none seem to be able to connect. I have reviewed the documentation several times to verify that GCP and Cloud SQL are set correctly and they are.

Related

Can't access Cosmos Db that has firewall restrictions from Azure Synapse

I am attempting to setup Synapse to access a Cosmos Db that has firewall rules set to only allow whitelisted IPs.
After a bit of research, I came across this article:
Securing Azure Synapse Workspaces? Beware of One Inescapable Networking Blocker | by Moussa Taifi PhD | Towards Dev
According to that post, the only option is to whitelist the entire range of IPs that might be used by the pool. Can someone let me know if this is indeed the case? I started looking at private endpoints as that seems like a perfect solution, but I can't get it to work. I tried the following multiple times:
Create new CosmosDb with Azure Synapse Link enabled
Restrict to Selected networks
Create a new DB and Container
Verify that I can’t add a new item
Add my IP
Add new item
Create a new Synapse Workspace, choosing Managed VNet
After creation, verify that the Integration Runtime is in the Managed VNet.
Create two new private endpoints for my Cosmos db. One for type Sql, and one for Analytical (I’m not sure which I need yet)
Go to the Private Link center and approve both end points
Data > Connect to External Data
Ensure that my runtime is in the Manage VNet
Select my DB
I waited 10 min, but the managed endpoint list is stuck at “Refreshing.” I continued to save anyway, but when I try to make a SQL call (after creating the credential), I get:
Resolving CosmosDB path has failed with error 'Access to the database account '*******' is forbidden.'.
The endpoints are permanently "Refreshing" in both the properties of the connection and also in the Manage Private Endpoints. The end point links are "approved" and show as such in Cosmos DB.
Can anyone let me know:
Are Private endpoints a method that I can use to connect my Synapse Workspace to my locked down Cosmos DB?
If so, what might I be doing wrong?
Thanks!
You should consider opening a support case in the case of misconfiguration in your settings.
There should be an option to allow access to Azure IPs. This is contained in documentation located here:
Add a managed private endpoint for Azure Cosmos DB analytical store
Sign into the Azure portal.
From the Azure portal, navigate to your Synapse Analytics workspace and open the Overview pane.
Launch Synapse Studio by navigating to Getting Started pane and select Open under Open Synapse Studio.
In the Synapse Studio, open the Manage tab.
Navigate to Managed private endpoints and select New
Create a new private endpoint for analytical store.
Select Azure Cosmos DB(SQL API) account type > Continue.
Select Azure Cosmos DB SQL API to create a private endpoint.
Fill out the New managed private endpoint form with the following details:
Name - Name for your managed private endpoint. This name cannot be updated after it's created.
Description - Provide a friendly description to identify your private endpoint.
Azure subscription - Select an Azure Cosmos DB account from the list of available accounts in your Azure subscriptions.
Azure Cosmos DB account name - Select an existing Azure Cosmos DB account of type SQL or MongoDB.
Target sub-resouce - Select one of the following options: Analytical: If you want to add the private endpoint for Azure Cosmos DB analytical store. Sql (or MongoDB): If you want to add OLTP or transactional account endpoint.
Note
You can add both transactional store and analytical store private endpoints to the same Azure Cosmos DB account in an Azure Synapse Analytics workspace. If you only want to run analytical queries, you may only want to map the analytical private endpoint.
Choose analytical for the target subresource.
After creating, go to the private endpoint name and select Manage approvals in Azure portal.
Navigate to your Azure Cosmos DB account, select the private endpoint, and select Approve.
Navigate back to Synapse Analytics workspace and click Refresh on the Managed private endpoints pane. Verify that private endpoint is in Approved state.

Distinguish between Preview/Publish or get Database Name

Is there a way in App Maker to know if the Preview is running or if it is a Deployment? If not is there a server-side script that can get the Cloud SQL database name being used?

How to connect appmaker to a Google SQL over private IP?

when trying to connect to my org SQL cloud from app maker, defined to use only private IP it fails:
The default Google Cloud SQL instance is not setup properly. Please ask a G Suite administrator to check the Google Cloud SQL configuration for your domain. Cannot create new database in the default Google Cloud SQL instance.
any specific service needs to be given to appmaker-maestro to make this work ?
if I connect to a custom instance which has public IP enabled it works all well.
thanks for any guidance you might have.

How do I view the contents of my "default" type Cloud SQL database in AppMaker?

I created a new AppMaker app and selected the "default" (as opposed to "custom") Cloud SQL database backend.
While I'm prototyping my app, I'd like to be able to inspect the contents of my database periodically as an admin to debug issues. With a custom Cloud SQL database this is easy because you can acess a custom Cloud SQL database from the cloud console, but I don't see how to manually query a default Cloud SQL database.
I know that I can export my database to a Google Sheet, but that's inconvenient to do frequently.
How do I inspect the contents of my AppMaker default Cloud SQL database for debugging (eg. via a SQL command line, UI tool, etc)?
I believe it would be the same as with the custom one. The documentation explains:
A G Suite administrator can set up a Google Cloud SQL instance that is shared among App Maker apps in an organization. When this is enabled, a new database is automatically created for your app when you add at least one Cloud SQL data model. Choose this option if your app needs a database that is easy to use and requires no set up.
This means that you had set up correctly the instance information in the G Suite Admin console:
So to connect to your SQL instance, you just need to follow the instructions here. Then simply use the instance connection name where required. You will also need the database name and you can get that from the appsettings or deployment settings in appmaker.
For the preview mode it will be in the app settings. For any deployed version, it will be in the deployment settings:

Cannot have a dash in my database name for AppMaker

This is most likely a bug, and appeared recently, but in the deployment section, the Google Cloud SQL Address section says my database name is invalid. If I remove the dash, it says it's valid.
Anyone facing this ?
[edit] My database with a dash, in the database tab of GCP console.
Google Cloud Platform doesn't allow to create Cloud SQL database with dash in name, what database you are trying to connect?

Resources