Can I regenerate the amplify file team-provider-info.json? - aws-amplify

I have an amplify react app with resources pushed to cloud. Unfortunately, when I went to commit I removed the team-provider-info.json without backing it up. I have every other file that originated with amplify in my local project. Can I regenerate team-provider-info.json without starting over? There is no information about that process here: https://aws-amplify.github.io/docs/cli-toolchain/quickstart#teamprovider

There is 2 ways you can generate (that I am aware of).
Firstly you need to view the stack within the cloudformation dashboard of AWS console.
Click the root stack of the environment you need to fix, then click the outputs tab.
This will list you a whole bunch of values to fill the cloudformation vales within the team provider json file.
You can either:
1. Regen the file by running this script in your terminal https://aws-amplify.github.io/docs/cli-toolchain/quickstart#environment-related-commands Or
2. Copy and paste the values into an existing team-provider-info.json file, however for the environment that needs fixing.
Sample outputs tab in cloudformation dashboard

You can simple copy amplify project without team-provider-info.json in an other local directory and execute amplify push in this directory. After login with the same aws account you can choose what Application to clone from the clouds. This will rename your amplify folder to amplify-tmp and generate fresh amplify folder with team-provider-info.json for the choosen Application. You can copy team-provider-info.json in the original project dir or work with new one.

Related

How to deploy static files only to firebase hosting

I am just trying to create a static landing page for my app with firebase hosting. The first time initialized and deployed the site it worked fine, but now that I am trying to tweak the design a little bit and upload better images, somehow my index.html file keeps getting overwritten with code that I do not need, I believe it is the firebase default index page which they create when you first set up a projext. I have tried it three times now and it keeps happening, and each time I have to recreate all the edits.
How do I simply deploy static files without all the extra code overwriting the page?
I cd into the folder containing my site, the public folder, and run firebase init, chose only hosting, then chose no for one page app, then no for the git deploy scripts, then run firebase deploy --only hosting --project (my project)
Each time, my index file gets erased and replaced with a firebase spontaneously created file.
I have searched the firebase docs and can find no explanation.
Please help
Try just running the firebase deploy command. If you run the firebase init command the first time and select the project, and make the public folder, then you should only have to run that command once. cd into the folder, and then just run firebase deploy.

Config files and references: which one is loaded?

I have two projects inside a solution.
Project one is a vb.net console app, that does some operations on a SQL server database.
Project two is a asp.net dashboard, that shows to the users the results of the operations done by project one, reading them from a table in the same db.
Each project takes its properties for connecting the db from its config file. (exe.config for the console app, and web.config for the website).
Then I had to make project to able to run a subset of the operations of project one, so I made a function in project one that runs that subset, and added project one to the references of project two.
And everything works.
Then I had to leave localhost and move my projects to the client server.
So I have the publish folder of the Asp.net site which contains in the bin folder the exe file of project one.
I edited the configs to set the right credential for logging in to the server SQL, and when I run project one everything works. When I run project 2 everything works. When I try to run the subset of project one within project 2, the connection string created shows the original settings and not the edited one.
So my question is: where do they come from?
Both the cfg files are correct, and each application is able to connect, except for the subset stuff.
If I call a function of a referenced file, which config file does it read?

Where does amplify grab the value of `amplify env pull <multi-env> --restore` from?

In the documentation:
amplify env pull –restore
Pulls your environment with the current
cloud environment. Use the restore flag to overwrite your local
backend configs with that in the cloud.
My question is, where exactly the cloud at?? The problem that I am having now, is that whenever I do amplify env pull <multi-env-name> --restore, it is grabbing a different value on my amplify\.backend\amplify-meta.json compared to running amplify init.
What I initially did is I mistakenly created and pushed an amplify auth, and then I updated it to a new auth, pushed it, and published it. Somehow, right now whenever I do amplify env pull <multi-env-name> --restore, it is grabbing the old auth value. If they say the restore flag is to overwrite your local backend configs with that in the cloud, my configs in the cloud should be the last one that I updated(pushed).
Alright, I figured it out. It is in the S3 Deployment Bucket of whatever you set your DeploymentBucketName is, in the amplify-meta.json. And inside that bucket, you will find #current-cloud-backend.zip. So, amplify env pull <multi-env-name> --restore is fetching it from there. You basically can update that file with whatever you want to. But, it would be safe if you get it from amplify init command, and it will create a set of file in your project /amplify/ directory. Zip that file, and update it. Be sure to make a backup of your #current-cloud-backend.zipin the S3.

How can I work on an existing Firebase (functions) project on a different machine?

I'm relatively new to Firebase and want to work on one Firebase Project from multiple Machines. When setting up a new Project locally via firebase CLI and attaching it to an existing Project in the cloud, there's a full project folder created in my local directory.
Is there any chance of sort of "downloading"/updating an existing project to a second machine?
The workaround I'd have chosen would be to manually copy the whole directory to the new environment and then login firebase.
But this would, given the fact of missing source control, bring the risk of overwriting changes made on machine 1 yesterday, when firebase deploy from machine 2 today, wouldn't it?
Sorry for maybe not expressing myself in a decent it-guy way, but I'm far from being a full-blooded programmer.
Thanks!
You have to manage your source code yourself, typically using a source control mechanism such as git or svn. Firebase does not provide a source control system for the code and configuration that you deploy to Cloud Functions.

Converted UWP... Nothing Happens

I have converted a Win32 Application to UWP using MakeAppX and it doesn't seem to run. When I click the icon in the start menu literally nothing happens except a busy icon briefly appears on the cursor.
I completed the same process with Notepad++ and all it's DLLs and that worked fine (using the exact same manifest file, just changing the exe)
My questions are:
Where does the UWP save files that it creates/temporary files etc? If I run an executable and it generates files next to it, where would that be when you run a UWP?
Can I set that location in the AppxManifest?
Is there anyway to see if it has run correctly or not?
Edit:
Could this be a file permissions issue? My application needs to write to 'C:\MyFolder' & creates a folder with a load of files next to the executable upon startup and that doesn't happen.
So looking into this a bit more I came across this blog which discusses preparing for conversion. I think the above file accesses probably contravene the following:
Your app writes to the install directory for your app. For example, your app writes to a log file that you put in the same directory as your exe. This isn't supported, so you'll need to find another location, like the local app data store.
This looks like a fairly halting issue, am I correct in that assumption?
If your app is writing to the install directory you will need to change that code to write to your local app data folder instead, as the preparation guide calls out.
Write operations to the install directory are not allowed in order to ensure the ability for the app deployment stack to perform seamless, differential updates and clean uninstalls of your app.
Btw, to debug through your app launch failures you can do the following in Visual Studio: Debug -> Other Debug Target -> Debug Installed App Package -> select your app from the list of installed apps.

Resources