Scope of ScriptDB instance for Google Apps Spreadsheet Add-on - database

I was wondering if anyone knew the scope of a Google Apps ScriptDB database when used within an Add-On? The page mentions "Each script project gets a database", so would that mean that every instance of an Add-On shares the same ScriptDB instance? Or would each Add-On instance have it's own private ScriptDB instance? I have some concerns around my Add-On accessing a database that contains data for users other than the current user. Thanks!

ScriptDB we found was specific to a particular instance i.e. Doc or Sheet. Try copying a doc or sheet that has an add-on and script db, the code for the add-on is persisted but the scriptDB is not.

Related

Is it possible to use already build Azure resources in Teams toolkit

I'm creating Teams app, but I have already created bot application and resources needed, thus I don`t need form Teams toolkit to create additional ones. Is it possible to use already build ones and where should I state them in Toolkit files(manifests/parameter files)?
According to MS documentation upon Provisioning and based what is selected to be used in Teams app - Provisioning command triggers to create the resources(https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/provision), and to repeat my question, is it possible to use already build resources and not to create new ones?
Any suggestions/ideas/experiences?
By exploring config file I have found in https://github.com/OfficeDev/TeamsFx/blob/main/docs/fx-core/teamsfx-env-config.md that if I provide the resources they will not be previsioned and created in azure and I have set them: , but still on Output Provision in the cloud I get:
Thanks for your question, if you have already your own Azure Bot service and hosted bot application code. The only thing you need to do to connect your bot with Teams is to update the bot definition part in Teams manifest file.

Permission denied on external access to Google Cloud Datastore

I want to access datastore (and storage) data of an AppEngine project via google-cloud-datastore and google-cloud-storage with an Python program on my own server.
This works with my AppEngine staging server, by creating a service account and giving it owner access (to the project).
Doing the same thing with the production AppEngine instance fails with
google.api_core.exceptions.PermissionDenied: 403 Missing or insufficient permissions.
Part of the problem might be, that I might be using the wrong project to create the service account with. There are more than one project with the same name in my cloud console. How do I identify the correct one?
How do I get more details about the problem?
First, note that the Datastore and the Cloud Storage are 2 different products with 2 different accessing methods.
The Datastore is closely tied to the GAE project - each project has its own datastore. The external access procedure in general is captured in How do I use Google datastore for my web app which is NOT hosted in google app engine?.
When switching the project (staging to production in your case) there are 2 things to keep in mind:
as you observed, you need to change the project you're accessing.
you also need to change the credentials you load and use for access to match the project you select, as each project has it own service account key configured in the above-mentioned procedure
For the google-cloud-datastore library both of these are simultaneously configured via the datastore.Client() call parameters (emphasis mine):
class google.cloud.datastore.client.Client(project=None,
namespace=None, credentials=None, _http=None, _use_grpc=None)
project (str) – (Optional) The project to pass to proxied API methods.
credentials (Credentials) – (Optional) The OAuth2 Credentials to use for this client. If not passed (and if no _http object is passed),
falls back to the default inferred from the environment.
The Cloud Storage is completely independent from GAE, the GAE project/credentials you use (if any) have no bearing on bucket/object access restrictions whatsoever. There's nothing you need to do from the google-cloud-storage library perspective when switching from one GAE project to another
To eliminate the confusion created by multiple projects having the same name just go to the IAM & admin Settings page, select the respective projects from the drop-down list on the top blue bar and rename them using meaningful names (click in the Project name box to edit the name, then click SAVE). Then re-check if you're using the right keys for the desired project.

Creating a local environment from an existing GAE installation

I have a website that is currently running under GAE... unfortunately, I, nor anyone on the team, does not have access the local environment that it was created from.... Is it possible to create a local environment or at least get a copy of the application files and database from an existing GAE installation?
What you need is the application source code, not the "local environment".
Ideally this source code would be on a version control system (ie GIT,SVN), Google cloud platform provides free GIT repositories for your projects so you might try looking there first. There's also a tool for both Java and python that allow you to download the source of a deployed version, provided you are authenticated as either the dev who uploaded it or a project owner. EDIT: as stated by Dan Cornilescu this feature can be disabled.
As for the database info there's plenty of tools available to "export" your GAE datastore info, just consider for your project that it might be easier to do the queries manually than actually implementing this tools.
Thanks for help... But unfortunately, this code is not in GIT. Furthermore,
being new to Google hosting, I wasn't clear on my setup... My web instance is actually running within Compute Engine not Application Engine. Be that as it may, with some additional search, I was first able to find out how to browse my filesystem by accessing the VM Instances menu option under the Compute Engine section of the Google Cloud Platform interface. On the VM Instances page, it will show your instance and an option to the left side of the instance to connect with a drop down box that will allow you to open a browser window that shows the instance's file system. In addition to this, I found this link https://www.youtube.com/watch?v=9ssfE6ODpak that shows how to configure Filezila FTP client to access your server instance - very helpful. From there, I was able to download all of my site files from the var/www directory. Now, onto extracting my data... Thanks again!

Share sqlite database between app and extension

I have followed this tutorial and added my database. I did target both my app and my extension. From my app I can SELECT, INSERT, DELETE and UPDATE to the database. I want both my app and extension to share the same database. So I add information in my app and then show that information in the extension.
As it works now (I have tested) the app has one instance of the database and the extension has one instance. I have only added one db. Anyone got a clue why I have two instances of my database and why I can´t access the data added from the app in the extension?
Apps and their extensions are separate processes, so iOS sandboxing normally means they can't touch each other's files. The page you reference doesn't appear to address this in any way.
If you want to use the same SQLite file in both your app and the extension, you need to configure the "app groups" entitlement for both of them. That sets up a new directory that both of them can access, and you put your SQLite file there. You find this directory by using the containerURLForSecurityApplicationGroupIdentifier: method on NSFileManager.
It's not clear to me whether the GitHub project you're using will make use of app groups. There's no other way to share your SQLite file, though. If that project doesn't use app groups, you'll need to either fix it so that it does or stop using it.

Google Cloud Datastore and reports/administration

I'm quite new to Google App Engine and it's cloud Datastore which is used for storing the backend's data by default. As far as I realized you can only view it's content within the developer console and you can create or edit entities there.
But is there any external tool from which you can connect to your datastore to create reports or administer the data? What is your experience?
In fact yes it's true you can only see data's from the admin console.
If you wish to see your data's in Google Drive Table and make a report you can, but for that you need to create a connector to your sheet (I already made one). It's exactly the same if you need update or import data's to your datastore.
I use this Technic to upload or refresh products on my e-shop GAE app.
In general if I need to see a report, I design a specific web page for that and I protect theme via a login / password. To see a well formatted report you can use jquery library or use Google Charts

Resources