Change Region on GCP App Engine Flex - region

I am trying to deploy a app engine flex project but I am always getting the following error message:
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: Flexible Environment deployments are not supported in the apps region 'europe-west'.
I do know that app engine flex is not supported in Europe at this point in time, but the weird thing is that I do not have an option to select another one, neither at the cli or UI level.
Plus, in my gcloud local config I have region 'us-east1-b' selected as my default region (not sure if this makes any difference).

Run 'gcloud init' in your GDK: the account, project and zone in which you are working will be listed. Choose the options you want and everything should be fine. Cheers.

Related

How to change Azure App Services Github workflow deployment environment name

When you create an app there's no option to customize this, it's just there by default.
This matters because sometimes I don't want github actions to say that I'm deploying to "production", I want it to say I'm deploying to "development". But if I change this property manually, I'll get an error in github actions saying: Error: Deployment Failed with Error: Error: Publish profile is invalid for app-name and slot-name provided. Provide correct publish profile credentials for app. But then as soon as it's changed back the deployment works again, so I need to find a way to change this property in Azure?
Always the main slot of the webapp is called production, there is no way to change it.

How to run a Node app (NextJS) on gcloud from github?

I have followed these steps:
I installed `Google Cloud Build app on Github, linked it to Cloud Build and configured it to use a certain repository (a private one)
I set up a trigger at Cloud Build: Push to any branch
the project has no app instances after deploying (App Engine -> Dashboard)
My cloudbuild.yarml looks like this:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '--project=project-name', '--version=$SHORT_SHA']
If I try to run the trigger manually: I get this error in Google Cloud:
unable to get credentials for cloud build robot
I have also tried to set IAM roles based on this article but using #cloudbuild.gserviceaccount.com doesn't seem to be a valid "member" (perhaps I need two projects, one for running and one for building the app?)
How do I fill the gaps / fixes the errors mentioned?
It seems the error message looking for credential that has the required permission. From the article that you are following, in the step #4, don't add manually the Service Account for Cloud Build. Check if you enable the Cloud Build API in your project, if the API is disabled try to enable. It will automatically create the Service Account for Cloud Build and look likes this:
[PROJECT_NUMBER]#cloudbuild.gserviceaccount.com
Once the service account is created, go to Cloud Build > Setting page and enable the required roles for you application.

Azure Function App : Error when loading V3 in portal for fresh function app?

I follow the documentation to setup an app function with runtime version V3 but it throws InternalServerError. How can I create an app function to work with V3? These are my steps:
I create a fresh app service azure function app (in portal).
When the resource is ready and without making any changes or enter any code in portal or deploy any code from VS, I go to Function App Settings and shows "~3" selected, Runtime version: Runtime version: loading... (it's stuck there) and error mssg in a box on the right hand side of the screen:
Error: Encountered an error (InternalServerError) from host runtime
I tried to select runtime version ~2 in Function Application settings, but the Runtime Version shows "loading..." and if I exit and go back to this function, it shows ~2 as selected but the InternalServerError continues to show and Runtime version shows "loading..."
If I change to version ~1 it works showing runtime version 1.012967.0. But I can't change back to V3 because it shows internalServerError again.
According to documentation "function apps are created in version 2.x of the runtime" but when I first created the function it seems to create it in V1?. Kudu showed at home/LogFiles/eventlog.xml "Provider Name="IIS AspNetCore Module V2"/"
I later tried to deploy my VS code into this function app with V3 functions in VS and portal but of course this would not work. And deploying V3 from VS with V1 in portal is not the suggested process by the documentation "Although the runtime version is determined by the FUNCTIONS_EXTENSION_VERSION setting, you should make this change in the Azure portal and not by changing the setting directly. "
Finally, if I try to create the app function from VS, it automatically creates it with V2 and when checking in the portal I get the same internalservererror. It only works with V1 1.0.12967.0 (~1).
Help really appreciated
Errors such as this can occur if AzureWebJobsStorage app setting is missing or invalid.
The reason for your problems is probably an issue with the selected Storage Account, since switching to a new one helps. Maybe there is a lock or something which blocked the account.
Azure Functions V3 are compatible with General Purpose V2 Storage Accounts - I just checked and we have a couple of them up and running.
In my case it was the WEBSITE_RUN_FROM_PACKAGE app setting that was empty due to some misconfigured Terraform. In my scenario its value should have been 1.

Google App Engine PHP (standard): Permissions error fetching application

Every now and then I lose the permissions for a project to be deployed via Google App Engine PHP.
HttpException: Permissions error fetching application [apps/PROJECT_ID]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.
I use Jenkins, and I can see via the config history that nothing changed. Even if I escalate the privileges to "project owner" in console.cloud.google.com - same results: permissions denied.
The only way I am able to solve this issue is create a complete new app engine project.
Question: why do IAM accounts expire, and what is the recommended way of using credentials to automate deploys with Google App Engine PHP ?
I had this error message and for me the error was due to switching projects by using "gcloud config set project PROJECT_NAME" instead of "gcloud config set project PROJECT_ID".
I was able to solve it by appending --configuration CONFIG_NAME additionally to my gcloud app deploy command. I don't know why some projects work by just specifying the --project arg, and others not.
In any case it seems cleaner to always explicitly set the configuration-arg per gcloud command

Deploy a resource group with App Service

I have published an API app from Visual Studio to a new resource group, also created an App Service Plan, so after the deployment the resource group contains 2 items:
AppServicePlan1
AppService1
Now I am trying to deploy these items to another resource group as follows:
Select 'Automation script' in the resource group settings
Click 'Deploy'
Select 'Create new' resource group, enter its name
Enter 'Serverfarms_AppServicePlan1_name' parameter value (new app service plan name, e.g. AppServicePlan2)
Enter 'Sites_AppService1_name' parameter value (new app service name, e.g. AppService2)
Tick 'Agree to terms and conditions'
Click 'Puchase'
The process fails with the following error message:
"The host name AppService1.azurewebsites.net is already assigned to another Azure website: AppService1."
I have tried different things - deploying app service plan, logic apps, etc. from one resource group to another works fine, but deploying an app service fails as described above.
I have tried changing the hostNames property in the template file to ["AppService2.azurewebsites.net"] manually - I'm not getting the error then (although I'm not sure, maybe something else also needs to be changed, e.g. properties enabledHostNames, hostNameSslStates?) and the deployment seems to work, however the 'deployed' app service can't be used as it contains only 1 file - hostingstart.html.
What am I missing?
I think you have everything correct - as you noticed when you use the generated automation script it will create everything with the same properties that currently exist. We try to parameterize the correct value (like the web app name) but there are some details that can be overlooked (like host names). After changing all that it sounds like you got it to deploy.
The "code" however is not part of the automation script - only the infrastructure and configuration. So you still need to deploy your app to have it be identical. You can folder app deployment into the JSON template (using webdeploy or github) but since that requires access to external artifacts, that's not done automatically.
That help?

Resources