I have deployed a web app bot in Azure. I am trying to update it's application settings using Azure Cli. Please find the commands below:
az webapp config appsettings set -g <ResourceGroup> -n <ResourceName> --subscription <AZsubscription> --settings SettingToChange=SettingValue
The command fails saying that it was not able to find Resource under the Resource Group mentioned in the command.
I think the above command is for azure web app and not for web app bot. What command should I use to update application settings for web app bot ?
Thanks
I think the above command is for azure web app and not for web app bot. What command should I use to update application settings for web app bot ?
No, the command az webapp config appsettings set should work for the azure web app bot, I test it on my side, it works fine. I think you need to make sure you have passed the correct parameters.
My specific test command:
az webapp config appsettings set -g joywebapp -n joywebbot --subscription <subscription id> --settings testkey=test1
Result:
Check in the portal:
Related
I am using Azure Spring Apps, and I am deploying a very simple Spring App
I have deployed my spring app to azure like so :
az spring app deploy --resource-group myResourceGroup --service myService --name myName --artifact-path target/myApp-0.1.0.jar
On the azure portal it says that the deployment has "failed"
I would like to view my app logs to see what went wrong, as everything works fine for me locally.
Is there a straightforward simple way to view my spring boot logs in azure?
You can use Azure CLI to get logs:
az spring app log tail -n xxx -s xxx -g xxx --subscription xxx --lines 200
Refs: https://learn.microsoft.com/en-us/cli/azure/spring-cloud/app/log?view=azure-cli-latest
I am working on a new webapp in azure cloud.
The challenge is that I am working on a new python module that I dont know that well, Pyspice. Pyspice interface to a program Ngpspice.
On my windows PC it works fine but not on the cloud. So I would like to be able to do debugging without pushing and then wait 25min for each build.
Right now I am using SSH to connect to the webapp. Then I can create a simple python script to see if I can get the connection to work between pyspice and ngspice. The challenge I have is that when I run python in SSH then it uses a different environment than the webapp, i.e. all the modules in the requirements.txt is not available. So how can I change environment to be able to debug?
I have created an Azure App service with Python version 3.8, when I check the version in Azure SSH it is showing me different version.
To install the latest version in Azure SSH, run the below command
apt update
apt install python3.9
python --version
Run the below command to change the python version of the Azure App service in Azure Cloud Shell (Bash).
az webapp config set --resource-group MyRGName --name WebAppName --linux-fx-version "PYTHON|3.9"
To check the updated version, run the below command
az webapp config show --resource-group MyRGName --name Python4Nov --query linuxFxVersion
debug azure webapp using ssh
To remote debug Azure Linux App Service, we need to open a TCP Tunnel from the development machine to Azure App Service.
Configure for SSH and Remote Debugging
In Azure CLI run the below command
az webapp create-remote-connection --resource-group MyRG -n WebAppName
References taken from MSDoc
What is Working:
Presently I'm using Visual Studio to successfully publish my ASP.NET Core web apps to Docker hub.
What I have tried that is NOT Working: The "dotnet publish" command is not doing the same job -- probably because I'm not specifying my docker hub account... After looking at the documentation, I don't see how I can specify my docker hub account.
What I want: How can I write a script that does what the "publish" button does in visual studio (and publish to docker hub)?
You can use docker login -u YourDockerHubName command login.
I downloaded the Publishing Profile from my App Service and created a profile on my WebApi.
When I execute "publishing" using VS 2017, it works fine.
When I try to execute deploy command on Jenkins if fails. The error message I have is :
Deployment task failed. (Connected to the remote computer ("XXXXXXXX") using the Web Management Service, but could not authorize.
Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Connected to the remote computer ("xxxxxxxxxxx") using the Web Management Service, but could not authorize.
The remote server returned an error: (401) Unauthorized.
I have a step on Jenkins using PowerShell command line like :
msbuild My.WebApi /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True /p:PublishProfile=$myPublishProfile
It builds without errors
$myPublishProfile is a valid Path
This Jenkins instance runs on a Server, not on my machine.
Jenkins has its own SMC user and server auth user.
App Service has WEBSITE_WEBDEPLOY_USE_SCM set to False
I am using the same Publishing Profile to build on Jenkins and on Visual Studio.
If both are using the same Publishing Profile, why I am getting the Auth error ?
Is there is any other config I should do to perform Deploy from Jenkins ?
When you publish using visualstudio the password is stored in an encrypted file on your disk. If you need to publish with the msbuild-command you can add credentials on the commandline or in the publishprofile
append theese properties on the commandline:
msbuild ... /p:UserName=XXX /p:PassWord=YYY
or include in the profile
<UserName>XXX</UserName>
<Password>YYY</Password>
I'm using a Kubernetes cluster in Azure running an ingress controller. The ingress controller routes to different services via a given context root.
To add another service and connect it to my ingress I build a simple shell script looking like this:
kubectl apply -f $1'-svc.yaml'
some script magic here to add a new route in the hello-world-ingress.json
kubectl apply -f 'hello-world-ingress.json'
I tested the script on my local machine and everything works as expected. Now I want to trigger the script with an HTTP rest call on Azure.
Does anyone have an idea how to do that? So far I know:
I need the Azure cli with Kubernetes to run the kubectl command
I need something to build the HTTP trigger. I tried using AzureFunctions, but I wasn't able to install the Azure cli in Azure Functions on the Azure Portal and I wasn't able to install Azure cli + Azure Functions in a Docker Container.
Does anyone have an idea how to trigger my shell script via HTTP in Azure in an environment where the Azure cli exists?
The easiest way, in my opinion, is to set up an Azure instance with kubectl and the Azure cli configured to talk to your cluster and on that same server setup something like shell2http. For example:
shell2http -export-all-vars /mybash "yourbash.sh"
shell2http -form /apply "kubectl apply -f $v'-svc.yaml'"
shell2http -export-all-vars /domore "domore.sh"
Where $v above is the name of your deployment.