when I delete the AppSetting "WEBSITE_TIME_ZONE" in my Azure Webapp (Linux), it is there again after refreshing.
I can delete other AppSettings without problems, but this particular entry keeps coming back.
This is how I proceed. I delete the setting "WEBSITE_TIME_ZONE" via the trash can button, click on Save (then the entry is gone), then I click on Refresh and then the entry shows up again.
Has anyone had this problem and can help me?
Please try deleting that specific app setting via the command line.
az webapp config appsettings delete is the Azure CLI command:
az webapp config appsettings delete --name <your-webapp-name> --resource-group <resource-group> --setting-names <setting-names>
P.S.: You can use the Azure Cloud Shell if you do not have Azure CLI installed on your machine.
Related
I want to automate mapping a custom domain for my web app's deployment slots(not the production slot). I have achieved this through the Azure Portal with this guide, but I can't get it to work through the AZ CLI. It appears that in the cli, only through for the production slot is possible to achieve mapping a custom domain. This is the command to do it for the production slot but I can not see an option for other slots on the same web app. Also whatever I try on the webapp-name parameter to try and reference the slot(as supposingly is a separate web app) doesn't work(it keeps giving me app not found errors):
az webapp config hostname add --webapp-name <app_slot_name> --resource-group <rg> --hostname <cname_that_already_exists>
You can use --slot.
Offical doc.
az webapp config hostname add
az webapp config hostname add [--hostname]
[--ids]
[--resource-group]
[--slot]
[--subscription]
[--webapp-name]
I'm trying to Connect a Azure Webb app (containers) to an Azure Container Registry Using the Azure CLI. I have an Azure Container Registry located in the same Ressouce Group as the Webb App.
My command looks like this:
az webapp config container set --name "containerbugdemo" --resource-group "Containerbug" --docker-custom-image-name "application/helloworld:latest" --docker-registry-server-url "https://"$arcName.azurecr.io" --docker-registry-server-password "****" --docker-registry-server-user "***"
After running the command the container settings blade shows the following error:
Failed to get a list of tags.
And the Container fails to get pulled by the WebApp.
If I try the same procedure only using the graphical interface through the Azure portal, everything works as expected.
It seems you set the wrong image name. If you use the image in the ACR, you need to set the image name as acrname.azurecr.io/repository:tag, both when you create the web app and container setting, not just repository:tag. And the server URL is also a mistake that one more double quote in the question.
I haven't found a command line switch for enabling diagnostic settings when creating a VM with the Azure CLI.
I know it works in the portal, but likely this is a separate step in the deployment template.
However, there is a new command line switch for enabling log analytics workspace immediately (Preview).
az vm create cli does not provide the arguments about diagnostic settings, so I am afraid that we cannot enable diagnostic settings when creating an azure vm.
As workaround, you can try to enable the diagnostics settings using Azure CLI by following this document.
az vm diagnostics set --settings
[--ids]
[--no-auto-upgrade {false, true}]
[--protected-settings]
[--resource-group]
[--subscription]
[--version]
[--vm-name]
Here is a case on github you can refer to .
In azure web app we have two option to publish our code:
Via Code
Via Docker image
is there any way i can switch between this two.
Actually if you select Publish Profile as Connection Type you cannot deploy docker image. Please check this:
for Azure Resource Manager you can select container deployment:
but for Publish Profile you don't have this choice:
The same apply for YAML version.
I'm afraid that you can not change from code to container , but you can have two instances of your code, one using code and one using container within the same service app. You can re-created your webapp with the same name but with a different deployment method in the portal.
For details , please refer to this ticket with similar issue.
To switch the publish method from docker to code you can set the linuxFxVersion via Azure CLI. For example:
az webapp config set --name myWebApp --resource-group rgname --linux-fx-version 'DOTNETCORE|3.1'
To switch from code to docker you can just deploy a docker container and the web app will automatically switch to the docker publish method. For example:
Set-AzureRmWebApp -ResourceGroupName rgName -Name myWebApp -ContainerImageName imageName:tag -ContainerRegistryUser userName -ContainerRegistryPassword $passwordSecure -ContainerRegistryUrl url
I have not tested it for windows apps but I supect it will behave similarly.
Is it possible to change an environment variable on an Azure Cloud Service without publishing? I'd like to be able to change a variable and then restart my app, but I don't need to re-deploy.
To change the configuration settings in the portal, login into the portal (Please note that currently the preview portal does not support cloud services) and the select your cloud service and then click on CONFIGURE tab. You will see all settings there.
You can also change the configuration settings through Azure PowerShell Cmdlets as well. So what you would do is make the change in the cscfg file and then execute Set-AzureDeployment Cmdlet. Following is an example of changing the configuration file:
Set-AzureDeployment -Config -ServiceName "MySvc1" -Slot "Staging" -Configuration "C:\Temp\MyServiceConfig.Cloud.csfg"
Some points I do want to mention in the answer:
You can only change the settings stored in *.cscfg file without redeploying your code. If there are settings in your app/web.config file which you want to change, then you would have to redeploy the application.
If you want to add new settings, then you have to redeploy the application. You can't add new settings dynamically at this time.