usage error when creating Webapp in Azure App service - azure

I'm currently following azure official guide on node app deployment in azure app service. LINK
Need to create a web app for the resource group and plan given by the client with below command
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app_name>
But whenever I do it I get the below error.Any idea how to overcome this error. Thanks
usage error: --runtime | --deployment-container-image-name | --multicontainer-config-type TYPE --multicontainer-config-file FILE

I think I figured that out when u create a linux runtime based plan u have to make sure
--runtime "node|10.10"
parameter is added.That did the work for me

Related

problem when Creating a web app with Azure command-line interface?

I am newbie with microsoft azure and trying to study and follow the tutorial.
But my problem is, here is my tutorial :
# generate a unique name and store as a shell variable
webappname=mywebapp$RANDOM
# create a resource group
az group create --location westeurope --name myResourceGroup
# create an App Service plan
az appservice plan create --name $webappname --resource-group myResourceGroup --sku FREE
# create a Web App
az webapp create --name $webappname `
--resource-group myResourceGroup `
--plan $webappname
And my problem is, when I coded the code az group create --location westeurope --name myResourceGroup, it always said to me that I must login to azure but I login to azure before that.
And when I searched how to create a web app with azure CLI online, it show me a very different version command like this
https://www.youtube.com/watch?v=qILUM6DyruM
Could you please give me some advise for this problem ? Thank you in advance.

How to change plan when deploing the app?

I had created my own subscription for Azure App Service. Then I had deployed my app (used CLI)
After that I remove the app, the resource group as well as subscription itself.
Now I got corporate subscription, create App Service via Azure UI and now trying to deploy my app to there.
When I use command
az webapp up --name MyAppName
i get message: The webapp 'MyAppName' exists in ResourceGroup 'MyCorporateGroup' and does not match the value entered 'MyPrivategroup '. Please re-run command with the correct parameters.
When I use command:
az webapp up --name MyAppName --resource-group MyCorporateGroup --subscription MyCorporateSubscription
I get: The plan name entered 'MyCorporateGroup_0' does not match the plan name that the webapp is hosted in 'MyCorporatePlanForAppService'.Please check if you have configured defaults for plan name and re-run command.
And when I use command:
az webapp up --name MyAppName --resource-group MyCorporateGroup --subscription MyCorporateSubscription -p MyCorporatePlanForAppService
i get message: Creating AppServicePlan MyCorporatePlanForAppService ...
(InvalidResourceLocation) The resource 'MyCorporatePlanForAppService' already exists in location 'germanywestcentral' in resource group 'MyCorporateGroup'. A resource with the same name cannot be created in location 'centralus'. Please select a new resource name.
Does anyone know how can i deploy my app to the corporate app service?
Thanks
The problem has been resolved when I remove .AZURE folder from my local machine. And then rebuild the app.
It seems to me you're not changing from one context to another. Try executing the following command before trying to update the web app in your corporate subscription:
az account set -s <corporate-subscription-name-or-id>

Unable to create the webapp using Azure CLI

I am using the below commands for creating the webapp using Azure CLI but getting the below exception-
Unable to retrieve details of the existing app 'newapp2'. Please check that the app is a part of the current subscription
Command -
az webapp create --name newapp2000 --resource-group staging-grp --plan newappplan2000 --runtime "DOTNETCORE|3.1"
subscription- payasgo
Looking forward for assistance.
A very effective way to check if your commands work or not is going to portal, login with your account, check if your web app exist in your subscription or not.
If you don't want to use portal, you could also use CLI commands. You should check if the session you are using linked to your subscription or not:
az account show --output table
If not, use this command to switch to a different subscription:
az account set --subscription "My Demos"
You could also specify the subscription in the command while creating your web app:
az webapp create --resource-group StorageGroups --subscription "My Demos" \
--name newapp2000 --location eastus --plan newappplan2000 --runtime "DOTNETCORE|3.1"

Enterprise bot msbot clone services command hangs

I've created a bot from the VS Enterprise bot template. When I run the "msbot clone services" command, it hangs in the middle of the script after creating the Azure Search service. There are no apparent errors running --verbose but the script is clearly hung and only installs half of the services in Azure.
Azure shows all the steps so far a successful. Can anyone suggest how to get more logging information than using the --verbose flag?
D:\Dev\sobot181214\sobot181214 msbot clone services --name "sobot181214" --luisAuthoringKey "**REDACTED**" --folder "DeploymentScripts\en" --location "westus" --verbose
Checking az botservice version
az -v
checking dotnet requirement
dotnet --version
Fetching subscription account
az account show
The following services will be created by this operation:
Service Location SKU Resource Group
Azure App Site Plan westus S1 sobot181214
Azure AppInsights Service West US 2 F0 sobot181214
Azure Blob Storage Service westus Standard_LRS sobot181214
Azure Bot Service Registration Global sobot181214
Azure CosmosDB Service westus 1 write region sobot181214
Azure LUIS Cognitive Service westus S0 sobot181214
Azure LUIS Cognitive Service westus S0 sobot181214
(Dispatch)
Azure QnA Maker Service westus S0 sobot181214
Azure Search Service westus Standard sobot181214
Azure WebApp Service (Bot) westus sobot181214
Azure WebApp Service (QnA) westus sobot181214
Resources will be created in subscription: Pay-As-You-Go Dev/Test (**REDACTED**)
Would you like to perform this operation? [y/n]y
Creating Azure group [sobot181214]
az group create -g sobot181214 -l westus --subscription **REDACTED**
Creating Azure Bot Service [sobot181214]
az bot create -g sobot181214 --name sobot181214 --kind webapp --location westus --insights-location "West US 2" --subscription **REDACTED** --version v4 -- lang CSharp --verbose
[az bot] INFO: Microsoft application id not passed as a parameter. Provisioning a new Microsoft application.
(Please be patient, this may take several minutes)
[az bot] To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code xxxxxxx to authenticate.
Fetching bot extended information [sobot181214]
az bot show -g sobot181214 -n sobot181214 --subscription **REDACTED**
Fetching co-created resources [sobot181214]
az resource list -g sobot181214 --subscription **REDACTED**
Fetching bot website appsettings [sobot181214]
az webapp config appsettings list -g sobot181214 -n sobot1812141nay --subscription **REDACTED**
Creating LUIS Cognitive Service [sobot181214-LUIS]
az cognitiveservices account create -g sobot181214 --kind LUIS -n "sobot181214-LUIS" --location westus --sku S0 --yes --subscription **REDACTED**
Fetching LUIS Keys [sobot181214-LUIS]
az cognitiveservices account keys list -g sobot181214 -n "sobot181214-LUIS" --subscription **REDACTED**
Creating site plan [sobot181214]
az appservice plan create -g sobot181214 --sku s1 --name sobot181214 --subscription **REDACTED**
Creating Azure Search Service [sobot181214-search]
az search service create -g sobot181214 -n "sobot181214-search" --location westus --sku standard --subscription **REDACTED**
based on the code snippet and output log that you have provided, I see that it was successfully executing various commands (i.e., creating group, creating bot, showing bot, listing resource, listing webapp config appsettings, creating cognitiveservices account, listing cognitiveservices account keys, creating appservice plan respectively) until it has reached the step to create search service. But I think there was some issue while creation of appservice plan step or even while creation of bot step. So just to understand the issue better, by chance if you have appservice plan named ‘sobot181214’ still available and bot webapp named ‘sobot181214’ still available then can you check if they are properly created or are they in a kind of corrupted or unstable state ?
Also the catch point is as per this (https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-enterprise-template-deployment?view=azure-bot-service-4.0) link, it states that some users might experience issues if ‘--appId’ argument is not provided while running the command ‘msbot clone services’. So can you browse to https://apps.dev.microsoft.com and manually create a new application retrieving the ApplicationID and Password/Secret. And then run the ‘msbot clone services’ command along with the arguments ‘--appId’ and --appSecret’ passing the values you have just retrieved and let me know the outcome. Also ensure that you wrap the secret with quotes to prevent parsing issues, e.g: --appSecret "YOUR_SECRET".
On the other hand, if you are interested to debug the current issue in detail, you may try to update all the ‘az’ commands in the script ‘C:\Users\USERNAME\AppData\Roaming\npm\node_modules\msbot\bin\msbot-clone-services.js’ appended at the end with ‘ --debug’ parameter which would increase the logging verbosity to show all debug logs while executing ‘msbot clone services’ command. But in some cases, updating ‘msbot-clone-services.js’ file corrupts the msbot related packages. In case if that happens then you may uninstall and re-install msbot and related packages by running the command ‘npm install -g ludown luis-apis qnamaker botdispatch msbot chatdown’ as instructed in this (https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-enterprise-template-deployment?view=azure-bot-service-4.0) link.
Hope this helps!!

Deploy azure container registry images into an azure web app with docker-compose

I'm trying to run a multicontainer web app based in two images that I stored in an azure container registry (launched with a docker compose yml custom file) but it fails because the docker-compose proccess cannot get the images due to an "unauthorized: autentication required" response. Both the container registry and the web app belongs to the same resource group.
How can we solve this problem? Thanks in advance.
#jennylwrnce from Azure Developer App Service Team tweeted this:
https://blogs.msdn.microsoft.com/appserviceteam/2018/06/27/use-acr-for-multicontainer-web-app/
So it can be solved via panel.azure.com
enter image description here
You need to configure authentication for the webapp, by default it can only pull public images.
this is the sample command to do that:
az webapp config container set --name <app_name>
--resource-group myResourceGroup
--docker-custom-image-name <azure-container-registry-name>.azurecr.io/mydockerimage
--docker-registry-server-url https://<azure-container-registry-name>.azurecr.io
--docker-registry-server-user <registry-username>
--docker-registry-server-password <password>
https://learn.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image#use-a-docker-image-from-any-private-registry-optional
this article also talks about how to push to the private repo (ACR) and how to configure it

Resources